Friday, April 25, 2014

NFS - General information

Network File System

1 NFS stands for Network File System
2 It is used for sharing files over the network
3 It works on TCP/IP protocol no.2049
4 It is available in 3 version : NFS V2, V3 and V4


** Package requrired to be installed : nfs-utils
** Default Sharing Path is : /etc/exports

----------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------

Steps :     Server side

1 # yum install nfs-utils -y
2 # mkdir /sumit
3 # cd /sumit
4 # touch a b c d e
5 # vim /etc/exports
    Insert mode
    /sumit        192.168.0.0/24(rw,synch)    // to share for 192.168 IP range only
    /sumit        *(rw,synch)            // to share for all
    Esc and :wq
6 # service nfs restart
7 # chkconf nfs on
8 # exportfs
    OR
  # exportfs -v

----------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------

Steps :     Client side

On the Client, Mounting of the NFS share is required which can be done either ways :

A.)    Temporary Mounting

# mount 192.168.0.40:/sumit /mnt
# cd /mnt
# ls -l

B.)    Permanent Mounting

# vim /etc/fstab
  Insert mode
  192.168.0.40:/sumit    /nfs    nfs    defaults  0 0
  :wq
# mount -a

C.)     On Demand Mounting    [Auto Mount whenever user logins]

** Package name is required : autofs

# yum install autofs -y
# /vim /etc/auto.master
  Shift+G            // to goto last line
  Insert mode
  /    /etc/auto.nfs
  :wq
# vim /etc/auto.nfs
  Insert mode
  *    -rw    192.168.0.40:/&            // *= what to mount, &=for all
  :wq
# service autofs stop
# service autofs start

----------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------

        To view the Share available

# showmount -e 192.168.0.40        // IP address of NFS server

----------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------

        To check NFS Share on NFS Client

# cd /net/192.168.0.40/        [use tab to view]


----------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------

No comments:

Post a Comment