[Samba] Writing on an HFS+ drive on raspberry pi

Andrea Devoto andrea.devoto at me.com
Sun Mar 25 21:14:37 UTC 2018


I have been trying for the past few months to set up my raspberry pi to do incremental backups using time machine over Samba since AFP is being deprecated. Also since the latest release of samba (4.8.0) came out with support for time machine I decided to compile it myself and give it a go. The drive is formatted in HFS plus. 

The main problem that I am having is that even though I can mount the drive on the raspberry pi with writing permissions, I still cannot manage to write to the drive. At first I thought it was a problem of the interface between samba and time machine, but after trying out CCC as an alternative, I noticed that even CCC couldn't make backups because it couldn't create the sparsebundle image. Also, if I access the samba drive from finder I cannot create folders nor delete/rename them. So, I realised that the problem must lie within permissions. 

So far the steps that I have taken to get towards the right direction are:
1) I have installed hfsplus, hfsutils, hfsprogs to give HFS plus support to the Rpi.
2) Disabled journaling on the drive. I have read in a few forums that journaling prevents Linux systems from writing on hfsplus drives.
3) Edited the /etc/fstab to force mount the drive as -rw. From the command mount the drive appears to be mounted as rw.
4) The drive has been added to the smb.conf file, with the option read only = no. This should make the driver writable according to the documentation.
5) Since these steps were not enough, I decided to create a new user on my Rpi with the same name and id as my mac user. I added the user as a samba user and made the user own (recursively) the directory in which the drive is mounted. Also, everything in the directory has rw permissions for both user and group. 
6) I also made sure that the uid for the drive directory matched with the uid of my mac user (501).

After trying all of these options, I still cannot write on my backup drive and this prevents me from backing up my data (but I can write in the default home directory created by samba, so I think that the problem should not have to do with samba's configuration). I really do not know in which direction to go now as I feel like I have exhausted every option. Is there a kind soul around here who has a clue on what else I could try? 

Many thanks in advance!


More information about the samba mailing list