autofs(1M)
autofs - install automatic mount points
As shipped in IRIX 6.5. First release of IRIX 6.5.
NAME autofs - install automatic mount points SYNOPSIS /usr/etc/autofs [ -v ] [ -t duration ] DESCRIPTION autofs is a command that installs AutoFS mount points and associates an AutoFS map with each mount point. The AutoFS filesystem monitors attempts to access directories within it and notifies the autofsd(1M) daemon. The daemon uses the map to locate a filesystem, which it then mounts at the point of reference within the AutoFS filesystem. If the filesystem is not accessed within an appropriate interval (five minutes by default), the autofsd daemon unmounts the filesystem. AutoFS is started by the /etc/init.d/network script, if the configuration flags ``nfs'' and ``autofs'' are set ``on'' at system initialization. (See autofsd(1M).) The script starts the autofsd daemon and invokes the autofs command. The autofs command consults the master map, a local file named /etc/auto_master, for a list of AutoFS mount points and their maps. The master map contains the locations of all AutoFS mount points. By default, /etc/auto_master contains an entry for the -hosts map: /hosts -hosts -nosuid,vers=2 Each entry in the master file specifies a directory on which an AutoFS mount will be made followed by the AutoFS map to be associated with it. Mount options may be supplied as an optional third field in each entry. These options are used for any entries in the map that do not specify mount options explicitly. The autofs command is usually run without arguments. It compares the entries in /etc/auto_master with the current list of AutoFS mounts in /etc/mtab and adds, removes or updates AutoFS mounts to bring the /etc/mtab up to date with /etc/auto_master. At boot time the autofs command installs all AutoFS mounts from the master map. Subsequently, it may be run to install AutoFS mounts for new entries in the master map, or to perform unmounts for entries that have been removed. OPTIONS -t duration Specify a duration, in seconds, that a filesystem is to remain mounted when not in use. The default is 300 (5 minutes). -v Verbose mode. Notify of AutoFS mounts, unmounts or other non- essential information. USAGE Map Entry Format The format for master map entries was discussed above. Entries in other map files take the form: key [ -mount-options ] location ... where key is the full pathname of the directory to mount when used in a direct map, or the simple name of a subdirectory in an indirect map. mount-options is a comma-separated list of mount options, and location specifies a filesystem from which the directory may be mounted. In the case of a simple NFS mount, location takes the form: hostname:pathname hostname is the name of the host from which to mount the filesystem (it may be omitted if the pathname refers to a local device on which the filesystem resides) and pathname is the pathname of the directory to mount. So, /etc/auto_master might contain an entry such as: /src /etc/auto_src -nosuid where /etc/auto_src contains: new awesome:/latest/src old -ro cave:/archive Accessing /src/{new,old} would result in a mount of the corresponding remote filesystem. Replicated Filesystems Multiple location fields can be specified for replicated NFS filesystems, in which case autofs chooses the server that responds first. If each location in the list shares the same pathname then a single location may be used with a comma-separated list of hostnames: hostname1,hostname2...:pathname A mapping can be continued across input lines by escaping the NEWLINE with a `\' (backslash). Comments begin with a '#' (pound sign) and end at the subsequent NEWLINE. Map Key Substitution" The '&' (ampersand) character is expanded to the value of the key field for the entry in which it occurs. In this case: whozi onyxserver:/home/& the & expands to whozi. Wildcard Key The '*' (asterisk) character, when supplied as the key field, is recognized as the catch-all entry. Such an entry will match any key not previously matched. For instance, if the following entry appeared in the indirect map for /config: * &:/public/config/& this would allow automatic mounts in /config of any remote filesystem whose location could be specified as: hostname:/public/config/hostname Variable Substitution Client specific variables can be used within an AutoFS map. For instance, if $HOST appeared within a map, autofs would expand it to its current value for the client's host name. Supported variables are: CPU The output of uname -p. The processor type. For example "mips" HOST The output of uname -n. The host name. For example "ferd" OSNAME The output of uname -s. The OS name. For example "IRIX" OSREL The output of uname -r. The OS release name. For example "6.2" OSVERS The output of uname -v. The OS version. For example "10230951" If a reference needs to be protected from affixed characters, you can surround the variable name with '{}' (curly braces). Multiple Mounts A multiple mount entry takes the form: key [ -mount-options ] [[mountpoint] [-mount-options] location...]... The initial /[mountpoint] is optional for the first mount and mandatory for all subsequent mounts. The optional mountpoint is taken as a pathname relative to the directory named by key. If mountpoint is omitted in the first occurrence, a mountpoint of / (root) is implied. Given an entry in the indirect map for /src: beta -ro \ / svr1,svr2:/public/src/beta \ /1.0 svr1,svr2:/public/src/beta/1.0 \ /1.0/man svr1,svr2:/public/src/beta/1.0/man autofs would automatically mount /src/beta, /src/beta/1.0, and /src/beta/1.0/man, as needed, from either svr1 or svr2, whichever host responds first. Other Filesystem Types AutoFS assumes NFS Version 3 mounts as the default filesystem type. Should the server not support NFS V3, AutoFS will retry the mount(s) using the NFS V2 filesystem type. Users can select a particular version of the NFS protocol using the vers={2,3} mount option (see fstab(4)). The default configuration contains vers=2. Other filesystem types can be described using the fstype mount option. Other mount options specific to this filesystem type can be combined with the fstype option. The location field must contain information specific to the filesystem type. If the location field begins with a slash, a colon character must be prepended. Mounts using CacheFS are most useful when applied to an entire map as map defaults. The following entry in the master map describes cached home directory mounts. It assumes the default location of the cache directory, /cache. /home auto_home -fstype=cachefs,backfstype=nfs The backfstype option is required for CacheFS map entries. Indirect Maps An indirect map allows you to specify mappings for the subdirectories you wish to mount under the directory chosen as the AutoFS mount point. In an indirect map, each key consists of a simple name (i.e., subdirectory) that refers to one or more filesystems that are to be mounted as needed. Direct Maps Entries in a direct map are associated directly with AutoFS mount points. Each key is the full pathname of an AutoFS mount point. The direct map as a whole is not associated with any single directory. Included Maps The contents of another map can be included within a map with an entry of the form: +mapname If mapname begins with a slash then it is assumed to be the pathname of a local file. autofs: files nis If the name service is files then the name is assumed to be that of a local file in /etc. If the key being searched for is not found in the included map, the search continues with the next entry. Special Maps There are two special maps available: -hosts and -null. By default, the -hosts map is used with the /hosts directory. It assumes that the map key is the hostname of an NFS server. The autofsd daemon dynamically constructs a map entry from the server's list of exported filesystems. (See NOTES on -nohide.) For instance a reference to /hosts/bart/usr would initiate an automatic mount of all exported filesystems from bart that are mountable by the client. References to a directory under /hosts/bart will refer to the corresponding directory relative to bart's root. The -null map, when indicated in a map entry, cancels a previous map for the directory indicated. This is most useful in the /etc/auto_master file for cancelling entries that would otherwise be inherited from the +auto_master include entry. To be effective, the -null entries must be inserted before the included map entry. FILES /etc/auto_master master AutoFS map. /etc/config/autofs.options options and arguments for the autofs command and the autofsd daemon. SEE ALSO autofsd (1M), chkconfig (1M), exports (4), fstab (4), mount (1M) NOTES The -hosts map mounts all of the exported NFS filesystems, for which the client has access, from a server. Use the nohide export option on the server (see exports(4)) to minimize the number of mounts performed by clients. AutoFS will not request a separate mount for a nohide filesystem, if the client has access via the parent filesystem. If frequent access to just a single filesystem is required, it is more efficient to access the filesystem with a map entry that is tailored to mount just the filesystem of interest. AutoFS mount points must not be hierarchically related. autofs does not allow an AutoFS mount point to be created within another AutoFS mount. Since each direct map entry results in a new AutoFS mount such maps should be kept short. If a directory contains direct map mount points then an `ls -l' in the directory will force all of the direct map mounts to occur. Entries in both direct and indirect maps can be modified at any time. The new information is used when autofsd next uses the map entry to do a mount. New entries added to a master map or direct map will not be useful until the autofs command is run to install them as new AutoFS mount points. New entries added to an indirect map may be used immediately. An AutoFS directory associated with an indirect map shows only currently-mounted entries. This is a deliberate policy to avoid inadvertent mounting of every entry in a map via an `ls -l' of the directory. The multiple location feature for NFS mounts allows the autofsd daemon to choose the most appropriate server at mount time. While such a mount is in effect, the daemon does not monitor the status of the server. If the server crashes, autofsd will not select an alternative server from the list. Default mount options can be assigned to an entire map when specified as an optional third field in the master map. These options apply only to map entries that have no mount options.