Describe how to use removable media with autofs(5).

Reviewed by:	emaste@, wblock@
Approved by:	gjb@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3980
This commit is contained in:
Edward Tomasz Napierala 2015-12-13 09:45:24 +00:00
parent f7d807d417
commit a0803307e5
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=47846

View file

@ -508,6 +508,68 @@ da0 at umass-sim0 bus 0 scbus4 target 0 lun 0
da0: <STECH Simple Drive 1.04> s/n WD-WXE508CAN263 detached da0: <STECH Simple Drive 1.04> s/n WD-WXE508CAN263 detached
(da0:umass-sim0:0:0:0): Periph destroyed</screen> (da0:umass-sim0:0:0:0): Periph destroyed</screen>
</sect2> </sect2>
<sect2>
<title>Automounting Removable Media</title>
<note>
<para>&man.autofs.5; supports automatic mounting of
removable media starting with &os;&nbsp;10.2-RELEASE.</para>
</note>
<para><acronym>USB</acronym> devices can be automatically
mounted by uncommenting this line in
<filename>/etc/auto_master</filename>:</para>
<screen>/media -media -nosuid</screen>
<para>Then add these lines to
<filename>/etc/devd.conf</filename>:</para>
<screen>notify 100 {
match "system" "GEOM";
match "subsystem" "DEV";
action "/usr/sbin/automount -c";
};
</screen>
<para>Reload the configuration if &man.autofs.5;
and &man.devd.8; are already running:</para>
<screen>&prompt.root; <userinput>service automount reload</userinput>
&prompt.root; <userinput>service devd restart</userinput></screen>
<para>&man.autofs.5; can be set to start at boot by adding this
line to <filename>/etc/rc.conf</filename>:</para>
<programlisting>autofs_enable="YES"</programlisting>
<para>&man.autofs.5; requires &man.devd.8; to be enabled, as it
is by default.</para>
<para>Start the services immediately with:</para>
<screen>&prompt.root; <userinput>service automount start</userinput>
&prompt.root; <userinput>service automountd start</userinput>
&prompt.root; <userinput>service autounmountd start</userinput>
&prompt.root; <userinput>service devd start</userinput></screen>
<para>Each file system that can be automatically mounted appears
as a directory in <filename>/media/</filename>. The directory
is named after the file system label. If the label is
missing, the directory is named after the device node.</para>
<para>The file system is transparently mounted on the first
access, and unmounted after a period of inactivity.
Automounted drives can also be unmounted manually:</para>
<screen>&prompt.root; <userinput>automount -fu</userinput></screen>
<para>This mechanism is typically used for memory cards and
<acronym>USB</acronym> memory sticks. It can be used with
any block device, including optical drives or
<acronym>iSCSI</acronym> <acronym>LUN</acronym>s.</para>
</sect2>
</sect1> </sect1>
<sect1 xml:id="creating-cds"> <sect1 xml:id="creating-cds">