evansj57
Posts: 9
Joined: Fri May 03, 2013 9:04 pm

HFS+ Mount Problems Solved

Sat Nov 09, 2013 11:48 am

I wanted to auto-mount a HFS+ formatted USB drive to my Pi so that it could be used by PCs and Macbooks on my home network for sharing. As I also want to be able to connect the USB drive directly to the Macbooks from time to time. HFS+ seems to be the preferred drive formatt to do this.

It took me a while to mount the HFS+ USB drive to the Pi, so hopefully, the following will save someone some time.

First I installed HFS+ support:

Code: Select all

sudo apt-get install hfsplus hfsutils hfsprogs
Then after using blkid to get the drive's UUID, I created a mount point, used chmod to change the mount point permissions to 766 (full,r/w,r/w) and edited fstab:

Code: Select all

UUID = xxxxxxxxx      /media/usbdrive     hfplus   defaults   0   0
But when I ran 'mount' it showed that the USB drive had on only mounted as ro (read only):

/dev/sda2 on /media/usbdrive type hfsplus (ro,relatime,umask=22,uid=0,gid=0,nls=utf8)

I then discovered that I had to disable journalling, so I reconnected the drive to my macbook and ran this from terminal:

Code: Select all

sudo diskutil disableJournal volumeName
When I reconnect to my Pi and rebooted - it worked - till the next day, when it went back to read only. :?

After further investigation, I found this:
http://jaysonlorenzen.wordpress.com/201 ... lus-drive/

And ran this:

Code: Select all

sudo fsck.hfsplus /dev/sda2
It did not produce any errors but after a reboot, the drive loaded again as read-write. Phew! :D

The samba installation for sharing the drive went smoothly and Macbooks and the PC on the network automatically discovered the shared USB drive.

hal8000
Posts: 252
Joined: Fri Oct 04, 2013 5:22 pm

Re: HFS+ Mount Problems Solved

Sat Nov 09, 2013 3:02 pm

You will probably find you cannot write to directories already created by OSX.
You will have to let everyone know if that works.

The journal allows quick recovery to the file system in event of crash, power cut, etc, so disabling the
journal may improve performance, but reduce reliability.

3tybagig
Posts: 1
Joined: Tue Jun 16, 2015 4:32 am

Re: HFS+ Mount Problems Solved

Tue Jun 16, 2015 4:44 am

I just wanted to add what I did.
I use Linux, Mac, Windows with a hot swap doc or 2 on my RPi2
So I wanted to be able to mount various file formats and access from samba so I
added these lines to /etc/fstab:

Code: Select all

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p5  /boot           vfat    defaults          0       2
/dev/mmcblk0p6  /               ext4    defaults,noatime  0       1
UUID="DA4C82E84C82BF2F" /media/ntfsdisk      ntfs    defaults,uid=1000,rw    0   2
UUID="3cbeb94f-cd94-3737-af96-51df7f96f879"	/media/hfsdisk  hfsplus defaults,uid=1000,rw    0   0
you need to:

Code: Select all

sudo fdisk -l
to get your disk locations
find your UUID with

Code: Select all

sudo blkid /dev/sdb2
(replacing sdb2 with the location of your drive)
find your user id with

Code: Select all

echo $UID?
then add the mount locations to /etc/samba/smb.conf

This will allow RW on NTFS
and RO on HFS
I stopped there because I don't need write rights on my HFS disk

praz
Posts: 1
Joined: Fri Jun 21, 2019 10:13 am

Re: HFS+ Mount Problems Solved

Fri Jun 21, 2019 10:27 am

Done what you've done and to make hfs drive readable:

Code: Select all

sudo apt-get install hfsprogs
And changed the options in the fstab entry for the drive to read:

Code: Select all

UUID="3cbeb94f-cd94-3737-af96-51df7f96f879"	/media/hfsdisk  hfsplus uid=1000,force,rw    0   0
One funny behaviour, might be just for me, had to do a sudo chown pi:pi /path/to/folder to be able to write as pi user...

This is better than switching off journaling but will only work if you're using Raspbian or another Debian based OS. Also got it working on Mageia but was a proper mission.

tts7en
Posts: 1
Joined: Sat Sep 28, 2019 4:10 am

Re: HFS+ Mount Problems Solved

Sat Sep 28, 2019 4:14 am

I am using the following config and the disk is mounted in rw mode as pi.

Code: Select all

UUID=7bxxxx93 /media/time_machine hfsplus force,auto,uid=1000,users,rw 0 0

Return to “Beginners”