Install nfs-utils package #yum install nfs*
2.the /etc/exports file will be available
3.#vi /etc/exports
enter following to export the directory.
/etc/data/ server1(rw,sync,no_root_squash)
Note: you can use the IP address of server1 instead of hostname.
save file
4.restart nfs service and portmap service.
/etc/init.d/nfs restart
/etc/init.d/portmap restart
on Server1:
5.use following command on server1 to verify if the nfs mount point is working. #showmount -e server2
This will show the /etc/data directory.
create a directory on server1 and mount the server2 directory as below.
Ex. on server1 create a directory /mnt/server2
#mkdir /mnt/server2
mount the server2 directory on server1
server1#mount -t nfs server2:/etc/data /mnt/server2
now you can list the files in directory /mnt/server2 which are actually exist on server2.
you can permanently mount the mount point using below.