How to share an existing mount point with Samba app

New user here, and first time posting, so please be gentle :wink:

I’m trying to share a NAS folder with Samba but the Samba app is not behaving as I expect. I’m now confused about how the Samba app is supposed to work.

I’m running Freedombox 20.8 on a RPi 2 and have set up a mount point that connects to my NAS at /mnt/NAS/lots-of-media-folders. The mount point is defined in /etc/fstab and the disk is recognized by the Storage app as type cifs. (I previously installed cifs-utils.) All good so far.

When I create a new share (open, say), the following folder hierarchy is created: /mnt/NAS/FreedomBox/open/ and it seems that this open folder is where the shared files are supposed to be stored.

Given the above scenario, how can I share my lots-of-media-folders? I had hoped to share the parent folder NAS using Samba, but instead Samba has created a new folder hierarchy on the disk.

Is it possible to use Samba to share an existing /mnt/NAS/ folder, or will I need to think about the problem in a different way?


1 Like

Current way of sharing folder is driving by providing the simplest possible way for adding shares without worry about folder paths and also with the concern of how file permissions might stop proper sharing of folders.

However, we have discussed the need for sharing existing folders without having to reorganize to the new layout. We have various designs proposed and are likely to meet this need in a month or two given our current focus on NAS use cases for FreedomBox.

1 Like

Thank you for your quick and comprehensive reply, @sunil. That all makes perfect sense and I understand the reason why Samba works in the way it currently does.

In the meantime, I will continue to mount the NAS as I have described. I can still share media files from this location using the MiniDLNA app, and that will solve my immediate need. I will look to adopt any increased Samba functionality in the future.

I’m really impressed by the capabilities and ease of use of Freedombox and thank you for answering my question so fully. :+1:

I’m trying to add a second Samba share but am seeing some unexpected folder behavior that I do not understand.

I’ve mounted my media folder as an open share at /mnt/NAS/FreedomBox/shares/open_share and it’s working fine. I’d like to add a home share on the same disk, so created one with the Samba app.

I expected the home share to be created here

But instead it’s been created here
i.e. under the existing open share. That’s a whole new directory tree!

I’m assuming it’s possible to have shares of different types on the same disk. If that’s the case, then what am I doing wrong here?

One way to do this is to mount your NAS disk as /mnt/NAS and let FreedomBox create subfolders for open and home shares. Then you can move /mnt/NAS/lots-of-media-folders to /mnt/NAS/FreedomBox/shares/open_share/.

As Sunil said, currently it is not possible to share existing folders over Samba without reorganizing to the new layout.

I’m surprised that mounting media folder directly to /mnt/NAS/FreedomBox/shares/open_share worked for you. FreedomBox Samba app always creates subfolders in the mount . When you enabled open and home shares on this mount using Samba app, these folders are created:

Thanks @vexch. Good advice. I went ahead with the intention of creating the three share types and then would copy files into the shares later. Home works fine but Open and Group shares generate errors on creation. :frowning:

I’ve changed the mount point for the media folders to /mnt/NAS and used the Samba app to create Open, Group and Home shares. Open and Group creation generated errors (below). Home share creation was successful and the Home button has now turned green in the app interface.

Trying to create an Open or Group share generated this error:

Error enabling share: (‘samba’, ‘’, ‘setfacl: /mnt/NAS/FreedomBox/shares/open_share: Operation not supported\nTraceback (most recent call last):\n File “/usr/share/plinth/actions/samba”, line 339, in \n main()\n File “/usr/share/plinth/actions/samba”, line 335, in main\n subcommand_method(arguments)\n File “/usr/share/plinth/actions/samba”, line 275, in subcommand_add_share\n arguments.windows_filesystem)\n File “/usr/share/plinth/actions/samba”, line 110, in _create_share\n _set_share_permissions(share_path)\n File “/usr/share/plinth/actions/samba”, line 265, in _set_share_permissions\n subprocess.check_call([‘setfacl’, ‘-Rdm’, ‘g::rwX’, directory])\n File “/usr/lib/python3.7/”, line 347, in check_call\n raise CalledProcessError(retcode, cmd)\nsubprocess.CalledProcessError: Command ‘[‘setfacl’, ‘-Rdm’, ‘g::rwX’, ‘/mnt/NAS/FreedomBox/shares/open_share’]’ returned non-zero exit status 1.\n’)

However, share folders are created in the directory tree, even for the shares that didn’t “work”. I now have:

Permissions look to be identical across all the folders

drwxr-xr-x 2 fbx fbx 0 Jun 14 17:41 .
drwxr-xr-x 2 fbx fbx 0 Jun 14 17:41 ..
drwxr-xr-x 2 fbx fbx 0 Jun 14 17:41 group_share
drwxr-xr-x 2 fbx fbx 0 Jun 14 17:41 homes
drwxr-xr-x 2 fbx fbx 0 Jun 14 17:41 open_share

It seems that the Open share does work (this is the only one I’ve tested) because I can share its contents with other devices on the network. I don’t want to rely on it though because of the errors I encountered during setup, and the fact that the Samba app only shows the Homeshare asbeing set up correctly (Home button is green; Group and Home and grayed out)

It’s all very puzzling and I don’t know what to do next.

Trying to create an Open or Group share generated this error:

I created a bug report I couldn’t find any mount option that would help to fix this, so maybe this should be fixed in code.

To get Home shares fully working, you should add mount options file_mode=0777,dir_mode=0777 to the cifs mount, because cifs filesystems do not support setting owners/permissions.

Thanks @vexch. I’ve added file_mode=0777,dir_mode=0777 to the cifs mount options in /etc/fstab as you suggested.

After reboot, I checked that the Open share was still working (yes it was :+1: ), but the directory tree has changed back to the structure described in post #4 in this thread. i.e. FreedomBox tree nested within an existing FreedomBox tree. Very odd.

I’m going to leave things alone now and be happy that I have a functioning Open share. I’ll wait for any bug fix or improvement in Samba functionality before trying Group and Home shares again.

(By way of background, I’m looking to replace Open Media Vault with the Samba app in FreedomBox to manage files and user access on my home network. OMV is overkill for my needs and excessively complex. Samba/FB might be a simpler solution for me.)

Thanks for your help with this, and for raising the bug.

The permissions don’t look right for group directories.
The systems umask still seems to be 022 instead of 002, they don’t belong to the group, and the set-group-id bit is not set to make newly created files writable by other group members.


I agree that there’s something wrong. In fact, those directories disappeared all together after reboot so the mystery continues. I’ll avoid doing anything with Samba other than a simple Open share (which is working at the moment) until Home and Group share functionality is more stable.