~/snippets/linux-connect-to-nfs-mount
Published on

Connect to a NFS Mount

170 words1 min read

Mount

  • Install the necessary dependencies
sudo apt install nfs-kernel-server
  • Start the NFS Kernel
sudo /etc/init.d/nfs-kernel-server start
  • Find the NFS mount by destination IP
sudo showmount -e {Destination IP}
  • Make the target directory
sudo mkdir /target
  • Mount the NFS share to the target directory
sudo mount -t nfs {Destination IP}:{NFS Share from the 'Find the NFS Mount' step} /target/
  • Check it has mounted properly
df -h

Unmount

sudo umount -f -l /target

Preserver after reboot

  • Open fstab
sudo vi /etc/fstab
  • Add the necessary config
{Destination IP}:{NFS Share from the 'Find the NFS Mount' step} /target/ nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0