So I’m making a big effort to replace my Windows PCs and VMs with Linux wherever possible. One huge snag I am constantly hitting is network shares. They’re just so easy in Windows. I have a SMB share on my TrueNAS Scale VM, and mapping it as a network drive in Windows is effortless.
On Linux, I’ve never been able to successfully mount the SMB share. The Arch wiki entry on Samba (Samba - ArchWiki) does not make this look easy. I need to sit down and get it figured out, but I’ve been putting it off. The only reliable way I currently have is using the Discover file browser in KDE - which does make it easily to access files, but it is somewhat limited, as I don’t believe the share is actually mounted when I access the share this way.
Should I even be messing with SMB - or should I be trying an NFS share instead? What is the best/easiest way to mount a TrueNAS share from Linux?
Samba shares work well when you want to manage permissions by logging in to the NAS. By default samba requires you to login and then you access files as the logged in user. When you write your mount files (in fstab or with systemd) you will specify this login credential.
NFS is “simpler” in the sense that it doesn’t have user authentication by default, user auth is done by the client by matching UIDs. This works fine in managed systems where all the users are synced between client and server (such as with realmd) , but can cause permission headaches if they are not synced.
If you use static IPs for your servers (recommended) nfs will let you map the nfs client from a specific IP to a specific user on the nas on a per share basis. This works well enough provided you don’t want multiple user accounts for the same client to access the same share (unsure what this use case would be for a server). This is the 'map all user" and “map all group” settings within the share.
1 Like
Thanks for the explanation - I don’t particularly need permissions as I’m the only user, however since I already have SMB set up, I will likely just stick with it. The only factor is speed - I’ve heard NFS is faster, maybe I’ll get around to testing that eventually when I feel like messing with my TrueNAS config.
As for SMB shares - I’ve settled on using SMB4k which gives me a GUI and allows me to easily mount shares upon login. I’d like to get to the point where I’m comfortable mounting them within fstab - that would be more useful for setting up a server VM that would need access to the share on boot - but I seem to mess it up every time I try, and SMB4k works relatively well as a crutch for now.