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...")
 
 
(3 intermediate revisions by one user not shown)
Line 1: Line 1:
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 the following.
+
There is not a beautiful solution for this, as the hfsplus filessytem doesn't support <code>uid</code> and <code>gid</code> mount options. So a hacky workaround would be the following.
  
 
Be sure you only have '''one''' Mac harddisk connected when doing the following
 
Be sure you only have '''one''' Mac harddisk connected when doing the following
Line 7: Line 7:
 
sudo mkdir /media/mac
 
sudo mkdir /media/mac
  
uuid=$(blkid -t TYPE=hfsplus -sUUID|awk -F'"' '{ print $2 }')
+
sudo bash
echo "UUID=$uuid /media/mac hfsplus nobootwait,user 0 0" >> /etc/fstab
+
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
 
sudo apt-get install bindfs
Line 19: Line 21:
 
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]]

Latest revision as of 14:00, 6 August 2015

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.