Wednesday, 16 May 2012

NFS in Linux

                The Network File System (NFS) was developed to allow machines to mount a disk partition on a remote machine as if it were on a local hard drive. This allows for fast, seamless sharing of files across a network. It also gives the potential for unwanted people to access your hard drive over the network.

NFS Configration in RHEL 6/CentOS 6

yum install nfs*

rpm packeages

vim /etc/exports
/var/ftp/pub    *(ro,sync)    #for entire network
/data,sync)    #for particular machine
/jp,sync)    #for particular network

mkdir /data
mkdir /jp

service rpcbind status
rpcbind (pid 9905) is running...

service nfs restart
Shutting down NFS mountd:                                  [  OK  ]
Shutting down NFS daemon:                                 [  OK  ]
Shutting down NFS quotas:                                   [  OK  ]
Shutting down NFS services:                                 [  OK  ]
Starting NFS services:                                           [  OK  ]
Starting NFS quotas:                                             [  OK  ]
Starting NFS daemon:                                           [  OK  ]
Starting NFS mountd:                                            [  OK  ]

chkconfig rpcbind on
chkconfig nfs on

/var/ftp/pub    <world>

#see what the exported file system parameters look like
/usr/sbin/exportfs −v
exportfs -av

exporting *:/var/ftp/pub

showmount -e
/var/ftp/pub *

mount /mnt/

#verify nfs is running
rpcinfo −p localhost run on the server
rpcinfo −p servername run on the client

#to check allow and deny

exportfs −ra to force nfsd to re−read the /etc/exports file.

netstat −rn should show:
Destination    Gateway        Genmask        Flags    MSS Window   irtt Iface    U               0 0                0 eth0               

rpm -qa | grep -i nfs
rpm -qi nfs-utils
tracepath server(IP)
# strings /sbin/portmap | grep hosts

No comments:

Post a Comment