April 25, 2014 - rob

How To Set Up an NFS Mount

Setting Up the NFS Server


Step One—Download the Required Software


Start off by using apt-get to install the nfs programs.

yum install nfs-utils nfs-utils-lib

Subsequently, run several startup scripts for the NFS server:

chkconfig nfs on 
service rpcbind start
service nfs start

Step Two—Export the Shared Directory


The next step is to decide which directory we want to share with the client server. The chosen directory should then be added to the /etc/exports file, which specifies both the directory to be shared and the details of how it is shared.

Suppose we wanted to share the directory, /home.

We need to export the directory:

vi /etc/exports

Add the following lines to the bottom of the file, sharing the directory with the client:

/home           12.33.44.555(rw,sync,no_root_squash,no_subtree_check)

These settings accomplish several tasks:

    • rw: This option allows the client server to both read and write within the shared directory

 

    • sync: Sync confirms requests to the shared directory only once the changes have been committed.

 

    • no_subtree_check: This option prevents the subtree checking. When a shared directory is the subdirectory of a larger filesystem, nfs performs scans of every directory above it, in order to verify its permissions and details. Disabling the subtree check may increase the reliability of NFS, but reduce security.

 

  • no_root_squash: This phrase allows root to connect to the designated directory

Once you have entered in the settings for each directory, run the following command to export them:

exportfs -a

Linux

Leave a Reply