Helpful articles:
https://wiki.archlinux.org/index.php/NFS
https://wiki.archlinux.org/index.php/ZFS#Bind_mount
example: yum install nfs-utils
From a Arch box:
NFS root: /srv/nfs
Make mounts with mkdir /mnt/nfs/sharename
.
Bind mount to the source, which in my case is on ZFS:
/etc/fstab
/tank/files /srv/nfs/sharename none bind,defaults,nofail,x-systemd.requires=zfs-mount.service 0 0
Mount everything in /etc/fstab
with mount -a
.
Export the share names:
/etc/exports
/srv/nfs 10.1.1.0/24(rw,fsid=root,crossmnt)
/srv/nfs/sharename 10.1.1.0/24(rw,fsid=root)
Start or restart the service:
systemctl start nfs-server
Or export again without restarting:
exportfs -rav
Some things to watch for:
The 'other' group must have write permissions if a remote user is going to be able to write to the NFS-exported file. Example: drwxr-xrwx
or chmod -R o+w files/
.
See what shares are available:
showmount -e servername
Make a mount point: mkdir /mnt/remote-files
Mount the share:
/etc/fstab
servername:/srv/nfs/sharename /mnt/remote-files nfs defaults,soft,rsize=32768.wsize=32768,timeo=900,retrans=5,_netdev 0 0
Mount all: mount -a