免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 912 | 回复: 0
打印 上一主题 下一主题

怎么样在 solaris 里面运用 auto mount 来 mount NFS [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-19 13:56 |只看该作者 |倒序浏览
auto mount 它是属於 dynamic mount, 也就是说,当你有使用这个 mount 的目录
时, 系统才会自动的帮你把这个目录mount进来.
它不同於 static mount , 是在於 static mount 是在系统开机时, 便 mount 进来
了,而且除非系统关机,或是 root 把它 unmount ? 不然的话,你随时打 mount,
都可以看到它有 mount 上.
使用 auto mount 的好处是,因为它是在你有用到该目录时才做 mount 的动作,
所以用它来 mount NFS 的话,可以不必等对方的 server 起来, 你就能开机,而且
auto mount 它有设定说,在一定时间内,如果该目录没被使用,则系统会自动将它
unmount 掉. 这样又可减少因 mount NFS 而影响系统效率.
在 solaris 中,要设定 automount ,你可以去 man automount.
以下简单说明如何设定 automount.
1. 修改 /etc/auto_master
这个档是 automount 的主要设定档,它里面有定义要 mount 那些目录.
另外,它亦可以参考到另一个你自己设定的 automount 设定档.
下面举一个例子说明如何设定 ( auto_myconfig 是自己的设定档)
% more /etc/auto_master
# Master map for automounter
#
+auto_master
/net -hosts -nosuid,nobrowse
/- /etc/auto_myconfig
/home auto_home -nobrowse
/xfn -xfn
% more /etc/auto_myconfig
/usr/local -rw,intr sparc:/usr/local

在 /etc/auto_myconfig 中,则是去 mount 一台叫 sparc 它所 share 出来
/usr/local 的目录, 并将它 mount 到自己机器的 /usr/local
ps. 如果你使用 automount 的话,在你自己的机器上,并不需要自己去建立
要 mount 的目录, 以上面为例,你并不需要在 /usr 下建立 local 这
个目录再做 mount. auto mount 它会自动帮你建立这个目录,且帮你
mount 上去.
2. 改好了 auto mount 的设定档之後,你必需重跑 autofs 才会使你修改的
auto mount 生效. 执行方法如下:
% su
% cd /etc/init.d
% autofs stop
% autofs start
也就是说, 你要以 root 的身份,先让 aufofs 停掉, 再让它重新 start 就可
以了.
执行完之後, 你就可以到你 mount 的目录下打 ls 看看是否有 mount 进来了.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP