linux主机客户端配置开机自动挂载:
[root@localhost nfs]# fuser -km /mnt/nfs/ #强制卸载,执行完后,再次使用umount /mnt/nfs进行卸载
[root@localhost nfs]# umount /mnt/nfs/ #如果还是不能卸载则可以重启系统即可
[root@localhost nfs]# vim /etc/fstab #编辑开机自动挂载文件

[root@localhost nfs]# mount -a
linux主机客户端配置连接自动挂载:
[root@localhost nfs]# umount /mnt/nfs/ #将上一步骤中的开机自动挂载卸载掉
[root@localhost nfs]# rpm -qa |grep auto #查看与自动挂载相关的软件包auto

[root@localhost nfs]# vim /etc/auto.master #编辑与自动挂载相关的配置文件

[root@localhost nfs]# cp -p /etc/auto.misc /etc/auto.nfs #产生auto.nfs文件
[root@localhost nfs]# vim /etc/auto.nfs #编辑该文件

[root@localhost nfs]# service autofs restart #重启autofs服务
[root@localhost nfs]# mount #查看挂载的目录

[root@localhost nfs]# cd server1 #其实在/mnt/nfs下并没有server1目录,强制切换到server1中后,会自动产生该目录,此时已经将服务器上的
共享文件挂载到了客户端
[root@localhost server1]# mount #使用mount查看是否挂载成功

[root@localhost server1]# cd #离开server1目录
[root@localhost ~]# mount #离开一份分钟后再次查看挂载情况,此时server1目录也不存在了

