NFS Installation




Step 1 (In Server Side)

[root@local~]# yum install nfs-utils portmap

Install rpm of NFS main program (nfs-utils) and RPC program (portmap) via yum.




Step 2 (In Server Side)

[root@local~]# vi /etc/exports /home *(rw,no_root_squash,sync) /office 192.168.0.0/24(rw,no_root_squash,sync) /read 192.168.0.0/24(ro,no_root_squash,sync)

modify the 'export' file to configure nfs mount in server side :

* - for all IP

ro - By default, NFS will export the directory read-only.

rw - By default, NFS will export the directory read-only. Quite often you might want to give write access too, for example when user home directories are being exported off a server.

no_root_squash - NFS exports directories with root_squash turned on. This means that root on the client machine will be mapped to the anonymous UID, commonly nobody. The result is that root on the client machine will not be able to access anything in the exported entry. The no_root_squash option prevents this behavior. This options should only be used for trusted clients. We had to use this one for the root filesystems that are exported for the diskless clients.

noaccess - Use this one to make everything under a directory inaccessible to the client. Again this is a way of narrowing down the access permissions. Possible usage is when you're exporting a directory but certain directories under that exported directory should not be accessible to some hosts.




Step 3 (In Server Side)

[root@local~]# /etc/init.d/portmap restart
[root@local~]# /etc/init.d/nfs restart
[root@local~]# /etc/init.d/nfslock restart
[root@local~]# chkconfig portmap on
[root@local~]# chkconfig nfs on
[root@local~]# chkconfig nfslock on

Restart the services of NFS, portmap, nfslock.




Step 4 (In Client SIde)

[root@client~]# mount 192.168.0.2:/home /home

Or

[root@client~]# vi /etc/fstab 192.168.0.2:/home /home nfs defaults 0 0 [root@client~]# mount -a

Simple mount command or
modify /etc/fstab, then re-mount to mount with nfs server.

[root@client~]# df -h /dev/hda1 36G 15G 19G 43% / tmpfs 752M 0 752M 0% /dev/shm 192.168.0.2:/home 100G 10G 90G 10% /home

Try 'df -h' to show back the mounting is work or not.



Server is hosted by Alanstudio
Linux Operating System

Recommend screen resolution 1024 x 768 / IE / FireFox
Alan Studio © 2007 by Alan Cheung Hin Lun. All rights reserved.