%general-entities; ]> $LastChangedBy$ $Date$ autofs-&autofs-version; Autofs Introduction to Autofs Autofs controls the operation of the automount daemons. The automount daemons automatically mount filesystems when they are accessed and unmount them after a period of inactivity. This is done based on a set of pre-configured maps. &lfs81_checked; Package Information Download (HTTP): Download (FTP): Download MD5 sum: &autofs-md5sum; Download size: &autofs-size; Estimated disk space required: &autofs-buildsize; Estimated build time: &autofs-time; Autofs Dependencies Required , Optional , , , , (client only), and User Notes: Kernel Configuration Automounter Verify that automounter kernel support has been enabled: File systems ---> <*/M> Kernel automounter version 4 support (also supports v3) [CONFIG_AUTOFS4_FS] Optionally, enable the following options in the kernel configuration: File systems ---> [*] Network File Systems ---> [CONFIG_NETWORK_FILESYSTEMS] <*/M> NFS client support [CONFIG_NFS_FS] <*/M> CIFS support (advanced network filesystem, SMBFS successor) [CONFIG_CIFS] Recompile and install the new kernel, if necessary. Installation of Autofs Install Autofs by running the following commands: ./configure --prefix=/ \ --without-openldap \ --mandir=/usr/share/man && make ./configure --prefix=/ \ --with-systemd \ --without-openldap \ --mandir=/usr/share/man && CFLAGS+='-I/usr/include/tirpc/' make This package does not come with a test suite. Now, as the root user: make install Command Explanations --with-systemd: This switch enables installation of the bundled systemd units. --without-openldap: This switch disables openldap if found. If openldap is desired, omit this switch. Note that openldap support in autofs requires . : This switch enables libtirpc support if available. Configuring Autofs Config Files /etc/sysconfig/autofs.conf, /etc/auto.master, /etc/auto.misc, and /etc/auto.net /etc/sysconfig/autofs.conf /etc/auto.master /etc/auto.misc /etc/auto.net Configuration Information The installation process creates auto.master, auto.misc, auto.smb, and auto.net. Replace the auto.master file with the following commands as the root user: mv /etc/auto.master /etc/auto.master.bak && cat > /etc/auto.master << "EOF" # Begin /etc/auto.master /media/auto /etc/auto.misc --ghost #/home /etc/auto.home # End /etc/auto.master EOF This file creates a new media directory, /media/auto that will overlay any existing directory of the same name. In this example, the file, /etc/auto.misc, has a line: cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom that will mount a cdrom as /media/auto/cd if that directory is accessed. The option tells the automounter to create ghost versions (i.e. empty directories) of all the mount points listed in the configuration file regardless whether any of the file systems are actually mounted or not. This is very convenient and highly recommended, because it will show you the available auto-mountable file systems as existing directories, even when their file systems aren't currently mounted. Without the option, you'll have to remember the names of the directories. As soon as you try to access one of them, the directory will be created and the file system will be mounted. When the file system gets unmounted again, the directory is destroyed too, unless the option was given. An alternative method would be to specify another automount location such as /var/lib/auto/cdrom and create a symbolic link from /media/cdrom to the automount location. The auto.misc file must be configured to your working hardware. The loaded configuration file should load your cdrom if /dev/cdrom is active or it can be edited to match your device setup. Examples for floppies are available in the file and easily activated. Documentation for this file is available using the man 5 autofs command. In the second line, if enabled, a user's home directory would be mounted via NFS upon login. The /etc/home.auto would need to exist and have an entry similar to: joe example.org:/export/home/joe where the directory /export/home/joe is exported via NFS from the system example.org. NFS shares are covered on the next page. This package could also be used to mount SMB shares, however that feature is not configured in these instructions. For additional configuration information, see the man pages for auto.master(5). There are also web resources such as this AUTOFS HOWTO available. <phrase revision="sysv">Boot Script</phrase> <phrase revision="systemd">Systemd Unit</phrase> autofs installs its own boot script, but it has no capability for logging or visual conformance with other BLFS scripts. Install the /etc/init.d/autofs mount script included with the package. To start Autofs at boot, enable the previously installed systemd unit by running the following command as the root user: autofs make install-autofs systemctl enable autofs The time-out variable is set in /etc/sysconfig/autofs.conf. The installed file sets a default of 60 seconds of inactivity before unmounting the device. A much shorter time may be necessary to protect buffer writing to a floppy if users tend to remove the media prior to the timeout setting. You can also specify OPTIONS variable in the /etc/sysconfig/autofs file with any additional parameters that you might want to pass to the automount daemon. Contents Installed Program Installed Libraries Installed Directories automount lookup_dir.so, lookup_file.so, lookup_files.so, lookup_hosts.so, lookup_ldap.so, lookup_multi.so, lookup_nis.so, lookup_nisplus.so, lookup_program.so, lookup_userhome.so, lookup_yp.so, mount_afs.so, mount_autofs.so, mount_bind.so, mount_changer.so, mount_ext2.so, mount_ext3.so, mount_ext4.so, mount_generic.so, mount_nfs.so, mount_nfs4.so, parse_amd.so, and parse_sun.so /lib/autofs Short Descriptions automount is the daemon that performs the mounting when a request is made for the device. automount