How to setup nfs on cent os 6.6 final

NFS(Network File System) share storage, it requires two server one is server and second is client server.



let’s be a root

sudo su

To setup NFS server use below cmd.

yum install nfs-utils nfs-utils-lib
add services on startup

chkconfig nfs on

service rpcbind start

service nfs start

Now export the shared Directory

The directory should be added in to the “/etc/exports” file, Which is alos included what is share and how it is shared

Suppose we wanted to share the directory /data

vi /etc/exports
add below line in to it


*rw:-allows the client server to both read and write.

*sync:-it confirms request to the shared directory once changes been commited.

*no_subtree_check:- it prevents the subtree checking.

*no_root_squash:-it allows root to connect to the directory
Now save the file


export all the setting by below cmd.

exportfs -a
Let’s configure client side configuration.

yum install nfs-utils nfs-utils-lib

Once nfs installed on server, create directory for share purpose.

mkdir /mnt/nfs/data

Mount it

mount /mnt/nfs/data

we can check it by “df -h” command.

Ensure that the mount starts up after the server reboots.

vi /etc/fstab /mnt/nfs/data nfs auto,noatime,nolock,bg,nfsvers=3,intr,tcp,actimeo=1800 0 0

Use below command for mount

mound -a.

Leave a Reply