10/16/2010

[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
Starting portmap: [ OK ]
[root@ns ~]# /etc/rc.d/init.d/nfs start
Starting nfs services: [ OK ]
Starting nfs quotas: [ OK ]
Starting nfs daemon: [ OK ]
Starting nfs mountd: [ OK ]
[root@ns ~]# /etc/rc.d/init.d/nfslock start
Starting NFS statd: [ OK ]
[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
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 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
Filesystem1M-blocksUsedAvailableUse%Mounted on
/dev/hda1504038244038%/
tmpfs25702570%/dev/shm
/dev/hda51008349244%/tmp
/dev/hda350401062372323%/usr
/dev/hda41008020593643%/var
nfs.server-linux.info:/home100794188954861%/home
# 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
/dev/hda1/ext3defaults1 1
devpts/dev/ptsdevptsgid=5,mode=6200 0
tmpfs/dev/shmtmpfsdefaults0 0
proc/procprocdefaults0 0
sysfs/syssysfsdefaults0 0
/dev/hda5/tmpext3defaults1 2
/dev/hda3/usrext3defaults1 2
/dev/hda4/varext3defaults1 2
/dev/hda2swap swapdefaults 0 0
nfs.server-linux.info:/home/homenfsdefaults1 2

No comments:

Post a Comment