Showing posts with label NFS. Show all posts
Showing posts with label NFS. Show all posts

Saturday, 12 March 2016

Setup NFS Server On CentOS, RHEL



NFS, Network File System, is a server-client protocol used for sharing files between linux/unix to unix/linux systems. NFS enables you to mount a remote share locally. You can then directly access any of the files on that remote share.


On NFS Server :

# yum install nfs* -y

# service rpcbind start
# chkconfig rpcbind on
# service nfs start
# chkconfig nfs on

## Create one share directory "/backup/share"

mkdir /backup/share
chmod 755 /backup/share


## Export shared directory on NFS Server

# vim /etc/exports

/media/ivr    10.20.30.48/24(rw,sync,no_root_squash,no_all_squash)
/media/ivr    10.20.30.49/24(rw,sync,no_root_squash,no_all_squash)
:wq

# exportfs -a
# exportfs -v

## where,

/backup/share         – shared directory

10.20.30.48/24           – IP address range of clients

rw                               – Writable permission to shared folder

sync                            – Synchronize shared directory

no_root_squash          – Enable root privilege

no_all_squash             – Enable user’s authority

####################################


# service nfs restart
# service rpcbind restart
# chkconfig nfs on
# chkconfig rpcbind on



###########  On NFS Client : #######################

# yum install nfs* -y

# service rpcbind start
# chkconfig rpcbind on
# service nfs start
# chkconfig nfs on


mkdir /share

### Mount the share from server to client as shown below

mount -t nfs 10.20.30.61:/media/ivr/ /media/ivr/

Note:  10.20.30.46  -  is nfs server ip and /backup/share is share folder on nfs server


For Perment Mounting on Client Side:

[root@ivr ~]# cat /etc/fstab


10.20.30.61:/media/ivr/ /media/ivr/ nfs rw,sync,hard,intr 0 0

:wq



@ reboot server and check, be carefull check all entries in fstab


refer:

http://www.unixmen.com/nfs-server-installation-and-configuration-in-centos-6-3-rhel-6-3-and-scientific-linux-6-3/