NFS

Setup

Install
$ apt-get update
$ apt-get install nfs-common nfs-kernel-server
Configure exports
$ vi /etc/exports

Example: /data 172.16.16.209/255.255.255.0(rw,insecure,root_squash)

/mnt/backupvm is your directory
172.16.16.209/255.255.255.0 is your network
rw are the permissions
secure – This option requires that requests originate on an Internet port less than IPPORT_RESERVED (1024). This option is on by default. To turn it off, specify insecure

root_squash – Map requests from uid/gid 0 to the anonymous uid/gid. Note that this does not apply to any other uids or gids that might be equally sensitive, such as user bin or group staff.

no_root_squash – Turn off root squashing. This option is mainly useful for diskless clients.

Start services
$ systemctl enable nfs-common
$ systemctl start nfs-common
$ systemctl enable nfs-kernel-server
$ systemctl start nfs-kernel-server

Command Line

List the NFS shares exported by the server: showmount -a <nfsserver>


Components

Exports

man exportssubtree_check root_squash

Located at /etc/exports

exportfs -a – Update list of shared folders

insecure – Helpful when connecting from macOS (resolves Operation Not Permitted message)

Example: /data/documents 172.16.16.0/24(rw,insecure,root_squash)

nfs-common
nfs-kernel-server

fstab Entry

 


Mounting

From macOS client

Finder > Go > Connect to Server > nfs://<nfsservername>:/<sharename>

Terminal > sudo mount_nfs -o resvport <nfsservername>:/<sharename> <mountpoint>


Troubleshooting

Linux NFS-HOWTO Troubleshooting NFS

Error Messages Seen and Resolved (During SetUp of my NFS Server)

RPC: Program Not Registered