Rewrite NFS/amd section. Better English, more concise and informative.
Reviewed by: murray
This commit is contained in:
parent
9868f98abe
commit
34153285f8
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=10332
1 changed files with 60 additions and 36 deletions
|
@ -1,7 +1,7 @@
|
|||
<!--
|
||||
The FreeBSD Documentation Project
|
||||
|
||||
$FreeBSD: doc/en_US.ISO8859-1/books/handbook/advanced-networking/chapter.sgml,v 1.80 2001/08/11 20:45:09 jim Exp $
|
||||
$FreeBSD: doc/en_US.ISO8859-1/books/handbook/advanced-networking/chapter.sgml,v 1.81 2001/08/11 21:34:44 jim Exp $
|
||||
-->
|
||||
|
||||
<chapter id="advanced-networking">
|
||||
|
@ -807,55 +807,79 @@ nfs_client_flags="-n 4"</programlisting>
|
|||
<contrib>Contributed by </contrib>
|
||||
</author>
|
||||
</authorgroup>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Chern</firstname>
|
||||
<surname>Lee</surname>
|
||||
<contrib>Rewritten by </contrib>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</sect2info>
|
||||
<title>AMD (automatic mounter daemon)</title>
|
||||
<title>amd</title>
|
||||
|
||||
<indexterm><primary>AMD</primary></indexterm>
|
||||
<indexterm><primary>amd</primary></indexterm>
|
||||
<indexterm><primary>automatic mounter daemon</primary></indexterm>
|
||||
|
||||
<para>AMD is a useful utility used for automatically mounting a
|
||||
filesystem whenever a file or directory within that filesystem is
|
||||
accessed. It will also unmount that filesystem when it has not
|
||||
been used for a time.</para>
|
||||
<para>&man.amd.8;, which is also known as the automatic mounter
|
||||
daemon, is a useful utility used for automatically mounting a
|
||||
remote filesystem whenever a file or directory within that
|
||||
filesystem is accessed. Filesystems that are inactive for a
|
||||
period of time will also be automatically unmounted by
|
||||
<application>amd</application>. Using
|
||||
<application>amd</application> provides a simplistic alternative
|
||||
to static mounts.</para>
|
||||
|
||||
<para>AMD operates by listening in the
|
||||
<filename>/host</filename> and <filename>/net</filename>
|
||||
directories for a filename lookup. On a lookup, it uses the
|
||||
system's resolver routine to find the NFS server, and attempts
|
||||
to map the exported filesystems on the NFS server to the
|
||||
<filename>/host/${HOSTNAME}/</filename> directory.</para>
|
||||
<para><application>amd</application> operates by attaching
|
||||
itself as an NFS server to the <filename>/host</filename> and
|
||||
<filename>/net</filename> directories. When a file is accessed
|
||||
within one of these directories, <application>amd</application>
|
||||
looks up the corresponding remote mount and automatically mounts
|
||||
it. <filename>/net</filename> is used to mount an exported
|
||||
filesystem from an IP address, while <filename>/host</filename>
|
||||
is used to mount an export from a remote hostname.</para>
|
||||
|
||||
<para>The process actually goes a little something like
|
||||
this:</para>
|
||||
<para>An access to a file within
|
||||
<filename>/host/foobar/usr</filename> would tell
|
||||
<application>amd</application> to attempt to mount the
|
||||
<filename>/usr</filename> export on the host
|
||||
<hostid>foobar</hostid>.</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem><para>Someone <command>cd</command>'s into
|
||||
<filename>/host/${HOSTNAME}/exported_filesystem</filename>.</para></listitem>
|
||||
<example>
|
||||
<title>Mounting an Export with <application>amd</application></title>
|
||||
|
||||
<listitem><para>AMD receives the lookup request, and takes the
|
||||
<varname>${HOSTNAME}</varname> token.</para></listitem>
|
||||
<screen>&prompt.user; <userinput>showmount -e foobar</userinput>
|
||||
Exports list on foobar:
|
||||
/usr 10.10.10.0
|
||||
/a 10.10.10.0
|
||||
&prompt.user; cd /host/foobar/usr</screen>
|
||||
</example>
|
||||
|
||||
<listitem><para>AMD attempts to resolve the HOSTNAME
|
||||
token, and map any exports on the server into the
|
||||
<filename>/host/${HOSTNAME}/</filename> directory.</para></listitem>
|
||||
</itemizedlist>
|
||||
<para>As seen in the example, the <command>showmount</command> shows
|
||||
<filename>/usr</filename> as an export. When changing directories to
|
||||
<filename>/host/foobar/usr</filename>, <application>amd</application>
|
||||
attempts to resolve the hostname <hostid>foobar</hostid> and
|
||||
automatically mount the desired export.</para>
|
||||
|
||||
<para>Setting up <application>amd</application> is actually quite simple, perhaps deceptively
|
||||
so:</para>
|
||||
<para><application>amd</application> can be started through the
|
||||
<filename>rc.conf</filename> system by placing the following lines in
|
||||
<filename>/etc/rc.conf</filename>:</para>
|
||||
|
||||
<programlisting>amd_enable="YES"</programlisting>
|
||||
|
||||
<para>Put <varname>amd_enable="YES"</varname> in the
|
||||
<filename>rc.conf</filename> file of the client machine. Thats
|
||||
it, everything you need is already installed. Reboot the machine
|
||||
and amd will create a host directory in your root
|
||||
partition. Then, you can access the remote filesystem like
|
||||
this:</para>
|
||||
<para>Additionally, custom flags can be passed to
|
||||
<application>amd</application> from the
|
||||
<varname>amd_flags</varname> option. By default,
|
||||
<varname>amd_flags</varname> is set to:</para>
|
||||
|
||||
<screen>&prompt.user;<userinput>cd /host/<replaceable>1.1.1.1</replaceable>/file/</userinput></screen>
|
||||
<programlisting>amd_flags="-a /.amd_mnt -l syslog /host /etc/amd.map /net /etc/amd.map"</programlisting>
|
||||
|
||||
<para>Also if you have DNS up and running, you can access the
|
||||
filesystem like this:</para>
|
||||
<para>The <filename>/etc/amd.map</filename> file defines the
|
||||
default options that exports are mounted with. The
|
||||
<filename>/etc/amd.conf</filename> file defines some of the more
|
||||
advanced features of <application>amd</application>.</para>
|
||||
|
||||
<screen>&prompt.user;<userinput>cd /host/<replaceable>machinename</replaceable>/file/</userinput></screen>
|
||||
<para>Consult the &man.amd.8; and &man.amd.conf.5; man pages for more
|
||||
information.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
|
|
Loading…
Reference in a new issue