(NFS) on RedHat
Posted 06-03-2008 at 06:54 AM by sujit123
0. Is NFS running on your system?
Before the configuration of NFS, you can check whether your linux system has NFS installed or not.
[root@water root]# chkconfig --list | grep nfs
If you see the following information, then continue on section 1.
nfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off
nfslock 0:off 1:off 2:off 3:on 4:on 5:on 6:off
If you don't see anything, you can start NFS without reboot system by entering the command:
[root@water root]# /etc/rc.d/init.d/nfs start
1. NFS Server Configuration
1.1 The first step to setup the server is to modify the /etc/exports file on the server machine. The file specifies which partition on the server will be exported to client machines with certain permissions.
Following is an example of a NFS /etc/exprots file:
#
# /ect/exports for nfsfishes.mydomain.edu
#
/export/home walleye.mydomain.edu(rw) \
crappie.mydomain.edu(rw)
/export/data walleye.mydomain.edu(rw) \
crappie.mydomain.edu(rw)
The partitions /export/home and /export/data on the server named as water are shared by the clients named as walleye and crappie with read and write permissions.
1.2 After modifying the /etc/exports file, you have to use the exportfs command to tell the NFS server processes to re-read the configuration information.
[root@water root]# exportfs -r
OK, the NFS server configuration is done.
2. NFS Client Configuration
NFS clients are easy to configure under Linux. You can use mount command to under the command line as following:
[root@walleye root]# mount water:/export/home /nfs/home
You can also add the mount options into /etc/fstab file.
water:/export/home /nfs/home nfs bg 0 0
That's it.
3. Help
man chkconfig
man exportfs
man mount
Before the configuration of NFS, you can check whether your linux system has NFS installed or not.
[root@water root]# chkconfig --list | grep nfs
If you see the following information, then continue on section 1.
nfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off
nfslock 0:off 1:off 2:off 3:on 4:on 5:on 6:off
If you don't see anything, you can start NFS without reboot system by entering the command:
[root@water root]# /etc/rc.d/init.d/nfs start
1. NFS Server Configuration
1.1 The first step to setup the server is to modify the /etc/exports file on the server machine. The file specifies which partition on the server will be exported to client machines with certain permissions.
Following is an example of a NFS /etc/exprots file:
#
# /ect/exports for nfsfishes.mydomain.edu
#
/export/home walleye.mydomain.edu(rw) \
crappie.mydomain.edu(rw)
/export/data walleye.mydomain.edu(rw) \
crappie.mydomain.edu(rw)
The partitions /export/home and /export/data on the server named as water are shared by the clients named as walleye and crappie with read and write permissions.
1.2 After modifying the /etc/exports file, you have to use the exportfs command to tell the NFS server processes to re-read the configuration information.
[root@water root]# exportfs -r
OK, the NFS server configuration is done.
2. NFS Client Configuration
NFS clients are easy to configure under Linux. You can use mount command to under the command line as following:
[root@walleye root]# mount water:/export/home /nfs/home
You can also add the mount options into /etc/fstab file.
water:/export/home /nfs/home nfs bg 0 0
That's it.
3. Help
man chkconfig
man exportfs
man mount