[7ef22cff] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[7ef22cff] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
[d4bf650a] | 6 | <!ENTITY autofs-patch-dir "http://ftp.kernel.org/pub/linux/daemons/autofs/v5">
|
---|
| 7 | <!ENTITY autofs-download-http "http://ftp.kernel.org/pub/linux/daemons/autofs/v5/autofs-&autofs-version;.tar.bz2">
|
---|
| 8 | <!ENTITY autofs-download-ftp "ftp://ftp.kernel.org/pub/linux/daemons/autofs/v5/autofs-&autofs-version;.tar.bz2">
|
---|
| 9 | <!ENTITY autofs-md5sum "27839fe6fa8105b2b7d31bc922fd7cf6">
|
---|
| 10 | <!ENTITY autofs-size "221 KB">
|
---|
| 11 | <!ENTITY autofs-buildsize "8.9 MB">
|
---|
[460c6edb] | 12 | <!ENTITY autofs-time "less than 0.1 SBU">
|
---|
[7ef22cff] | 13 | ]>
|
---|
| 14 |
|
---|
| 15 | <sect1 id="autofs" xreflabel="autofs-&autofs-version;">
|
---|
[d3ad3271] | 16 | <?dbhtml filename="autofs.html"?>
|
---|
| 17 |
|
---|
| 18 | <sect1info>
|
---|
| 19 | <othername>$LastChangedBy$</othername>
|
---|
| 20 | <date>$Date$</date>
|
---|
| 21 | </sect1info>
|
---|
| 22 |
|
---|
| 23 | <title>Automate Mounting of File Systems</title>
|
---|
| 24 |
|
---|
| 25 | <indexterm zone="autofs">
|
---|
| 26 | <primary sortas="a-Autofs">Autofs</primary>
|
---|
| 27 | </indexterm>
|
---|
| 28 |
|
---|
| 29 | <sect2 role="package">
|
---|
| 30 | <title>Introduction to Autofs</title>
|
---|
| 31 |
|
---|
| 32 | <para>The <application>autofs</application> package contains userspace
|
---|
| 33 | tools that work with the kernel to mount and un-mount removable file
|
---|
[d4bf650a] | 34 | systems. The primary use is to mount external network file systems like
|
---|
| 35 | nfs (see <xref linkend="nfs-utils"/>) or Samba (see <xref linkend="samba3"/>)
|
---|
| 36 | on demand.</para>
|
---|
| 37 |
|
---|
| 38 | <para>It may also be useful for allowing users to mount floppies, cdroms and
|
---|
[d3ad3271] | 39 | other removable storage devices without requiring the system
|
---|
[d4bf650a] | 40 | administrator to mount the devices although this capability is now generally
|
---|
| 41 | provided by HAL (see <xref linkend="hal"/>). This may not be ideal for all
|
---|
[d3ad3271] | 42 | installations, so be aware of the risks before implementing this feature.</para>
|
---|
| 43 |
|
---|
| 44 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 45 | <itemizedlist spacing="compact">
|
---|
| 46 | <listitem>
|
---|
| 47 | <para>Download (HTTP): <ulink url="&autofs-download-http;"/></para>
|
---|
| 48 | </listitem>
|
---|
| 49 | <listitem>
|
---|
| 50 | <para>Download (FTP): <ulink url="&autofs-download-ftp;"/></para>
|
---|
| 51 | </listitem>
|
---|
| 52 | <listitem>
|
---|
| 53 | <para>Download MD5 sum: &autofs-md5sum;</para>
|
---|
| 54 | </listitem>
|
---|
| 55 | <listitem>
|
---|
| 56 | <para>Download size: &autofs-size;</para>
|
---|
| 57 | </listitem>
|
---|
| 58 | <listitem>
|
---|
| 59 | <para>Estimated disk space required: &autofs-buildsize;</para>
|
---|
| 60 | </listitem>
|
---|
| 61 | <listitem>
|
---|
| 62 | <para>Estimated build time: &autofs-time;</para>
|
---|
| 63 | </listitem>
|
---|
| 64 | </itemizedlist>
|
---|
| 65 |
|
---|
| 66 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
[d4bf650a] | 67 | <para>Recommended Patches: There are frequent patches issued
|
---|
| 68 | for <application>autofs</application>. To get the current patches,
|
---|
| 69 | start in the same directory as the main tar file and run:</para>
|
---|
| 70 |
|
---|
| 71 | <screen><userinput>wget &autofs-patch-dir;/patch_order-&autofs-version; &&
|
---|
| 72 | sed 's;autofs;&autofs-patch-dir;/autofs;' patch_order-&autofs-version; > wget-list &&
|
---|
| 73 | wget -i wget-list</userinput></screen>
|
---|
| 74 |
|
---|
[3597eb6] | 75 | <para condition="html" role="usernotes">User Notes:
|
---|
| 76 | <ulink url="&blfs-wiki;/autofs"/></para>
|
---|
| 77 |
|
---|
[d3ad3271] | 78 | </sect2>
|
---|
| 79 |
|
---|
| 80 | <sect2 role="kernel" id="autofs-kernel">
|
---|
| 81 | <title>Kernel Configuration</title>
|
---|
| 82 |
|
---|
| 83 | <indexterm zone="autofs autofs-kernel">
|
---|
| 84 | <primary sortas="d-Automounter">Automounter</primary>
|
---|
| 85 | </indexterm>
|
---|
| 86 |
|
---|
| 87 | <para>Verify that kernel support has been compiled in or built as
|
---|
| 88 | modules in the following areas:</para>
|
---|
| 89 |
|
---|
[6a0e6e4] | 90 | <screen><literal>File systems ⇒
|
---|
[e19ad480] | 91 | Kernel automounter version 4 support Y or M
|
---|
[6a0e6e4] | 92 | Network File Systems ⇒
|
---|
| 93 | NFS file system support Y or M (optional)
|
---|
| 94 | SMB file system support Y or M (optional)</literal></screen>
|
---|
[d612b9f] | 95 |
|
---|
[d3ad3271] | 96 | <para>Recompile and install the new kernel, if necessary.</para>
|
---|
[7ef22cff] | 97 |
|
---|
[d3ad3271] | 98 | </sect2>
|
---|
[0290a023] | 99 |
|
---|
[d3ad3271] | 100 | <sect2 role="installation">
|
---|
[d612b9f] | 101 |
|
---|
[d3ad3271] | 102 | <title>Installation of Autofs</title>
|
---|
| 103 |
|
---|
[e0d33ef] | 104 | <para>Install <application>autofs</application> by running the following
|
---|
[d3ad3271] | 105 | commands:</para>
|
---|
| 106 |
|
---|
[d4bf650a] | 107 | <screen><userinput>for f in `cat ../patch_order-&autofs-version;`; do
|
---|
| 108 | patch -Np1 -i ../$f
|
---|
| 109 | done &&
|
---|
[6b104248] | 110 | ./configure --prefix=/ --mandir=/usr/share/man &&
|
---|
[d3ad3271] | 111 | make</userinput></screen>
|
---|
| 112 |
|
---|
[d4bf650a] | 113 | <para>This package does not come with a test suite.</para>
|
---|
| 114 |
|
---|
[d3ad3271] | 115 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
| 116 |
|
---|
| 117 | <screen role="root"><userinput>make install &&
|
---|
[d4bf650a] | 118 | ln -sf ../init.d/autofs $(EXTDIR)/rc.d/rcsysinit.d/S52autofs</userinput></screen>
|
---|
[d3ad3271] | 119 |
|
---|
| 120 | </sect2>
|
---|
| 121 |
|
---|
| 122 | <sect2 role="commands">
|
---|
| 123 | <title>Command Explanations</title>
|
---|
| 124 |
|
---|
[d4bf650a] | 125 | <para><command>for f in `cat ../patch_order-&autofs-version;`; do
|
---|
| 126 | patch -Np1 -i ../$f; done</command>: This command applies all the
|
---|
| 127 | patches fetched earlier in the correct order.</para>
|
---|
[765a494] | 128 |
|
---|
[d4bf650a] | 129 | <para><command>ln -sf ../init.d/autofs
|
---|
| 130 | $(EXTDIR)/rc.d/rcsysinit.d/S52autofs</command>: This command sets the
|
---|
| 131 | link to properly start autofs upon boot.</para>
|
---|
[d260aaf4] | 132 |
|
---|
[d3ad3271] | 133 | </sect2>
|
---|
[d260aaf4] | 134 |
|
---|
[d3ad3271] | 135 | <sect2 role="configuration">
|
---|
| 136 | <title>Configuring Autofs</title>
|
---|
[7ef22cff] | 137 |
|
---|
[d3ad3271] | 138 | <sect3 id="autofs-config">
|
---|
| 139 | <title>Config Files</title>
|
---|
[7ef22cff] | 140 |
|
---|
[d3ad3271] | 141 | <para><filename>/etc/sysconfig/autofs.conf</filename>,
|
---|
| 142 | <filename>/etc/auto.master</filename>,
|
---|
| 143 | <filename>/etc/auto.misc</filename>, and
|
---|
| 144 | <filename>/etc/auto.net</filename></para>
|
---|
[7ef22cff] | 145 |
|
---|
[d3ad3271] | 146 | <indexterm zone="autofs autofs-config" >
|
---|
| 147 | <primary sortas="e-etc-sysconfig-autofs.conf">/etc/sysconfig/autofs.conf</primary>
|
---|
| 148 | </indexterm>
|
---|
[7ef22cff] | 149 |
|
---|
[d3ad3271] | 150 | <indexterm zone="autofs autofs-config">
|
---|
| 151 | <primary sortas="e-etc-auto.master">/etc/auto.master</primary>
|
---|
| 152 | </indexterm>
|
---|
[7ef22cff] | 153 |
|
---|
[d3ad3271] | 154 | <indexterm zone="autofs autofs-config">
|
---|
| 155 | <primary sortas="e-etc-auto.misc">/etc/auto.misc</primary>
|
---|
| 156 | </indexterm>
|
---|
[7ef22cff] | 157 |
|
---|
[d3ad3271] | 158 | <indexterm zone="autofs autofs-config">
|
---|
| 159 | <primary sortas="e-etc-auto.net">/etc/auto.net</primary>
|
---|
| 160 | </indexterm>
|
---|
[7ef22cff] | 161 |
|
---|
[d3ad3271] | 162 | </sect3>
|
---|
[7ef22cff] | 163 |
|
---|
[d3ad3271] | 164 | <sect3>
|
---|
| 165 | <title>Configuration Information</title>
|
---|
[7ef22cff] | 166 |
|
---|
[d3ad3271] | 167 | <para>The installation process creates <filename>auto.master</filename>,
|
---|
[d4bf650a] | 168 | <filename>auto.misc</filename>, <filename>auto.smb</filename>, and
|
---|
| 169 | <filename>auto.net</filename>. You will replace the
|
---|
| 170 | <filename>auto.master</filename> with the following commands:</para>
|
---|
[d3ad3271] | 171 |
|
---|
| 172 | <screen role="root"><userinput>mv /etc/auto.master /etc/auto.master.bak &&
|
---|
| 173 | cat > /etc/auto.master << "EOF"
|
---|
| 174 | <literal># Begin /etc/auto.master
|
---|
[7ef22cff] | 175 |
|
---|
[9415459] | 176 | /media/auto /etc/auto.misc --ghost
|
---|
| 177 | #/home /etc/auto.home
|
---|
[7ef22cff] | 178 |
|
---|
[d3ad3271] | 179 | # End /etc/auto.master</literal>
|
---|
| 180 | EOF</userinput></screen>
|
---|
| 181 |
|
---|
[9415459] | 182 | <para>This file creates a new media directory, <filename>/media/auto</filename>
|
---|
| 183 | that will overlay any existing directory of the same name. In this example,
|
---|
| 184 | the file, <filename>/etc/auto.misc</filename>, has a line:</para>
|
---|
| 185 |
|
---|
| 186 | <screen>cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom</screen>
|
---|
| 187 |
|
---|
| 188 | <para>that will mount a cdrom as <filename>/media/auto/cd</filename> if
|
---|
| 189 | that directory is accessed. The <option>--ghost</option> option tells
|
---|
| 190 | the automounter to create "ghost" versions (i.e. empty directories) of
|
---|
| 191 | all the mount points listed in the configuration file regardless of
|
---|
| 192 | whether any of the file systems is actually mounted or not. This is very
|
---|
| 193 | convenient and highly recommended, because it will show you the available
|
---|
| 194 | auto-mountable file systems as existing directories, even when their file
|
---|
| 195 | systems aren't currently mounted. Without the <option>--ghost</option>
|
---|
| 196 | option, you'll have to remember the names of the directories. As soon as
|
---|
| 197 | you try to access one of them, the directory will be created and the file
|
---|
| 198 | system will be mounted. When the file system gets unmounted again, the
|
---|
| 199 | directory is destroyed too, unless the <option>--ghost</option> option
|
---|
| 200 | was given.</para>
|
---|
| 201 |
|
---|
[d3ad3271] | 202 | <note>
|
---|
[d4bf650a] | 203 |
|
---|
[9415459] | 204 | <para>An alternative method would be to specify another automount
|
---|
| 205 | location such as <filename>/var/lib/auto/cdrom</filename> and create a
|
---|
| 206 | symbolic link from <filename>/media/cdrom</filename> to the automount
|
---|
[d4bf650a] | 207 | location.</para>
|
---|
| 208 |
|
---|
[d612b9f] | 209 | </note>
|
---|
[d3ad3271] | 210 |
|
---|
[9415459] | 211 | <para>The <filename>auto.misc</filename> file must be configured to your
|
---|
[d3ad3271] | 212 | working hardware. The loaded configuration file should load your cdrom
|
---|
| 213 | if <filename>/dev/cdrom</filename> is active or it can be edited to
|
---|
[9415459] | 214 | match your device setup. Examples for floppies are available in the file
|
---|
[d3ad3271] | 215 | and easily activated. Documentation for this file is available using the
|
---|
| 216 | <command>man 5 autofs</command> command.</para>
|
---|
| 217 |
|
---|
[9415459] | 218 | <para>In the second line, if enabled, a user's home directory would be
|
---|
| 219 | mounted via NFS upon login. The <filename>/etc/home.auto</filename>
|
---|
| 220 | would need to exist and have an entry similar to:</para>
|
---|
| 221 |
|
---|
| 222 | <screen>joe example.org:/export/home/joe</screen>
|
---|
| 223 |
|
---|
| 224 | <para>where the directory <filename>/export/home/joe</filename> is
|
---|
| 225 | exported via NFS from the system example.org. NFS shares
|
---|
| 226 | are covered on the next page.</para>
|
---|
| 227 |
|
---|
| 228 | <para>This package could also be used to mount SMB shares, that feature
|
---|
| 229 | is not configured in these instructions. For additional configuration
|
---|
| 230 | information, see the man pages for auto.master(5). There
|
---|
| 231 | are also web resources such as this <ulink
|
---|
| 232 | url='http://gentoo-wiki.com/HOWTO_Auto_mount_filesystems_(AUTOFS)#Config_files'>AUTOFS
|
---|
| 233 | HOWTO</ulink>
|
---|
| 234 | availble.</para>
|
---|
| 235 |
|
---|
[d3ad3271] | 236 | </sect3>
|
---|
[d4bf650a] | 237 | <!--
|
---|
[d3ad3271] | 238 | <sect3 id="autofs-init">
|
---|
| 239 | <title>Boot Script</title>
|
---|
| 240 |
|
---|
| 241 |
|
---|
[e0d33ef] | 242 | <para>Install the <filename>/etc/rc.d/init.d/autofs</filename> mount script
|
---|
| 243 | and <filename>/etc/sysconfig/autofs.conf</filename> support file included
|
---|
[5254d12] | 244 | with the <xref linkend="bootscripts"/> package.</para>
|
---|
[d3ad3271] | 245 |
|
---|
| 246 | <indexterm zone="autofs autofs-init">
|
---|
| 247 | <primary sortas="f-autofs-init">autofs</primary>
|
---|
| 248 | </indexterm>
|
---|
| 249 |
|
---|
| 250 | <screen role="root"><userinput>make install-autofs</userinput></screen>
|
---|
| 251 |
|
---|
| 252 | <para>The time-out variable is set in
|
---|
| 253 | <filename>/etc/sysconfig/autofs.conf</filename>. The installed file sets
|
---|
| 254 | a default of 60 seconds of inactivity before unmounting the device. A
|
---|
[e0d33ef] | 255 | much shorter time may be necessary to protect buffer writing to a floppy
|
---|
[d3ad3271] | 256 | if users tend to remove the media prior to the timeout setting.</para>
|
---|
| 257 |
|
---|
| 258 | </sect3>
|
---|
[d4bf650a] | 259 | -->
|
---|
[d3ad3271] | 260 | </sect2>
|
---|
| 261 |
|
---|
| 262 | <sect2 role="content">
|
---|
| 263 | <title>Contents</title>
|
---|
| 264 |
|
---|
| 265 | <segmentedlist>
|
---|
| 266 | <segtitle>Installed Program</segtitle>
|
---|
| 267 | <segtitle>Installed Libraries</segtitle>
|
---|
| 268 | <segtitle>Installed Directories</segtitle>
|
---|
| 269 |
|
---|
| 270 | <seglistitem>
|
---|
| 271 | <seg>automount</seg>
|
---|
[d4bf650a] | 272 | <seg>lookup_file.so, lookup_hosts.so, lookup_multi.so,
|
---|
| 273 | lookup_nisplus.so, lookup_program.so, lookup_userhome.so,
|
---|
| 274 | lookup_yp.so, mount_afs.so, mount_autofs.so, mount_bind.so,
|
---|
| 275 | mount_changer.so, mount_ext2.so, mount_generic.so,
|
---|
| 276 | mount_nfs.so, parse_sun.so</seg>
|
---|
[460c6edb] | 277 | <seg>/lib/autofs and /var/run/autofs</seg>
|
---|
[d3ad3271] | 278 | </seglistitem>
|
---|
| 279 | </segmentedlist>
|
---|
| 280 |
|
---|
| 281 | <variablelist>
|
---|
| 282 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 283 | <?dbfo list-presentation="list"?>
|
---|
| 284 | <?dbhtml list-presentation="table"?>
|
---|
| 285 |
|
---|
| 286 | <varlistentry id="automount">
|
---|
| 287 | <term><command>automount</command></term>
|
---|
| 288 | <listitem>
|
---|
[e0d33ef] | 289 | <para>is the daemon that performs the mounting when a request is
|
---|
[d3ad3271] | 290 | made for the device.</para>
|
---|
| 291 | <indexterm zone="autofs automount">
|
---|
| 292 | <primary sortas="b-automount">automount</primary>
|
---|
| 293 | </indexterm>
|
---|
| 294 | </listitem>
|
---|
| 295 | </varlistentry>
|
---|
| 296 |
|
---|
| 297 | </variablelist>
|
---|
| 298 |
|
---|
| 299 | </sect2>
|
---|
[7ef22cff] | 300 |
|
---|
| 301 | </sect1>
|
---|
| 302 |
|
---|