What is NFS – Network File Sharing

– It stands for Network File System, it is a utility provided in the Linux environment using which you can share files and folders to any specific client or a network.

– NFS works in a Client-Server model, where server shares the file system/folder which the client access as and when required.

Configuring NFS

Server side

– Create a folder
           # mkdir /share
– Edit the config file
           # vi /etc/exports
           /share station1.test.com(rw,sync)
           /share *(rw,sync)
           /share *.test.com(rw,sync)

– Change the folder permission
           # chmod 777 /share

– Check the services
           # chkconfig portmap on
           # service portmap restart
           # chkconfig nfs on
           # service nfs restart

Client Side

– To see what all folder/directories are shared by the server, to check it from the client side
           # showmount -e                  
– To mount the NFS share
           # mount  /mnt
– Go to the folder on which the NFS share is mounted
           # cd /mnt

– Try to create a file inside the NFS share, to check if it is working or not (is it allowing us to write or not)
           # touch file.txt