8
7
I have a dual booting macbook pro with Snow Leopard and Kubuntu 11.10, and want to read (don't care about write) my home Mac home directory when I'm running Kubuntu.
I can mount it without any problems, but my user on Kubuntu on can't see the files on the HFS+ owned by the mac user, because of different uid (502 on Mac, 1000 on Kubuntu).
Looking at kernel docs about HFS+ I read that:
When mounting an HFSPlus filesystem, the following options are accepted:
[CUT]
uid=n, gid=n
Specifies the user/group that owns all files on the filesystem
that have uninitialized permissions structures.
Default: user/group id of the mounting process.
So I tried using these options:
$ sudo mount -t hfsplus -o uid=1000,gid=1000 /dev/sda2 /mnt/Mac
But they seem doing nothing: I still see the same permissions when I look around using ls -l. I may be missing something, any clue?
I know that I can change my user id on Ubuntu to match it with Mac Os X, but I'd prefer avoiding it if possible.
As I don't have the reputation to comment, I'm just going to note that there is a small mistake in Catskul's answer, an = missing, should be: sudo bindfs --map=502/1000 /media/diskFoo ~/myUIDdiskFoo – J. Simon van der Walt – 2017-07-04T19:21:55.857
Very cool solution. It solves the problem without changing default behaviours the OSes, and makes possible a lot of more options. Just be careful if the system is shared with other users, this may expose private files to unexpected audience. – gerlos – 2013-10-08T16:30:22.000
1Yeah. I was surprised that the system mount utility doesn't offer this ability. Alternatively you can use bindfs'
map
functionality to simply map user 502 to 1000 which might be safer and more of what you had intended. – Catskul – 2013-10-08T18:33:43.127