nfs mount option nolock worked for me.

edit: you can add the 'nolock' to mount options in fstab, or 'mount -o nolock,remount /mount_path' to mount it on demand. I had an issue with samba creating a mount on an nfs volume and it created infinite open connections until I added this mount option.

Answer from Jay303 on serverfault.com
🌐
Red Hat
access.redhat.com › solutions › 1983
Can a NFS mount be shared out via Samba under Red Hat Enterprise Linux? - Red Hat Customer Portal
Using CIFS/SMB/Samba to share a directory that is also an NFS mount point results in file corruption, stale file locks, and various file access issues including high cpu usage. Stale locks can be found via smbstatus and lsof after files within ...
🌐
Reddit
reddit.com › r/freenas › share the same directory with nfs and smb
r/freenas on Reddit: Share the same directory with NFS and SMB
November 17, 2020 -

Hello freenas enthusiasts.

I would like to share the same folder on my network via smb and NFS. I know this is not usually recommended because a user could be updating the file via one of these protocols while another is also accessing it, and because it's not recommended I haven't found a whole lot on it. That being said, this is only in my home network, I will be the only one using it, and this network location will be for miscellaneous files mostly (mainly ISO's for booting vms from). I would like to have my nfs clients (mostly ESXi hosts) see all the files I upload from my windows clients.

I've currently created a pool with a NFS share (let's call it /mnt/POOL) and a windowset under this with an ACL set up (/mnt/POOL/windowset). I can connect via SMB and upload files which go to that windowset folder, but I can't see these files on my nfs clients. Alternatively, I can connect to the base nfs share and upload files to that on my nfs clients, but I cannot see these at all on my windows clients. I've tried changing the smb share to just use /mnt/POOL, but then I get an error about editing a base pool ACL and while I can see all the files in the base pool on my windows clients, I cannot edit them at all or upload any new files.

I know this isn't generally recommended, but I would really appreciate some assistance with this. In addition, if there is a better approach to this, please let me know. I know permissions can cause this to be difficult, but I did something similar back when I was running unraid, so I'm hoping it's not impossible. Thanks for reading!

🌐
LinuxQuestions.org
linuxquestions.org › questions › linux-general-1 › can-i-share-the-same-dir-with-both-nfs-and-samba-4175588090
Can I share the same dir with both NFS and Samba?
I am currently just using NFS shares, but have found the use for accessing some of my shares from windows aswell. So question is, can I share the same
🌐
Reddit
reddit.com › r › freenas › comments › 6kt76b › nfs_and_samba_same_share
NFS and Samba Same Share : r/freenas
December 3, 2016 - I have read around a lot and have heard its really bad to have an NFS and Samba share of the same datastore. What is the reasoning behind this?
🌐
Writeclick
writeclick.co.il › nfs-vs-smb-a-crash-course-on-network-file-sharing
NFS Vs. SMB A Crash Course On Network File Sharing | WriteClick – Tech Content Agency
The major drawback of SMB in hybrid ... encounter bugs when trying to share files between Linux and Windows computers, and recently released features within SMB may not yet be supported by Samba....
🌐
NethServer Community
community.nethserver.org › t › samba-shares-with-external-nfs-storage › 18458
Samba shares with external NFS storage - sharedfolders - NethServer Community
June 17, 2021 - Configuration: Proxmox server with a small KVM VM based on nethserver. I have installed NFS in the Proxmox and shared some folders. I can mount the folders under /var/lib/nethserver/ via NFS No problem with mail or backup, but when I try to use the NFS mounts for samba shares I have various permission problems.
Find elsewhere
🌐
TrueNAS Community
truenas.com › forums › archives › freenas (legacy software releases) › freenas help & support › new to freenas?
NFS? SMB? What to use in a mixed-OS environment | TrueNAS Community
August 24, 2020 - I can set the Datastore to use SMB, and access it from the Linux box via Samba, though again, this seems clunky. Is there any way to set up a single datastore to be accessible through both SMB and NFS at the same time? This might be best, if possible. If it is, when creating the dataset, do I set the "Share Type" option to "Generic" or to "SMB"?
🌐
Ask Ubuntu
askubuntu.com › questions › 173816 › samba-and-nfs-conflicts
server - Samba and NFS conflicts? - Ask Ubuntu
Based on experience I can clearly say: NO, there is no interference. I did a parallell share of the same files for the same users in SMB and in NFS (simultaneously, same machines, same files, same users).
🌐
Reddit
reddit.com › r/selfhosted › what's the correct way to share directory between samba, nfs, and a docker service called file_browser?
r/selfhosted on Reddit: What's the correct way to share directory between samba, nfs, and a docker service called file_browser?
April 16, 2022 -

I've previously used samba in the past, it's appealing, it easily connects on windows, kinda easily on macOS, with some tuning, works well on Linux. Mounting an nfs share on Linux is much easier, which is what I'd like to start using for my linux desktop. I've also started recently using a lot of self-hosted applications, and would find utility in file_browser. NFS and Samba don't seem to be working too well with each other, and I expect the same thing to happen when I setup file browser through docker.

Overall I'm asking for help finding an approach, or help with pursuing a solution. I could use the same directory, but currently that seems like a headache not worth fixing(only b/c I feel like there's a simpler way). In using the same directory for samba and nfs, the mount done through samba functions, the mount from nfs is read only. Or, if there's a way to make different directory then that would work, but idk how to do that, and googling hasn't helped that idea.

Top answer
1 of 3
8
Start by asking these questions Do I need to allow Windows clients to connect to the file server? If that answer is yes, you want samba. Are there other ways? Yep. But there is a reason the industry is on CIFS/Samba with Windows. Do I need to allow Linux servers or containers based on Linux to get to files across the network stored on other Linux hosts? If that answer is yes, you want NFS. Are there other ways? Yep. But there is a reason the industry is on NFS with Linux. Can I use Samaba and NFS on the same directories from the same server? Yep. But there are pitfalls. What pitfalls? As u/alphafalcon points out in there comment. Permissions are key. So how do I avoid the pitfalls and make it to the promised land of Samba and NFS working together on the same files and folders? By taking it one step at a time. First, get a NFS mount working and a samba share working on different test directories, and make sure they do what you expect. Get your containers to mount the NFS, and your Windows clients to mount the directory with a share drive. Get samba working without using guest access. Force it to need a username and password. Second, get a NFS mount and samba share working on the same test directory, and make sure they do what you expect by setting the permissions to 777 Third, don't leave it on 777, just because it works doesn't mean this is good. And this is where the pain will come in for sure, but once you have all of that other stuff done and out of the way this allows you to only have to deal with troubleshooting permissions instead of both stacks. Fourth, take the knowledge you have gained and apply it to your current data which wasn't your test data because you were of course using a test folder to do all of this? Finally, test, test, test, test. And once you have done testing, do more. This will take time, but it will be worth it in the long run if you really want this to work. EDIT(s): Formatting... I hate the Fancy Pants editor
2 of 3
4
It all boils down to mapping users and permissions. I have my NAS exporting NFS shares and sharing the same directories via SMB. It works. My windows PCs have the same user and password as the samba user on the NAS, which maps to a Linux user of the same name. I use NFS mainly to remotely mount volumes on my docker and kubernetes hosts. I've set up a "docker" user on my NAS and run my containers as that user-ID so they map to a valid user. Connecting Filebrowser should not be a big hassle, just mount the directory into the container and run as a matching user.
🌐
NetApp
netapp.com › home › blog › nfs-and-smb-cifs-enterprise-file-sharing-on-cloud-volumes-ontap
How to Set Up Multiprotocol NFS and SMB File Share Access | NetApp
April 25, 2025 - NFS mount options use export policies ... must be shared between Windows and Linux systems, interoperability between these mechanisms is essential and also quite complex to achieve....
🌐
NAKIVO
nakivo.com › linux › smb vs nfs protocols: an in-depth comparison
NFS vs SMB: Differences Explained
January 18, 2023 - You can access an SMB file share by using the UNC path ... The NFS protocol is optimized for Linux. SMB is optimized for Windows and is a native file-sharing protocol in Windows with excellent integration. However, both protocols can be used on Windows and Linux. You need to install an SMB client (cifs-utils) or SMB server (Samba) on Linux to use the SMB protocol.
🌐
Ubuntu Forums
ubuntuforums.org › archive › index.php › t-2440559.html
[SOLVED] Home network shares: NFS or Samba? [Archive] - Ubuntu Forums
Today the Linux kernel ( since 4.13.5 or so ) would negotiate the best smb dialect to use so if the Synology today was set to allow SMB3 cifs would have connected with SMB3. SMB1 was slow. SMB2 was faster, SMB2.1 slightly faster, and SMB3 the fastest. It may very well be that NFS is still faster but the test should be redone with settings that makes sense today. ... These days, samba and NFS are a toss up for performance on solid networks. I see very similar results with both. If I had a bad network with any packet errors, I'd be certain to use only TCP connections with NFS as read-only connection to prevent data corruption.
🌐
Ferhatakgun
ferhatakgun.com › home › network share: performance differences between nfs & smb
Network share: Performance differences between NFS & SMB
March 19, 2016 - Synology! Benchmark! NFS and SMB! That’s just the information I’ve been looking for! Thank you! ... Synology is using Linux operation system. ... On ubuntu 14.04 I had the opposite experience, samba performed roughly 10% faster than nfs when reading a single (large) file.
🌐
Fedora Discussion
discussion.fedoraproject.org › ask fedora
File Sharing Woes, Samba, NFS, SFTP - Fedora Discussion
September 29, 2023 - Not gotten a response to this on Reddit or Kbin, so apologies as I cast a larger net… Standard disclosure, I’ve searched far and wide on google and duckduckgo, there’s been no coverage for this issue that my google-fu has shown me So right off the bat, I understand that NFS is dependent on UID matching.
🌐
Synology Community
community.synology.com › enu › forum › 1 › post › 143737
Smb and Nfs on same share
Hi! Come and join us at Synology Community. A place to answer all your Synology questions. Ask a question or start a discussion now.