CentOS 5
Sponsored Link

NFS Server2015/01/13

 
Configure NFS Server to share any directories on your Network.
[1] It's the Configuration on the system you want to build NFS server.
[root@dlp ~]#
yum -y install nfs-utils
[root@dlp ~]#
vi /etc/idmapd.conf
# line 5: uncomment and change to your domain name

Domain =
srv.world
[root@dlp ~]#
vi /etc/exports
# set like follows *note

/home 10.0.0.0/24(rw,sync,no_root_squash,no_all_squash)
# *note
/home
⇒ shared directory

10.0.0.0/24
⇒ range of networks NFS permits accesses

rw
⇒ writable

sync
⇒ synchronize

no_root_squash
⇒ enable root privilege

no_all_squash
⇒ enable users' authority
[root@dlp ~]#
/etc/rc.d/init.d/portmap start

Starting portmap:
[ OK ]

[root@dlp ~]#
/etc/rc.d/init.d/nfslock start

Starting NFS statd:
[ OK ]

[root@dlp ~]#
/etc/rc.d/init.d/nfs start

Starting NFS services:
[ OK ]

Starting NFS quotas:
[ OK ]

Starting NFS daemon:
[ OK ]

Starting NFS mountd:
[ OK ]

Starting RPC idmapd:
[ OK ]

[root@dlp ~]#
chkconfig portmap on

[root@dlp ~]#
chkconfig nfslock on

[root@dlp ~]#
chkconfig nfs on

[2] Configuration on NFS clients.
[root@www ~]#
yum -y install nfs-utils
[root@www ~]#
vi /etc/idmapd.conf
# line 5: uncomment and change to your domain name

Domain =
srv.world
[root@www ~]#
/etc/rc.d/init.d/portmap start

Starting portmap:
[ OK ]

[root@www ~]#
/etc/rc.d/init.d/nfslock start

Starting NFS statd:
[ OK ]

[root@www ~]#
/etc/rc.d/init.d/netfs start

Mounting other filesystems:
[ OK ]

[root@www ~]#
chkconfig portmap on

[root@www ~]#
chkconfig nfslock on

[root@www ~]#
chkconfig netfs on

[root@www ~]#
mount -t nfs dlp.srv.world:/home /home

[root@www ~]#
df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_00-lv_00
                       26G  1.1G   23G   5% /
/dev/sda1              99M   13M   82M  14% /boot
tmpfs                1006M     0 1006M   0% /dev/shm
dlp.srv.world:/home
                      280G  1.3G  264G   1% /home
# home directory from NFS server is mounted
[root@www ~]#
vi /etc/fstab

# add at the lat line: change home directory this server mounts to the one on NFS

/dev/vg_00/lv_00        /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/vg_00/lv_01        swap                    swap    defaults        0 0
dlp.srv.world:/home  /home                   nfs     defaults        1 1
Matched Content