Difference between revisions of "Read/write MAC disk on Ubuntu"

From ITSwiki
Jump to: navigation, search
[quality revision][quality revision]
(Created page with "There is not a beautiful solution for this, as the hfsplus filessytem doesn't not support <code>uid</code> and <code>gid</code> mount options. So a hacky workaround would be t...")
 
Line 7: Line 7:
 
sudo mkdir /media/mac
 
sudo mkdir /media/mac
  
uuid=$(blkid -t TYPE=hfsplus -sUUID|awk -F'"' '{ print $2 }')
+
uuid=$(blkid -t TYPE=hfsplus -sUUID | awk -F'"' '{ print $2 }')
 
echo "UUID=$uuid  /media/mac  hfsplus nobootwait,user 0 0" >> /etc/fstab
 
echo "UUID=$uuid  /media/mac  hfsplus nobootwait,user 0 0" >> /etc/fstab
  
Line 19: Line 19:
 
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
 
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
+
   sudo chown -R 99:99 /media/mac
  
 
each time you are done with the harddisk and want to use it on OSX.
 
each time you are done with the harddisk and want to use it on OSX.
 
 
 
 
 
  
 
[[Category:Mac]]
 
[[Category:Mac]]

Revision as of 18:49, 4 August 2015

There is not a beautiful solution for this, as the hfsplus filessytem doesn't not 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

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

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.