3 月 102014
 

我这几天在做linux的网络安装,为了节省时间,我直接挂载镜像文件,然后通过nfs提供服务,

mount -o loop /extra/samba_bak/操作系统/centos/CentOS-6.4-x86_64-bin-DVD1.iso /extra/nfs_share/centos6.4/

/extra/nfs_share/        192.168.0.0/16(ro,no_root_squash)  localhost(rw)

但是通过别的服务器访问的时候,centos6.4下没有文件。

后来查了一些资料,修改nfs的配置

/extra/nfs_share/   192.168.0.0/16(ro,async,nohide,crossmnt)  localhost(rw)

然后通过nfs访问就可以看到文件了。

鸟哥的解释是

# NFS 的設定是很簡單,不過,要注意由於 server 上面有兩個掛載點在分享的目錄上, # 所以得要加上 nohide 與 crossmnt 這兩個參數才行!且後續的服務要開比較多就是了~

也就是说多重挂载的话,必须加上这2个,才能访问到。

参数的意义:

谨慎使用crossmnt 和 nohide

crossmnt 添加该参数 一个文件系统被导出 如果它的子目录也被导出的时候 用户是可以看 见访问的 较为危险

nohide 挂载的子目录,其父目录被挂载时 用户是可见的 hecrossmnt作用相似

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny