2010年(23)
分类: LINUX
2010-06-06 15:57:04
1.编辑/etc/exportfs,共享/home目录:
[root@master ]#vi /etc/exportfs
/home *(ro,sync)
2.使配置生效:
[root@master ]#exportfs -a
3.启动NFS Server:
[root@master ]#service nfs start
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
[root@master ]#chkconfig nfs on
2. 在client端配置NFS Server:
[root@client ]#service nfs start
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
[root@client ]#chkconfig nfs on
创建一个新的/home用来挂载master上的/home
[root@client ]#mv /home /home.old
[root@client ]#mkdir /home
[root@client ]#mount -t nfs 192.168.1.110:/home /home
[root@client ]ls /home #检查一下挂载是否成功
[root@client ]umount /home
接着使用autofs工具在系统启动时自动挂载master上的/home.
首先编辑/etc/auto.master,加入下行:
/home /etc/auto.home --timeout 600
其次编辑/etc/auto.home,加入下行:
* -fstype=nfs,ro 192.168.1.110:/home
启动autofs服务:
[root@client ]#chkconfig autofs on
[root@client ]#service autofs start
Starting automount:[ OK ]