Trying to share directory via Samba. Directory is a mounted BtrFS partition. Getting "network path not found" error

I formatted a drive as BtrFS (no partitions) so I mount it with the following command:

$ mount -t btrfs /dev/sda /mnt/share

I have this in my samba config file:

[bulk]
        comment = Bulk Data
        writeable = yes
        browseable = yes
        valid users = user
        path = /mnt/share

I can see this share in Windows explorer. I can also see my home directory share. I can access my home directory share in Windows and it works fine.

If I don’t mount the drive and just create a test folder in /mnt/share, I can access that just fine.

However, when I try to access bulk with the drive mounted, it says “network path cannot be found”. When I read my log file for samba, it has this in it:

[2017/10/19 12:46:15.910511, 0] …/source3/smbd/service.c:755(make_connection_snum)
canonicalize_connect_path failed for service bulk, path /mnt/share

My root file system is on a BtrFS drive as well, and I can access home directories just fine.

I tested to see if it was a permissions issue by making everything 777 temporarily. It still gives me the same error.

I have no idea why this is happening. Is there something special I have to do the BtrFS formatted drive to share it via samba? Something that Fedora automatically does to the root file system when you make it BtrFS perhaps?

Hmm, have you tried mounting a subvolume?

What kernel version is running on the “server”?

I’ve never encountered this problem before, you have restarted samba after mounting the filesystem (if the filesystem mounts at boot, that’s fine as well), correct?

1 Like

Have you tried setenforce 0 to see if SELinux is causing problems?

1 Like

Yes, the actual mount point is just called “WD” because it’s a Western Digital drive. Unfortunately I also named the root subvolume on the drive “WD” so the mount is /mnt/WD/WD where /mnt/WD is the mount point and /mnt/WD/WD is the root subvolume on the BtrFS drive.

I’ve tried sharing /mnt/WD and /mnt/WD/WD. I’ve tried sharing / and just navigating to the BtrFS drive, but /mnt is empty when I do this. When the BtrFS drive is not mounted, /mnt/WD is there.

4.13. Fully updated Fedora 26 Workstation OS.

Yes. Many times. Every time I modify the /etc/samba/smb.conf I then systemctl restart smb.service.

This server used to be an Arch Linux server without SELinux. That… could be it. I didn’t expect it to have some different enforcement between the /home and the /mnt for a BtrFS volume. Odd.

SELinux might want your Samba share to be in /srv but you can manually set the permissions. I always have to look this stuff up again whenever it comes up so I don’t remember off the top of my head. Looking at the SELinux log should show you if it’s denying Samba access to your share in /mnt. In any case, if it works after setenforce 0 then you’ll know it’s SELinux.

EDIT

Here’s the SELinux page on Samba

Looking at the config here, I’d guess that by default, SELinux will only allow shares inside of /home.

1 Like