Adding USB HDD to a Freedombox

Hi, apologies if this is a bit of a n00b question but I thought I’d ask the experts rather than messing around too much with permissions on my freedombox.

I have a Raspberry Pi3 Model B Freedombox set up on a local wired and WiFi network, and so far it’s been a frictionless and incredibly easy process to set up and use the applications in the Freedombox distro.

I’m now trying to add an external HDD to the box so that I can backup other machines in the house to the Freedombox using Syncthing.

When I connect the USB HDD it is mounted automatically by the OS, and shows on the storage screen mounted at /media/root/backup

Unfortunately, when I try to configure an incoming share to sync to this drive, my Freedombox user marcus doesn’t have permissions to access this mount:

2020-01-03 21:13:15: Loading ignores: open /media/root/backup/.stignore: permission denied
2020-01-03 21:13:15: Failed to create folder root directory stat /media/root/backup: permission denied
2020-01-03 21:13:15: Error on folder "*****-*****-*****" (*****-*****): stat /media/root/backup: permission denied

I searched the forum for anything that directly addressed this and couldn’t find anything that helped, but happy to be directed. I did find this RFC but it didn’t seem as though this is implemented yet.

I’m a fairly experienced *nix hacker so if it is simply a case of configuring the automount to work differently then fine, I can do that. But I thought I’d ask here first in case there is a ‘Freedombox way’ to do this which I’m missing, or in case this is a bug.

1 Like

To add a little more detail, I have been trying to ascertain how the USB HDD is being auto-mounted in the first place. Normally this would be happening because of an fstab entry or udev rules.

marcus@freedombox:~/$ cat /etc/fstab
UUID=cc7c85d1-6d4b-4270-985c-6858f4aa0d66 / btrfs defaults 0 1
UUID=700c205e-67f3-400d-8233-69d9d128f0dc /boot ext2 errors=remount-ro 0 2
UUID=1F21-DCC9 /boot/firmware vfat errors=remount-ro 0 2

There are no udev rules set in /etc/udev/rules.d/

I can’t see that any of the regular packages that Debian uses for automounting are installed - according to this information in the Debian manuals the package am-utils contains the utility amd - however this doesn’t appear to be installed on Freedombox.

If I can work out how the drive is being mounted to /media/root/backup/ in the first place, then I can work out how to make it mount so it is readable and writable to the user running the Freedombox process.

how the USB HDD is being auto-mounted in the first place

I’ve been looking for the same information for a slightly different reason :slight_smile:
(I’m trying to install freedombox alongside a normal desktop installation and whenever I plug an usb stick it is being mounted in the root directory which my user can’t/should not have to access )

I’m not sure exaclty how to fix your permissions issue, but I did poke around the auto-mount part, so maybe you can find some useful things in this :


What I managed to find is that the service behind ‘storage’ is called freedombox-udiskie which seem to be a wrapper for udisk2 so you might look at that too.

I believed udiskie does exaclty the same thing as :

sudo udisksctl mount -b /dev/sdb1

There is a bit about using polkit to give permissions to user in certain groups in the file /usr/share/doc/udiskie/README.Debian
That’s still quite vague for me, and I tried following these instructions without success, but you might find something helpful there.

other notes

I’ve tried disabling or stopping freedom-udiskie

sudo systemctl stop freedom-udiskie.service

It did prevent automounting, allowing my device to be handled by the file manager or manually on the desktop, but :

  • It can’t be monted from the web interface so it won’t be accessible from it without first logging to the desktop or via SSH

  • I’m sure but I guess accessing a device mounted by the desktop user from the plinth services might cause some permissions troubles.

Those last points may not be very useful in your case. Anyway I’m still looking but that’s all I got for now, I hope that helps