NFS Server & Client Setup on CentOS 6.4

Install NFS on the server

[code]sudo su
yum install nfs-utils nfs-utils-lib
chkconfig nfs on
service rpcbind start
service nfs start[/code]

Edit /etc/exports on the server

[code]/directory/to/share 10.0.0.2(rw,sync,no_root_squash,no_subtree_check)
/directory/to/share 10.0.0.3(rw,sync,no_root_squash,no_subtree_check)
/directory/to/share 10.0.0.4(rw,sync,no_root_squash,no_subtree_check)
/another/shared/dir 10.0.0.2(rw,sync,no_root_squash,no_subtree_check)
/another/shared/dir 10.0.0.3(rw,sync,no_root_squash,no_subtree_check)
/another/shared/dir 10.0.0.4(rw,sync,no_root_squash,no_subtree_check)[/code]

Export the shares from bash

[code]exportfs -a[/code]

Install NFS on the client(s)

[code]sudo su
yum install nfs-utils nfs-utils-lib
chkconfig nfs on
service rpcbind start
service nfs start
mkdir -p /directory/to/share
mount 10.0.0.1:/directory/to/share /directory/to/share
mount 10.0.0.1:/another/shared/dir/ /another/shared/dir[/code]

If there are no errors, check to see if your mount is active on the client with:

[code]df -h[/code]

Test the NFS Mount from the client

[code]touch /directory/to/share/somefile.txt[/code]

And now that file should be on both server and client. All Done!

Leave a Reply

%d bloggers like this: