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