Wednesday, August 8, 2012

NFS Server setup on LINUX and Mounting NFS on another server

http://tldp.org/HOWTO/NFS-HOWTO/server.html
http://www.cyberciti.biz/tips/ubuntu-linux-nfs-client-configuration-to-mount-nfs-share.html
http://nfs.sourceforge.net/

Troubleshoot at packet level using the following command
#tcpdump -ieth0 -vv -nn -X host 10.9.1.1
  1. Add entry to /etc/exports file (ON NFS SERVER01)


    # <NFSshare dir> <ip address to allow (optional parameters)>
    /archive 10.9.1.0/24(no_wdelay,rw,async)
    /archive/shareHL7 10.9.1.9(rw,sync) 10.9.1.11(rw,sync) 10.9.1.12(rw,sync) 10.9.1.0/24(ro,async) 10.9.1.8(rw,sync)


  2. Test if the share is active on the server

    Client01:# showmount -e server01

  3. On NFS Client01 (Open /etc/fstab file)

    # Server:/<dir>/ <mountpoint> <type> <optional parameters>
    NFSSERVER01:/archive/shareHL7 /archive nfs rw,hard,bg,tcp,nfsvers=3,rsize=32768,wsize=32768 0 0


  4. Allow hosts access TCP (/etc/hosts.allow)
    Add following line

    portmap: 10.9.1.8 , 10.9.1.9 , 10.9.1.11 , 10.9.1.12



  5. Re-read exports file
    You should run the command exportfs -ra to force nfsd to re-read the /etc/exports file


ISSUES: mount to NFS Server failed: RPC Error: Program/version mismatch (retrying).

Test your nfs version by typing
#man nfs
#yum --version nfs
#rpm -qa | grep -i nfs

List all the readily available versions
#rpcinfo -u localhost nfs

  • NFS Versions 2, 3, and 4 are supported on 2.6 and later kernels.
  • NFS over UDP and TCP on IPv4 are supported on the latest 2.4 and 2.6 kernels.


1 comment:

Nirav said...

Please do not forget to add the iptables rules...