NFS? SMB? What to use in a mixed-OS environment

Juliean

Dabbler
Joined
Nov 28, 2016
Messages
25
I am setting up my first FreeNAS setup, and trying to figure out the right way to setup datasets. Some are obvious - for storing family pictures, videos, etc. coming from Windows machines I'll want an SMB share.

The complicated question is what to do with datasets that I want accessible from both Windows and Linux. For example, I will have Plex running in a Docker container on a Linux box (separate hardware from the FreeNAS server), with the music itself stored on the NAS. The obvious way to access the datastore would be via NFS, but I want to be able to manipulate the files (add, move, etc.) from Windows machines. I can see several options, but not really sure which one would be best:

I have Win 10 pro on most machines, so can set up the Datastore to use NFS, and access it in Windows using the Windows NFS Services, though this seems clunky.

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"?

Thanks.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Yes, I do this myself with my Plex media dataset. I share it out via SMB to the single machine I use to upload media, and also via NFS to a Docker volume attached to my Plex container. I run this as a Generic share type as the primary sharing mechanism is via NFS and I only mount via SMB occasionally.
 

Juliean

Dabbler
Joined
Nov 28, 2016
Messages
25
Yes, I do this myself with my Plex media dataset. I share it out via SMB to the single machine I use to upload media, and also via NFS to a Docker volume attached to my Plex container. I run this as a Generic share type as the primary sharing mechanism is via NFS and I only mount via SMB occasionally.

Can you tell me how you set up permissions for this? I've got it to the point where Linux connects to the datastore via NFS, and Windows via SMB, but there seem to be some permission conflicts - for example, if I create a file via linux, I can't delete it via windows.
 

Glorious1

Guru
Joined
Nov 23, 2014
Messages
1,211
If you sharing the same dataset by NFS and SMB, doesn't the NFS share have to be read-only? Otherwise it would foul up the SMB stuff, right?

From the docs: "It is generally a mistake to share a pool or dataset with more than one share type or access method."
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
@Juliean I agree that a multiprotocol NFS/SMB share is likely to cause you problems. I'm not sure why you regard mounting a SMB share in liunx as "clunky" but just using SMB shares should work for you. Once the remote share is mounted on your linux box I assume you'll "bind mount" this to your Plex docker container volume. If you use an image like linuxserver/plex you can fix the UID/GID its runs as and hence the perms needed on the Linux box. You can match this with the ACLs of SMB share running on FreeNAS.

Have Look at these ixsystem blog entries:



If you are still wondering about a mixed NFS/SMB share, see this recent post by @anodos, ixsystem's resident SAMBA expert:

 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Can you tell me how you set up permissions for this? I've got it to the point where Linux connects to the datastore via NFS, and Windows via SMB, but there seem to be some permission conflicts - for example, if I create a file via linux, I can't delete it via windows.

Since NFS is the primary sharing mechanism, for my Plex media folder, I configure the NFS share to mapall user to plex, and mapall group to plex. Then I ensure the media folder is configured via chmod 755 and chown -R plex:plex.

On the SMB side, I define the guest user as plex, and the share's auxiliary parameters to use:
Code:
force create mode = 0644
force directory mode = 0755


Finally, for the SMB ACL, I configure recursively:
  • Apply user: plex
  • Apply group: plex
  • @owner: Full Control
  • @group: Read Data, Read Named Attributes, Execute
  • @Everyone: Read Data, Read Named Attributes, Execute
 
Last edited:
Top