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

Michael A Weber mweberjunk01 at gmail.com
Sun Mar 25 22:58:16 UTC 2018

> On Mar 25, 2018, at 5:35 PM, Waishon via samba <samba at lists.samba.org> wrote:
> Hey there,
> to be clear:
> You've mounted a HFS+ drive on your raspberry pi with rw permissions using fstab.
> You're able to write files (e.g. as root) on your shares directory without samba, right?
> As soon as you try to connect Samba using your Mac you haven't any write permissions, right?
> Have you tried using a Windows machine to connect to your share? Or to disable the Unix extension?
> I'm not living in the apple world, but are you able to use the terminal on your Mac and cd to the directory where OSX has mounted the share? And then do a simple "ls -la" or if available a getfacl and mail us the output back?
> Von: Andrea Devoto via samba
> Gesendet: Montag, 26. März, 00:15
> Betreff: [Samba] Writing on an HFS+ drive on raspberry pi
> An: samba at lists.samba.org
> 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! -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/options/samba
> -- 
> To unsubscribe from this list go to the following URL and read the
> instructions:  https://lists.samba.org/mailman/options/samba


I struggled like mad with this a few years back as I couldn’t write to an HFS+ drive as well, and my backup drive is located on a regular Linux machine running CentOS.  So, I found some other posts which said it could easily be done with an EXT4 partition and some other tools like Avahi and netatalk, and that’s what I did.  I have been backing up two different Macs (one El Capitan, one Lion) over wifi to this backup disk in separate locations, and I have verified that I can restore data from the backups as well.

Now, I don’t believe I can do a full system restore since it’s a network drive, and I’m quite certain I cannot take the drive, disconnect it from my server machine and USB connect it to either Mac, and restore that way, either.  However, if necessary, I could probably create an HFS+ partition on a different disk, and then put the entire sparse bundle properly on the disk from the backup disk, and restore from there.  I don’t really care to do that though because that’s for people who wouldn’t be able to install an operating system on a Mac and then restore the user data from the backup, which it appears you would be able to do quite easily with your skills.

I believe I also read somewhere that with the new Apple file system, this whole thing breaks.  Go figure.  So, keep your systems HFS+ until you know what you can do, find the articles/threads which tell you how to setup a network backup to an EXT4 partition on another machine, and make it work.  It’s your best option at this point.

Good luck!


More information about the samba mailing list