How to configure NFS in REDHAT Linux

If we want to share a folder in a server with another server we can do that using the NFS. Below is very simple configuration I have done , for the same in my Virtual machine.

Below is my configuration

NODE3 : (NFS Client)

192.9.1.103

NODE2 : (NFS Server)

192.9.1.101
Folder to share : /u01/SOFTWARE

Steps to configure

1) Install the required packages for the NFS on both the server(NODE2) and client(NODE3).

nfs-utils-1.0.9-42.el5.x86_64.rpm
nfs-utils-lib-1.0.8-7.6.el5.x86_64.rpm
nfs-utils-lib-devel-1.0.8-7.6.el5.x86_64.rpm
nfs4-acl-tools-0.3.3-1.el5.x86_64.rpm
portmap-4.0-65.2.2.1.x86_64.rpm

To install the package , use the below command.

rpm -ivh

2) ON NFS SERVER

    2a)    make an entry about the directory we want to share in the /etc/exports file like below.

    /u01/SOFTWARE 192.9.1.103(rw,sync,fsid=0)
   
    2b)    Start the services
   
    service nfs start
    service portmap start
   
    2c) Configure service will start automatically after reboot.
   
    chkconfig nfs on
    chkconfig portmap on

3) ON CLIENT

    3a)    execute the below command as root user.

    mkdir /SOFTWARE

    mount 192.9.1.101:/u01/SOFTWARE /SOFTWARE

    [root@node3 etc]# df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/sda5             9.5G  647M  8.4G   8% /
    /dev/sda9             2.9G   69M  2.7G   3% /opt
    /dev/sda8             4.8G  138M  4.4G   4% /home
    /dev/sda7             4.8G  2.7G  1.9G  60% /usr
    /dev/sda10            1.9G   36M  1.8G   2% /usr/local
    /dev/sda6             4.8G  194M  4.3G   5% /var
    /dev/sda3             9.5G  151M  8.9G   2% /tmp
    /dev/sda1             2.9G   75M  2.7G   3% /boot
    tmpfs                 501M     0  501M   0% /dev/shm
    192.9.1.101:/u01/SOFTWARE 59G   12G   44G  21% /SOFTWARE ===> Filesystem got mounted.

    3b)    Make below entry in /etc/fstab of nfs client (NODE2) to mount the filesystem automatically after reboot.

    192.9.1.103:/u01/SOFTWARE /SOFTWARE             nfs4     soft,intr,rsize=8192,wsize=8192,nosuid

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s