SOURCECODEBD.NET

Live Experience

NFS Server in CentOS
 
Build NFS Server to share any directories in LAN.

   
[1] Configuration on the system you want to build NFS server  
 
[root@ns ~]# vi /etc/exports

# add *note
/home 192.168.0.0/24(rw,sync,no_root_squash)

# *note
/home   => shared directory
192.168.0.0/24  => range of networks NFS permits accesses
rw    => possible to read and write
sync    => synchronize
no_root_squash  => enable root privilege

[root@ns ~]# /etc/rc.d/init.d/portmap start
[root@ns ~]# /etc/rc.d/init.d/nfs start
[root@ns ~]# /etc/rc.d/init.d/nfslock start
[root@ns ~]# chkconfig nfs on
[root@ns ~]# chkconfig nfslock on
[root@ns ~]# chkconfig portmap on 
 
[2] Configuration on NFS clients  
 
[root@www ~]# /etc/rc.d/init.d/portmap start
[root@www ~]# /etc/rc.d/init.d/nfslock start
[root@www ~]# /etc/rc.d/init.d/netfs start
[root@www ~]# chkconfig nfslock on
[root@www ~]# chkconfig portmap on
[root@www ~]# chkconfig netfs on
[root@www ~]# mount -t nfs nfs.server-linux.info:/home /home
[root@www ~]# df -m

# home directory on NFS is mounted

[root@www ~]# vi /etc/fstab

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

nfs.server-linux.info:/home /home nfs defaults 1 2

You are here: Home / CentOS / CentOS NFS Server Configuration