TrueNAS and NFS

I recently installed TrueNAS and attempted to setup NFS. Here are some notes that may be of use to others or my future self :smile:

My use case is to mount the NFS share on demand, backup my home directory, then immediately unmount.

Truenas

Under Services -> NFS:

  1. Enable NFSv4. Because, why not? NFSv4 is better.
  2. Enable ‘NFSv3 ownership model for NFSv4’. This permits UID/GID to be preserved without needing ID mapper running on client side.

Under Sharing -> Unix Shares:

  1. Create a dataset for the NFS share. Be sure to set a quota to something sensible.
  2. Create the NFS share with defaults

Other:

cd /mnt/Seagate4TB/nfsshare
mkdir home-backup
chown ian home-backup

NFS client

truenas.lan:/mnt/Seagate4TB/nfsshare /mnt	nfs4	noauto,defaults

where /mnt/Seagate4TB/nfsshare/ is the NFS root.

ian	ALL=(ALL)	NOPASSWD: /usr/bin/mount /mnt, /usr/bin/umount /mnt

Now user ‘ian’ should be able to write into /mnt/home-backup.