Mount HFS+ in Ubuntu Live CD with Write Access
November 4th, 2009 by derekPartitions using Apple’s HFS+ format automatically mounted with read permissions, but not write permissions. Here’s how I was able to mount my drive with read and write permissions.
Although these steps likely apply to many ubuntu distros, here are the particulars:
- Western Digital MyBook 1TB formatted HFS+ with Journaling
- Ubuntu 9.10 Live CD
Up front here are the gotchas
- Journaling on your HFS+ partition must be turned off, which is easiest done with Disk Utility on OS X
- You have to manually mount the drive to get write permissions
- When mounted, sometimes the drive initially is not owned by the current user so in the File Browser it will appear not to be writeable.
Step 1: Disable Journaling
Journaling is a feature of HFS+ that provides protection in case your drive is unsafely removed. In a nutshell, it keeps a back record of operations that are about to happen on the disk so that if the disk is turned off before the operations actually happen, the drive can quickly recover when it is next plugged in.
To disable it, follow either of these directions sourced from an Apple Support Document. These require you to have access to OS X. I am not sure if this is possible through a linux command line.
With Disk Utility
- Open Disk Utility (Applications/Utilities)
- In the column listing all your drives, select the partition you want to disable journaling for.
- Go to File > Disable Journaling. If it doesn’t pop up, you may have to hold down the option key.
If this succeeds, the Format field at the bottom of the program should say “Mac OS Extended” rather than “Mac OS Extended (Journaled).” Safely eject your drive in the finder window.
With Command Line
- Make sure your drive is plugged in and the partition is mounted (it should show up in finder)
- Use the following command, where yourdrivemount is the name of your mounted drive in the Volumes directory:
- sudo /usr/sbin/diskutil disableJournal /Volumes/yourdrivemount/
It should print out a message for you saying either journaling was disabled, or it was already disabled. Safely eject your drive in the finder window!
Step 2: Mount in Ubuntu
This requires some terminal work. Basically we’re going to plug in the drive, make sure its unmounted, mount it with read/write permissions, and then change the owner to the current user.
- Plug in drive, which will likely automatically mount your partition with write access
- Find your drive device path by typing in terminal sudo cat /etc/mtab and looking for a line like “/dev/sde3 /media/My\040Book hfsplus …” In this case, /dev/sde3 is the device path of my partition
- Unmount the partition with sudo umount /dev/sde3 where /dev/sde3 is your device path. The partition should dissapear from your Places column in File Browser
- Mount the partition with write access with sudo mount -t hfsplus -o rw /dev/sde3 ~/mybook where /dev/sde3 is your device path and ~/mybook is a directory of your choice (that exists) where you want your partition to be mounted to
- If necessary, recursively change the owner of the mount folder to yourself. On the live cd, my user name is “ubuntu” so I use the command sudo chown -R ubuntu ~/mybook where “ubuntu” is my username and ~/mybook is the folder where you mounted your drive.
The folder should now be read/writeable in the File Browser. Hope it worked!
Sources
Ubuntu Forums 1
Ubuntu Forms 2
Mac OS X: About File System Journaling
chown
mount
umount