Creating an NFS Share Between Two Linux Instances

If you ever have the need for a share between Linux instances there are only a few quick steps that have to be followed to make it happen. The example configuration shown below is for RedHat/Centos 6.

Hosts used in this example:

Login to as ROOT. The server will serve as the main source for the share


Create a folder for the share

 mkdir /share  

Edit the /etc/exports file on and add an entry allowing access to the share for the secondary host

 vi /etc/exports  

Verify the NFS Service. If the NFS Service is enabled and running, you will need to restart the service for the changes to the /etc/exports file to take effect

 service nfs status  
 service nfs restart  

The NFS service is not enabled by default in RedHat/Centos. In order for the new share to become permanent on the service needs to be enabled

 chkconfig nfs on  

— Steps for the primary host are completed —

To continue, login to as ROOT


Create a folder for the share

 mkdir /share  

There are two methods for mounting the share from

Temporary Method — will not be available after a reboot

 mount -t nfs -o rw /share  

Permanent Method — will be available after a reboot

 vi /etc/fstab  /share    nfs   rw,suid     0 0  

— This completes all the necessary steps for setting up an NFS Share on Linux —

PLEASE NOTE: If the primary host is inaccessible when rebooting the secondary host configured with the Permanent Method, the secondary host may hang endlessly