Read/write MAC disk on Ubuntu

From ITSwiki
Jump to: navigation, search

There is not a beautiful solution for this, as the hfsplus filessytem doesn't support uid and gid mount options. So a hacky workaround would be the following.

Be sure you only have one Mac harddisk connected when doing the following

sudo apt-get install hfsprogs
sudo mkdir /media/mac

sudo bash
uuid=$(blkid -t TYPE=hfsplus -sUUID | awk -F'"' '{ print $2 }')
echo "UUID=$uuid /media/mac hfsplus nobootwait,user 0 0" >> /etc/fstab
exit

sudo apt-get install bindfs
mkdir ~/mac
sudo bindfs -u $(id -u) -g $(id -g) /media/mac ~/mac

Once you mount the USB disk through the file mananger, you will have a directory in your home folder called mac where you can read and write to the USB disk.

The only problem is, that files saved from Linux are saved with user id 1000, where OSX uses 99. So a very hacky way to fix this is

 sudo chown -R 99:99 /media/mac

each time you are done with the harddisk and want to use it on OSX.