DietPi-Sync to Samba symlink failed: operation not supported (95)

Greetings,

I’m trying to run DietPi-Sync from my USB mount to a Samba mount (hosted on another RPi 3 running openmediavault), but the symlinks all fail with “Operation not supported (95)”

Here’s the setup:
Source location: /mnt/USB_80GB (all my user data is stored here)
Target location: /mnt/OMV_DietPi_UserData/dietpi-sync (samba share)


Here are some of the error messages:

rsync: symlink "/mnt/OMV_DietPi_UserData/dietpi-sync/dietpi-backup/data/lib/arm-linux-gnueabihf/libutil.so.1" -> "libutil-2.24.so" failed: Operation not supported (95)
rsync: symlink "/mnt/OMV_DietPi_UserData/dietpi-sync/dietpi-backup/data/lib/arm-linux-gnueabihf/libuuid.so.1" -> "libuuid.so.1.3.0" failed: Operation not supported (95)
rsync: symlink "/mnt/OMV_DietPi_UserData/dietpi-sync/dietpi-backup/data/lib/arm-linux-gnueabihf/libwrap.so.0" -> "libwrap.so.0.7.6" failed: Operation not supported (95)

Does anyone have any thoughts? I’d like to be able to sync my USB drive to a Samba share on my NAS for redundancy.

Thanks!

Seems like symlinks are not allowed on samba mounts. Checked and found verification on web search. It’s due to security concerns. E.g. users can get access to sensible system files by creating a symlink on the client that points to the desired sensible system file. And on samba, unix permissions are not ported that would prevent this.

But symlinks can be enabled by this settings in smb.conf:

follow symlinks = yes
wide links = yes
unix extensions = no

Perhaps “wide links” is not required if it’s just about symlinks within the samba share dir. Did not test further for now.
The “unix extendions” seems to be required “no” to allow symlinks at all. Perhaps default smb.conf / man give some hints.

Seems like symlinks are not allowed on samba mounts.

Ah, yes, I see that. Thank you for running that down. I tried the following…

follow symlinks = yes
wide links = yes
unix extensions = no

…in various combination, both for the server and the specific share, but without success.

So I abandoned Samba for NFS.

For anyone who stumbles upon this, you’ll need to enable no_root_squash in the extra options for the share in OpenMediaVault (or whatever you’re using) to not run into a chown issue.

Also, inside DietPi I had to edit /etc/fstab from the version Drive Manager created:

192.168.1.xxx:/ /mnt/nfs_dietpi nfs auto,_netdev,nofail 0 0

to:

192.168.1.xxx:/export/dietpi /mnt/nfs_dietpi nfs auto,_netdev,nofail 0 0

in order to get it to properly map my share.

About fstab entry:

  • Hmm if I remember right, NFS4 requires the entry to be just 192.168.1.xxx:/, while NFS3 and lower requires it to be 192.168.1.xxx:/path/to/share.
  • We added an auto detection for this some versions ago. Did you run dietpi-drive_manager from latest DietPi version?

You’re correct… it did pick up the NFS4 share just by using xxx:/, however, it added two shares:

  1. 192.168.1.xxx:/ /mnt/[I don’t recall] (that mapped to my SD card)
  2. 192.168.1.xxx:/export/dietpi /mnt/nfs_dietpi (correctly mapped to the network drive)

In order to get just the one share to mount (correctly to the network drive), I had to manually edit the fstab