While setting the server closet at the office, the first thing setup was a TrueNAS Core server. If you are looking for a guide on installing TrueNAS core, a good one can be found here. With it already in place, it can be used to create an NFS share.
One of the major benefits of NFS is being able to easily migrate a container from one environment to another. By using the NFS, the container or VM is pulled over the network which allows any host to host ad hoc. Migrating VMs or containers takes seconds.
TrueNAS NFS support
Creating a Network File System (NFS) share on TrueNAS gives the benefit of making lots of data easily available for anyone with share access. Depending how the share is configured, users accessing the share can be restricted to read or write privileges.To create a new share, make sure a dataset is available with all the data for sharing.
Creating an NFS Share
Go to Sharing > Unix Shares (NFS) and click ADD.
Use the file browser to select the dataset to be shared. An optional Description can be entered to help identify the share. Clicking SUBMIT creates the share. At the time of creation, you can select ENABLE SERVICE for the service to start and to automatically start after any reboots. If you wish to create the share but not immediately enable it, select CANCEL.
NFS Share Settings
|Path||file browser||Type or browse to the full path to the pool or dataset to share. Click ADD to configure multiple paths.|
|Description||string||Enter any notes or reminders about the share.|
|All dirs||checkbox||Set to allow the client to mount any subdirectory within the Path. Leaving disabled only allows clients to mount the Path endpoint.|
|Quiet||checkbox||Enabling inhibits some syslog diagnostics to avoid error messages. See exports(5) for examples. Disabling allows all syslog diagnostics, which can lead to additional cosmetic error messages.|
|Enabled||checkbox||Enable this NFS share. Unset to disable this NFS share without deleting the configuration.|
To edit an existing NFS share, go to Sharing > Unix Shares (NFS) and click more_vert > Edit. The options available are identical to the share creation options.
Configure the NFS Service
To begin sharing the data, go to Services and click the NFS toggle. If you want NFS sharing to activate immediately after TrueNAS boots, set Start Automatically.
NFS service settings can be configured by clicking (Configure).
|Number of servers||integer||Specify how many servers to create. Increase if NFS client responses are slow. Keep this less than or equal to the number of CPUs reported by |
|Bind IP Addresses||drop down||Select IP addresses to listen to for NFS requests. Leave empty for NFS to listen to all available addresses.|
|Enable NFSv4||checkbox||Set to switch from NFSv3 to NFSv4.|
|NFSv3 ownership model for NFSv4||checkbox||Set when NFSv4 ACL support is needed without requiring the client and the server to sync users and groups.|
|Require Kerberos for NFSv4||checkbox||Set to force NFS shares to fail if the Kerberos ticket is unavailable.|
|Serve UDP NFS clients||checkbox||Set if NFS clients need to use the User Datagram Protocol (UDP).|
|Allow non-root mount||checkbox||Set only if required by the NFS client. Set to allow serving non-root mount requests.|
|Support >16 groups||checkbox||Set when a user is a member of more than 16 groups. This assumes group membership is configured correctly on the NFS server.|
|Log mountd(8) requests||checkbox||Set to log mountd syslog requests.|
|Log rpc.statd(8) and rpc.lockd(8)||checkbox||Set to log rpc.statd and rpc.lockd syslog requests.|
|mountd(8) bind port||integer||Enter a number to bind mountd only to that port.|
|rpc.statd(8) bind port||integer||Enter a number to bind rpc.statd only to that port.|
|rpc.lockd(8) bind port||integer||Enter a number to bind rpc.lockd only to that port.|
Unless a specific setting is needed, it is recommended to use the default settings for the NFS service. When TrueNAS is already connected to Active Directory, setting NFSv4 and Require Kerberos for NFSv4 also requires a Kerberos Keytab.
Proxmox NFS storage pool
The NFS backend is based on the directory backend, so it shares most properties. The directory layout and the file naming conventions are the same. The main advantage is that you can directly configure the NFS server properties, so the backend can mount the share automatically. There is no need to modify /etc/fstab. The backend can also test if the server is online, and provides a method to query the server for exported shares.
The backend supports all common storage properties, except the shared flag, which is always set. Additionally, the following properties are used to configure the NFS server:
server – Server IP or DNS name. To avoid DNS lookup delays, it is usually preferable to use an IP address instead of a DNS name – unless you have a very reliable DNS server, or list the server in the local /etc/hosts file.
export – NFS export path (as listed by pvesm nfsscan). You can also set NFS mount options:
path – The local mount point (defaults to /mnt/pve/<STORAGE_ID>/).
options – NFS mount options (see man nfs).