SOLVED Best configuration to share files with Linux clients

Vortigern

Dabbler
Joined
Oct 14, 2022
Messages
45
Dear All,
I'll be soon using a microserver running Truenas CORE. I would like to investigate what could be the best solution to share files between the NAS and 2 clients which are PCs running Linux Mint (currently version 21). The NAS will mostly act as a backup of all the un/important data while the PCs will only have SSDs to install the OS and applications. This actually means:
  • I need fast read access to the data on the NAS (the amount of writings it is quite limited compared to readings)
  • I would like to have the option to access the files simultaneously
  • preferably just mount it as a filesystem on both PCs: ease of file navigation/handling
I thought about enabling NFS and mount it as filesystem during boot: would you consider this a good solution or would you recommend something different? I would like to have a single sharing path so that both clients access the same files.

Thanks in advance,
Vortigern
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
NFS and SMB are about equal in this regard. NFS is more natively Unix-y, but SMB support in recent Linux distros is quite mature. I'd probably favor SMB shares, but it's pretty much a toss-up.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
Which flavour of Mint? I'd expect the file manger used by Mint will allow smb conections out of the box, while mounting NFS shares would typically need installing nfs packages and further config. Using SMB shares is potentially more secure than NFS without kerberos, and the later is a not a triivial exercise to set up. It might seem counter intuitive, but SMB is my choice. Otherwise use NFSv4, but expect to do some work on your Linux clients re: how you will mount the NFS shares, e.g: automounts via autofs, or systemd-mounts, or using avahi.

The downside of using SMB on linux clients is how the permissions are presented and taking care with things like rysnc type backups from Linux to TrueNAS.
 

Vortigern

Dabbler
Joined
Oct 14, 2022
Messages
45
Dear @danb35 and @KrisBee,
thanks for your quick reply. I was having a look at NFS vs SMB and I've seen some advantages from NFS, among them:
  • NFS is case sensitive: this might be very important since all my machines runs on Linux and quite often I end up having same file names which only differs by the case
  • SMB cannot rename file
  • File permission
By the way I'm using Linux Mint 21 Cinnamon, the file Manager is Nemo and should be able to hanlde both SMB and NFS. Actually, once the NFS is mounted every file manager should be able to access it.

Thanks,
Vortigern
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
@Vortigern If all access to TrueNAS is via Linux clients, using NFS becomes more compelling and you avoid going down the perms/ACL rabbit hole of NTFSv4 type versus POSIX.!e type ACL etc. Depending on write activity, one disadvantage of NFS vs SMB is performance. NFS server performs sync writes, and default config for SAMBA server is to perform async writes.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
but SMB support in recent Linux distros is quite mature.

If by "mature" you mean that you like converting bicycles into motorcycles by strapping an add-on gasoline engine conversion kit onto it. Okay, sure, technically it's a motorcycle, but it still works like $#!+. NFS tends to get the details right, which is a major checkmark under the general pleasantness column.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
But that's an artificial problem. You can turn off sync writes.
I know by setting vfs.nfsd.async=1, but that breaks the RFC protocol, or do you simply mean set dataset sync=disabled?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
I know by setting vfs.nfsd.async=1, but that breaks the RFC protocol, or do you simply mean set dataset sync=disabled?

Well there's obviously a variety of solutions here, including protocol level disabling, filesystem level disabling, or even installing a fast SLOG device to deal with it. Fondly brings back the days of Sun PrestoServe.
 

Vortigern

Dabbler
Joined
Oct 14, 2022
Messages
45
Dear All,
thanks a lot for your replies! I will try to comment the main points one by one:
  1. Sync/Async writes: as far I know the NFS mount options allow for asynchronous writes. If that's the case I could actually tune this parameter just by the mount option. This solve the async write topic at protocol level while leaving the filesystem sync enabled, right?
  2. SMB unable to rename files it's just something I read here NFS vs SMB
From what I understood from the last comments NFS should be the best option when using Linux clients with the only drawback to be performance in case of sync writes (which can be circumvented). If that's the case I think NFS should be the way to go.

Regards,
Alessio
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
SMB unable to rename files it's just something I read here NFS vs SMB
I don't know why they think that, but it's absolutely false. I don't doubt that you could set permissions in such a way that users wouldn't be able to rename files, but that certainly isn't the norm.
 

Vortigern

Dabbler
Joined
Oct 14, 2022
Messages
45
Dear @danb35,
thanks for your reply.
I don't know why they think that, but it's absolutely false. I don't doubt that you could set permissions in such a way that users wouldn't be able to rename files, but that certainly isn't the norm.
I'm actually not familiar at all with SMB so I cannot tell, but I trust you: it would actually be quite inconvenient being unable to rename files.

Regards,
Vortigern
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Dear @danb35,
thanks for your reply.

I'm actually not familiar at all with SMB so I cannot tell, but I trust you: it would actually be quite inconvenient being unable to rename files.

Regards,
Vortigern

That's why it's such a weird claim for a random web page to make.
 
Top