MacOS has a built in NFS client, but the defaults in the latest MacOS versions prohibit it from working as it should. As Apple encourages the use of the SMB protocol, they seem to have stopped paying attention to NFS, which is a shame considering in the real world, NFS performance blows SMB away, especially with lots of small files. Doubly so with Samba’s implementation.
I am writing this up, as I just got myself 100TB of nice space on a Ubiquiti UNAS Pro 8. In migrating various drives of data from single drives onto the NAS, the performance has been absolutely abysmal. I logged on to the NAS, and noticed that the filesystem is mostly idle, but the samba daemon is pegged at 100%. Ubiquity did a good job of tuning it as best they can, but in doing my research, it seems the general consensus is that Samba’s small file performance is particularly bad.
Also, the UNAS is running Debian 11, which (as of the time of this writing) is two major releases behind, and a somewhat out of date version of Samba. Hopefully they will update it to a more recent version at some point.
So I decided to try using NFS instead. This is where the issue on the Mac raised its ugly head. Despite the correct settings for the export on the NAS, the Mac still obtusely refused to mount the volumes with a generic unhelpful error message. There seemed to be very little help online in any of the forums. But, after a lot of trial and error, the fix turned out to be incredibly simple, and Apple could fix it with a single configuration line.
The key NFS option you need to use on the MacOS client to make the mount successful is resvport.
To make this the default for all mounts (as it should be by default from Apple), you can add a line to /etc/nfs.conf:
nfs.client.mount.options = resvport
I also recommend using the nfc option to normalize Unicode characters. From the man page:
nfc Convert name strings to Unicode Normalization Form C (NFC) when sending them to the NFS server.
This option may be used to improve interoperability with NFS clients and servers that typically
use names in the NFC form.