动网论坛,站长建站首选,国内使用量最多的论坛软件 动网论坛官方技术讨论区 站长工具 申请属于您自己的免费论坛
首页 | 新闻资讯 | 网站运营 | 网络编程 | 数据库 | 服务器 | 网页设计 | 图像媒体 | 网络应用 | 搜索优化 | 资源下载 | 动网主机 | DVBOX
    本站内  互联网 ASP论坛  ASP.Net论坛  PHP论坛
   服务器 → 阅读文章
  

 如何在 solaris 中使用 auto mount 来 mount NFS

作者来源: 
阅读 数 460 人次 , 2006-4-4 2:36:00 

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 进来了.
 
 收藏本文  打印本文  论坛讨论  关闭窗口
· 上一篇:在solaris 2.x 上建立 virtual host
· 下一篇:用 ufsrestore指令从磁带 restore 你的资料
· 在AIX上配置两个WMQ队列管理器通过SNA协议通信
· Intel架构服务器产品案例集
· 系统日志配置文件 syslog.conf
· C盘几种重要文件的完全备份方法
· 安装Solaris 9 OS 的 x86用户的切身体验


关于本站 | 联系我们 | 业务合作 | 客户案例 | 诚聘英才 | 广告合作 | 收藏本站
海口动网先锋网络科技有限公司版权所有
Copyright © 2000 - 2006 Cndw.Com
中华人民共和国电信与信息服务业务经营许可证编号 琼 ICP 020077