First install the required stuff to run an nfs server
sudo apt update && sudo apt install nfs-kernel-server nfs-commonthen check things are working
systemctl is-enabled nfs-server
systemctl status nfs-serveredit /etc/default/nfs-common to look like:
# If you do not set values for the NEED_ options, they will be attempted
# autodetected; this should be sufficient for most people. Valid alternatives
# for the NEED_ options are "yes" and "no".
# Do you want to start the statd daemon? It is not needed for NFSv4.
NEED_STATD="no"
# Options for rpc.statd.
# Should rpc.statd listen on a specific port? This is especially useful
# when you have a port-based firewall. To use a fixed port, set this
# this variable to a statd argument like: "--port 4000 --outgoing-port 4001".
# For more information, see rpc.statd(8) or http://wiki.debian.org/SecuringNFS
STATDOPTS=
# Do you want to start the idmapd daemon? It is only needed for NFSv4.
NEED_IDMAPD="yes"
# Do you want to start the gssd daemon? It is required for Kerberos mounts.
NEED_GSSD=
and edit /etc/default/nfs-kernel-server to look like:
# Number of servers to start up
RPCNFSDCOUNT=8
# Runtime priority of server (see nice(1))
RPCNFSDPRIORITY=0
# Options for rpc.mountd.
# If you have a port-based firewall, you might want to set up
# a fixed port here using the --port option. For more information,
# see rpc.mountd(8) or http://wiki.debian.org/SecuringNFS
# To disable NFSv4 on the server, specify '--no-nfs-version 4' here
RPCNFSDOPTS="-N 2 -N 3"
RPCMOUNTDOPTS="--manage-gids -N 2 -N 3"
# Do you want to start the svcgssd daemon? It is only required for Kerberos
# exports. Valid alternatives are "yes" and "no"; the default is "no".
NEED_SVCGSSD=""
# Options for rpc.svcgssd.
RPCSVCGSSDOPTS=""
make the director,y you wish to serve, for me thats just
sudo mkdir /hddpool
sudo mkdir /hddpool/nfschange permissions so things work right
if you dont have permissions to do stuff do this on the SERVER DEVICE . i keep making this mistake.
chmod -R 777 /hddpoolnow, setup exports in /etc/exports
/hddpool/nfs/ *(rw,sync,no_subtree_check,no_root_squash)
obviously replace the /hddpool/nfs/ bit with the relevant thing for you
Now, on the client side, you want to edit your /etc/fstab
192.168.2.196:/hddpool/nfs/ /home/tommy/nfs nfs rw,user,auto 0 0change the ip in there ( 192.168.2.196 ) to the ip of the nfs server. change the /hddpool/nfs/ bit to the folder you are using. change the /home/tommy/nfs bit to where you want it mounted on the client side.