Add documentation for autofs(5).

Reviewed by:	gjb@
Approved by:	gjb@
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Edward Tomasz Napierala 2014-08-19 09:54:47 +00:00
parent 138b609bf7
commit 62cac0bccf
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=45476

View file

@ -797,7 +797,7 @@ rpc_statd_enable="YES"</programlisting>
<sect2 xml:id="network-amd">
<info>
<title>Automating Mounts</title>
<title>Automating Mounts With &man.amd.8;</title>
<authorgroup>
<author>
@ -897,6 +897,113 @@ Exports list on foobar:
<para>Consult &man.amd.8; and &man.amd.conf.5; for more
information.</para>
</sect2>
<sect2 xml:id="network-autofs">
<title>Automating Mounts with &man.autofs.5;</title>
<note>
<para>The &man.autofs.5; automount facility is supported
starting with &os;&nbsp;10.1-RELEASE. To use the
automounter functionality in older versions of &os;, use
&man.amd.8; instead. This chapter only describes the
&man.autofs.5; automounter.</para>
</note>
<indexterm><primary>autofs</primary></indexterm>
<indexterm>
<primary>automounter subsystem</primary>
</indexterm>
<para>The &man.autofs.5; facility is a common name for several
components that, together, allow for automatic mounting of
remote and local filesystems whenever a file or directory
within that file system is accessed. It consists of the
kernel component, &man.autofs.5;, and several userspace
applications: &man.automount.8;, &man.automountd.8; and
&man.autounmountd.8;. It serves as an alternative for
&man.amd.8; from previous &os; releases. Amd is still
provided for backward compatibility purposes, as the two use
different map format; the one used by autofs is the same as
with other SVR4 automounters, such as the ones in Solaris,
MacOS X, and Linux.</para>
<para>The &man.autofs.5; source is mounted on specified
mountpoints by &man.automount.8;, usually invoked during
boot.</para>
<para>Whenever a process attempts to access file within the
&man.autofs.5; mountpoint, the kernel will notify
&man.automountd.8; daemon and pause the triggering process.
The &man.automountd.8; daemon will handle kernel requests by
finding the proper map and mounting the filesystem according
to it, then signal the kernel to release blocked process. The
&man.autounmountd.8; daemon automatically unmounts automounted
filesystems after some time, unless they are still being
used.</para>
<para>The primary autofs configuration file is
<filename>/etc/auto_master</filename>. It assigns individual
maps to top-level mounts. For an explanation of
<filename>auto_master</filename> and the map syntax, refer to
&man.auto.master.5;.</para>
<para>There is a special automounter map mounted on
<filename>/net</filename>. When a file is accessed within
this directory, &man.autofs.5; looks up the corresponding
remote mount and automatically mounts it. For instance, an
attempt to access a file within
<filename>/net/foobar/usr</filename> would tell
&man.automountd.8; to mount the <filename
class="directory">/usr</filename> export from the host
<systemitem class="fqdomainname">foobar</systemitem>.</para>
<example>
<title>Mounting an Export With &man.autofs.5;</title>
<para>In this example, <command>showmount -e</command> shows
the exported file systems that can be mounted from the
<acronym>NFS</acronym> server,
<systemitem class="fqdomainname">foobar</systemitem>:</para>
<screen>&prompt.user; <userinput>showmount -e foobar</userinput>
Exports list on foobar:
/usr 10.10.10.0
/a 10.10.10.0
&prompt.user; <userinput>cd /host/foobar/usr</userinput></screen>
</example>
<para>The output from <command>showmount</command> shows
<filename class="directory">/usr</filename> as an export.
When changing directories to <filename
class="directory">/host/foobar/usr</filename>,
&man.automountd.8; intercepts the request and attempts to
resolve the hostname <systemitem
class="fqdomainname">foobar</systemitem>. If successful,
&man.automountd.8; automatically mounts the source
export.</para>
<para>To enable &man.autofs.5; at boot time, add this line to
<filename>/etc/rc.conf</filename>:</para>
<programlisting>autofs_enable="YES"</programlisting>
<para>Then &man.autofs.5; can be started by running:</para>
<screen>&prompt.root; <userinput>service automount start</userinput></screen>
<screen>&prompt.root; <userinput>service automountd start</userinput></screen>
<screen>&prompt.root; <userinput>service autounmountd start</userinput></screen>
<para>The &man.autofs.5; map format is the same as in other
operating systems, it might be desirable to consult
information from other operating systems, such as the <link
xlink:href="http://images.apple.com/business/docs/Autofs.pdf">Mac
OS X document</link>.</para>
<para>Consult the &man.automount.8;, &man.automountd.8;,
&man.autounmountd.8;, and &man.auto.master.5; manual pages for
more information.</para>
</sect2>
</sect1>
<sect1 xml:id="network-nis">