📄 doc045.htm
字号:
<html><body><a href="doc046.html"><img src=../icons/next.gif alt="Next"></a><a href="doc000.html"><img src=../icons/up.gif alt="Up"></a><a href="doc044.html"><img src=../icons/previous.gif alt="Previous"></a><a href="doc000.html"><img src=../icons/contents.gif alt="Contents"></a><a href="doc123.html"><img src=../icons/index.gif alt="Index"></a><hr><h2><a name="s5.9">5.9 NFS Configuration</a></h2><title>NFS Configuration</title><a name="i144">NFS stands for Network File System, and is a way to share filesbetween machines as if they were on your local hard drive.Linux can be both an NFS server and an NFS client, which meansthat it can ``export'' filesystems to other systems, and ``mount''filesystems exported from other machines.<p><h3><a name="s5.9.1">5.9.1 Mounting NFS Filesystems</a></h3><title>Mounting NFS Filesystems</title><a name="i145"><p>Use the mount command to mount a NFS filesystem from another machine:<p><blockquote><font size=-1><tt><pre>mount porky:/mnt/export /mnt/local</pre></tt></font></blockquote><p>In this command, <tt>porky</tt> is the hostname of the NFS fileserver,<tt>/mnt/export</tt> is the filesystem that porky is exporting, and<tt>/mnt/local</tt> is a directory on my local machine where I want tomount the filesystem. After the mount command runs (and if Ihad the proper permissions from porky) - voila! - I can enter `ls /mnt/local'and get a listing of the files in /mnt/export on porky.<p><h3><a name="s5.9.2">5.9.2 Exporting NFS Filesystems</a></h3><title>Exporting NFS Filesystems</title><a name="i146"><p>The file that controls what filesystems you wish to export is``/etc/exports''. Its format is:<p><blockquote><font size=-1><tt><pre>directory hostname(options)</pre></tt></font></blockquote><p>the ``(options)'' are optional. For example:<p><blockquote><font size=-1><tt><pre>/mnt/export speedy.redhat.com</pre></tt></font></blockquote><p>would allow <tt>speedy.redhat.com</tt> to mount /mnt/export, but:<p><blockquote><font size=-1><tt><pre>/mnt/export speedy.redhat.com(ro)</pre></tt></font></blockquote><p>would just allow speedy to mount /mnt/export read-only.<p>Each time you change /etc/exports, you need to tell the NFSdaemons to examine it for new information. One simple wayto accomplish this is to just stop and start the daemons:<p><blockquote><font size=-1><tt><pre>/etc/rc.d/init.d/nfs stop/etc/rc.d/init.d/nfs start</pre></tt></font></blockquote><p>The following will also work:<p><blockquote><font size=-1><tt><pre>killall -HUP rpc.nfsd rpc.mountd</pre></tt></font></blockquote><p>See the following man pages for more details: nfsd(8), mountd(8),and exports(5). Another good reference is <i>Managing NFS and NISServices</i> by Hal Stern, published by O'Reilly & Associates.<a name="i147"><p><p><hr><a href="doc046.html"><img src=../icons/next.gif alt="Next"></a><a href="doc000.html"><img src=../icons/up.gif alt="Up"></a><a href="doc044.html"><img src=../icons/previous.gif alt="Previous"></a><a href="doc000.html"><img src=../icons/contents.gif alt="Contents"></a><a href="doc123.html"><img src=../icons/index.gif alt="Index"></a><hr></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -