手机版
你好,游客 登录 注册
背景:
阅读新闻

NFS服务器配置及客户端挂载

[日期:2012-09-24] 来源:Linux公社  作者:liuyatao666 [字体:大 中 小]

linux主机客户端配置开机自动挂载:

[root@localhost nfs]# fuser -km /mnt/nfs/      #强制卸载,执行完后,再次使用umount  /mnt/nfs进行卸载

[root@localhost nfs]# umount /mnt/nfs/         #如果还是不能卸载则可以重启系统即可

[root@localhost nfs]# vim /etc/fstab      #编辑开机自动挂载文件

NFS服务器配置及客户端挂载,NFS服务器,NFS,服务器

[root@localhost nfs]# mount -a

linux主机客户端配置连接自动挂载:

[root@localhost nfs]# umount /mnt/nfs/       #将上一步骤中的开机自动挂载卸载掉

[root@localhost nfs]# rpm -qa |grep auto      #查看与自动挂载相关的软件包auto

NFS服务器配置及客户端挂载,NFS服务器,NFS,服务器

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

NFS服务器配置及客户端挂载,NFS服务器,NFS,服务器

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

[root@localhost nfs]# vim /etc/auto.nfs       #编辑该文件

NFS服务器配置及客户端挂载,NFS服务器,NFS,服务器

[root@localhost nfs]# service autofs restart      #重启autofs服务

[root@localhost nfs]# mount      #查看挂载的目录

NFS服务器配置及客户端挂载,NFS服务器,NFS,服务器

[root@localhost nfs]# cd server1   #其实在/mnt/nfs下并没有server1目录,强制切换到server1中后,会自动产生该目录,此时已经将服务器上的

共享文件挂载到了客户端

[root@localhost server1]# mount      #使用mount查看是否挂载成功

NFS服务器配置及客户端挂载,NFS服务器,NFS,服务器

[root@localhost server1]# cd      #离开server1目录

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

NFS服务器配置及客户端挂载,NFS服务器,NFS,服务器

linux
相关资讯       NFS 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款