Setup NFS server and client on Ubuntu 14.04

On Server

sudo apt-get update
sudo apt-get install nfs-kernel-server
sudo mkdir /var/nfs
sudo chown nobody:nogroup /var/nfs

Configure NFS Exports on the server

sudo nano /etc/exports
/var/nfs 192.168.1.0/24(rw,sync,no_root_squash,no_subtree_check)

Create the NFS table and start its service

sudo exportfs -a
sudo service nfs-kernel-server start

 

On client

sudo apt-get update 
sudo apt-get install nfs-common
sudo mkdir -p /mnt/nfs
sudo mount 192.168.1.219:/var/nfs /mnt/nfs

Verify the storage and space

df -h
mount -t nfs

To surive reboot

sudo nano /etc/fstab
192.168.1.219:/var/nfs /mnt/nfs nfs auto,noatime,nolock,bg,nfsvers=4,sec=krb5p,intr,tcp,actimeo=1800 0 0

To umount

sudo umount /mnt/nfs

 

Leave a Comment

Your email address will not be published. Required fields are marked *