Ubuntu – Accessing Mac filesystem from xUbuntu


I have a macbook pro with 2 OS's… Mac OSx and Xubuntu (newest release.)

I have followed a lifehacker guide on allowing access of my OSx partition when booted into my linux OS which included changing the linux uID, and disabling Journaling on my HFS+ drive.

I see my OSx partition when booted in linux in my file browser, but when I go into it deeper, I get 'Access Denied.' I see that, in OSx's disk utility, i have the option to disable encrypting, but when I hit it, nothing changes… Would that encryption be interfering?

Any ideas?

Best Answer

  • The problem isn't encryption, it's file permissions. IIRC, OS X gives its default user a user ID (UID) of 501, whereas in Ubuntu the first user's UID is 1000. Thus, the files on the disk appear to be owned by somebody other than you, which means you'll have no access to those files as anything but root.

    You can change the UID of your OS X user or of your Linux user. For Linux, you can use usermod to do this, but you'll need root privileges, and this is a bit awkward given the way Ubuntu sets things up unless you've got two accounts with administrative privileges. Also, using a UID that's lower than 1000 will create some (mostly minor) complications. See this question on this site for more on this topic. I'm not sure how you'd change your OS X UID to 1000, offhand; perhaps a Web search or asking on an OS X site will help.

    I must question the wisdom of granting read/write access to your main OS X partition from Linux, though. This is asking for trouble, for three main reasons:

    • The Linux HFS+ driver, although pretty good, may have bugs that could cause data loss. If you run into such bugs, the mere act of mounting the OS X volume in Linux could trash all the data on that partition. I'd like to emphasize that I don't know that such bugs actually exist, but they might.
    • By disabling the journal on the HFS+ volume, you'll increase filesystem check times, which could slow down the boot process if OS X needs to run a filesystem check.
    • Linux doesn't include explicit safeguards against damaging OS X system files. Although ordinary file permissions should help, an accident as root in Linux could trash the OS X system.

    Similar comments apply to accessing the Linux partition from OS X, too, although you might not need to disable a journal to do the job. (I haven't checked the latest status of OS X's Linux filesystem drivers on this score.)

    Instead of mounting your OS X root (/) partition in Linux with read-write access, it's probably better to create a separate data-exchange partition. If you don't need to exchange big (over-4GiB) files, FAT will handle this task quite well, and using FAT will bypass the UID issues that are the root cause of your problem. So will NTFS, but unless you're triple-booting with Windows, using NTFS is inadvisable because there are no good NTFS repair tools in OS X or Linux, so sooner or later an NTFS volume would become inaccessible. Thus, if FAT is inadequate, a separate HFS+ volume is probably best. You'd then need to either synchronize your UID values or set very permissive permissions on the directories you use in the file-exchange partition (including its root directory).