Page 1 of 1

Writing on an HFS+ filesystem through Samba

Posted: Sun Mar 25, 2018 6:26 pm
by trewok
Hello everyone,

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 drvie 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!

Re: Writing on an HFS+ filesystem through Samba

Posted: Sun Mar 25, 2018 7:46 pm
by scruss
AFP is still how many versions of Time Machine write to network drives. Since you're using a non-Raspbian version of Samba (we're still on 4.5-ish), you might be better asking on the Samba board.

The idea of trying to write to an HFS+ filesystem on a Raspberry Pi gives me the heebie-jeebies. Further trying to get that to talk across Samba takes me well into howling fantods territory. The file name case conversion rules coupled with contrived support for file links (and Time Machine loves its links: it's how it does versioning) have many failure modes.