Rocky samba Unable to add Portable storage device as a shared disk. But Debian can

rocky samba Unable to add Portable storage device as a shared disk. But Debian can
This is a tragedy
:rage: :rage: :rage: :rage: :rage: :rage: :rage: :rage: :rage: :rage: :rage: :rage:

Hey
It’s most likely SELinux:

SELinux requires files to have an extended attribute to define the file type. Policy governs the access daemons have to these files. If you want to share files other than home directories, those files must be labeled samba_share_t. So if you created a special directory /var/eng, you would need to label the directory with the chcon tool.

https://selinuxproject.org/page/SambaRecipes

(SELinux is configured by default not allowing anything for Samba, to prevent rogue processes just opening shares, and Debian doesn’t use SELinux by default)

Meaning in short:

# semanage fcontext -a -t samba_share_t "/<path-to-share>(/.*)?"
# restorecon -R -v /<path-to-share>/

Oh, my goodness. I see. I changed my NAS server from ROCKY to Debian in the morning

I will try changing back when I have the opportunity in the future.

1 Like