Understanding Working of NFS

Understanding Working of NFS

Servers:
File sharing Server’s:
1.      NFS: Network File System
      These servers are used in LAN
2.      FTP: File Transfer Protocol
      These servers are used in WAN & LAN
3.      Samba Server:
      These servers are used in Linux & Window heterogeneous networks.

Note: 1. NFS is used in LAN because bandwidth for NFS is more than compared with FTP and Samba.
          2. STP is used in WAN because FTP requires very less bandwidth when compared to NFS.

NFS (Network File System):-

Configuration Steps:

1)      Copy all the shared files to a single location
/nfsshare
aa bb cc
2)      Create new file inside the share directory
aa bb cc
3)      Packages:
i)                    nfs-utils: to un-install the nfs-utils
ii)                  portmap (please do not uninstall portmap
4)      services nfs
portmap
5)      Daemons:
nfsd
quotad
mountd
6)      Main Configuration File:        /etc/exports

Experiment:

Ø  Make a directory named nfsshare with files aa bb cc:

#mkdir /nfsshare
#cd /nfsshare
#touch aa bb cc
#ls
            aa bb cc

Ø  Check if the nfs-utils package is installed or not:

#rpm –q nfs-utils (Prints a message whether package is installed or not)
#rpm –q portmap

Ø  To reinstall the package first remove it with the following commands:

#services nfs stop
#rpm –e nfs-utils

#rm –rf /var/lib/nfs/xtab--------àremove

Ø  If package is not installed then there are two ways to install:

1.      Download from FTP and install
#ping the server
#rpm –ivh ftp://192.168.0.250:/pub.RedHat/RPMS/nfs* --force –aid
2.      Install from CD
#mount /dev/cdrom/mnt
#cd /mnt
#ls
#cd Fedora
#cd RPMS

#rpm –ivh nfs-utils* --force –aid
#rpm –ivh portmap* --force –aid

Ø  After installing the nfs-utils package create file as below:

#vi /etc/exports
            /var/ftp/pub 192.168.0.0./24(ro,sync)
            /nfsshare 192.168.0.0.24(rw,sync)
Note:in vi-editor write this content  (/nfsshare server ipaddress and no. of systems that are connected in network)

Ø  After installing services enter the command to restart

#services nfs restart

Note: execute this command twice because first it will show failed second time it will show ok.

Ø  Access to NFS share from client:

#mount –t nfs 10.10.12.114:/nfsshare/mnt

Note: In client machine enter Server Ipaddress

Note:
1)      #ping 192.168.0.3 –b
Broadcasts the address in the network only.
2)      #ssh 192.168.0.8
Connects the PC to another PC just like Terminal connection in Windows.
3)      In NFS all files & Directory are by default in read only mode.
Common KVM Switch: Using a KVM switch a monitor, keyboard,  and a mouse can be connected to two computers.