Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

mount(1M)




automount(1M) automount(1M)
NAME automount - mounts Network File System (NFS) when needed SYNOPSIS automount [-D environment-variable=value] [-f master-file] [-m] [-M mount-directory] [-n] [-tl duration] [-tm interval] [-tw interval] [-T] [-v] [directory map [-mount-options]]... ARGUMENTS directory Specifies an absolute pathname or is -. If the value of directory is an absolute pathname, the map argument that follows specifies an indirect map. An indirect map contains a list of the subdirectories in the directory specified by directory. When you use an indirect map, the subdirectories are mounted when needed. If the value of directory is -, automount treats the map argument that follows as the name of a direct map. A direct map contains entries that associate the absolute pathname of a mount point with a remote file system to be mounted when needed. -D environment-variable=value Assigns the value specified by value to the automount environment variable specified by environment-variable. -f master-file Causes automount to read a local file for initialization before reading the auto.master Network Information Service (NIS) map. -m Suppresses initialization of directory-map pairs listed in the auto.master NIS database. map Specifies a direct or an indirect map. A map can be a file or an NIS map. To specify a file, the value of map must be an absolute pathname. If map is an NIS map, automount assumes that the map is located in /etc/yp/domainname. The determination of whether map is a direct or an indirect map depends on the value of the directory argument that precedes map. For details, see the description of the directory option, earlier in this list. -mount-options Specifies a comma-separated list of mount options, preceded by a hyphen (-). If mount options are present in the specified map, however, the options in the map take precedence. January 1992 1



automount(1M) automount(1M)
-M mount-directory Causes automount to mount temporary file systems in the directory specified by mount-directory instead of /tmp_mnt. -n Disables dynamic mounts. If you use this option, references through the automount daemon succeed only when the target file system has been previously mounted. This option is used to prevent NFS servers from cross-mounting each other. -tl seconds Specifies the amount of time for which a file system is to remain mounted when not in use. The default is 300 seconds (5 minutes). -tm seconds Specifies the interval to wait between attempts to mount a file system. The default is 30 seconds. -tw seconds Specifies the interval to wait between attempts to unmount a file system that has exceeded its cached time. The default is 60 seconds. -T Enables tracing wherein each NFS call is expanded and displayed on the standard output. -v Enables the logging of status messages to the System Console window. DESCRIPTION automount is a daemon that automatically and transparently mounts an NFS when it is needed. To the kernel, automount appears to be an NFS server. The automount daemon works by monitoring attempts to access directories that are associated with an automount map as well as attempts to access any directories or files that reside under them. You can assign a map to a directory by using an entry in a direct automount map or by specifying an indirect map. The automount daemon uses the map to locate an appropriate NFS file server, exported file system, and mount options. It then mounts the file system in a temporary location and replaces the file-system entry for the directory or subdirectory with a symbolic link to the temporary location. If the file system is not accessed within a specified interval, automount unmounts the file system and removes the symbolic link. If the specified directory does not exist, automount creates it, and then removes it when it is no longer needed. 2 January 1992



automount(1M) automount(1M)
Because the name-to-location binding is dynamic, updates to an automount map are transparent to the user. This transparency means that you no longer need to have shared file systems continuously mounted in case a user runs an application that has compiled-in references to specific pathnames. Mapping The automount daemon reads files containing mount instructions. The files are called ``maps'' and the information in the map is called a ``map entry.'' There are two kinds of maps: direct maps and indirect maps. Direct maps. A direct map can be an ASCII file or an NIS map that contains mappings for any number of directories. Each directory listed in the map is automatically mounted as needed. The direct map as a whole is not associated with any single directory. Indirect maps. An indirect map can be an ASCII file or an NIS map. An indirect map allows you to specify mappings for the subdirectories you want to mount under the directory specified by mount-directory on the command line. An indirect map also obscures local subdirectories for which no mapping is specified. In an indirect map, each directory component consists of the basename of a subdirectory to be mounted as needed. Map entry format. A simple map entry has this form: directory [ -mount-options ] location... When used in a direct map, the value of directory is the absolute pathname of the directory to mount. When used in an indirect map, the value of directory is the basename of a subdirectory. The value of mount-options is a comma- separated list of mount options, and location specifies a remote file system from which the directory can be mounted. In the simple case, location has this form: host-name:pathname You can specify multiple location components; if you do, automount first sends request to to the local network or subnetwork. If there is no response, any connected server may respond. The automount daemon mounts the file system from the first computer that replies to the mount request. You can also specify the value of location in this form: January 1992 3



automount(1M) automount(1M)
host-name:path:subdir In this case, host-name is the name of the computer from which to mount the file system, path is the pathname of the directory to mount, and subdir, when supplied, is the name of a subdirectory to which the symbolic link is made. This link can be used to prevent duplicate mounts when multiple directories in the same remote file system can be accessed. Consider this map for /atlas: able rabbit:/atlas/rabbit:able baker rabbit:/atlas/rabbit:baker When a user accesses a file in /atlas/able, automount mounts rabbit:/atlas/rabbit and creates a symbolic link called /atlas/able to the able subdirectory in the temporarily mounted file system. If the user immediately accesses a file in /home/baker, automount needs only to create a symbolic link that points to the baker subdirectory; /atlas/rabbit is already mounted. Consider the same attempts to access files with this map: able homeboy:/home/homeboy/able baker homeboy:/home/homeboy/baker In this case automount would have to mount the file system twice. If you end a line with a backslash (\), automount interprets the next line as a continuation of the preceding line. If you begin a line with a number sign (#), automount interprets the line as a comment. Directory pattern matching. The ampersand (&) is expanded to the value of the directory field for the entry in which it occurs. Consider this map entry: able homeboy:/home/homeboy:& In this case, the & expands to able. The asterisk (*), when supplied as the value of directory, is recognized as the catch-all entry. Such an entry resolves to any entry not previously matched. For instance, say that the following entry appears in the indirect map for /atlas: * &:/atlas/& This entry would allow automatic mounts in /atlas of any remote file system whose location could be specified as 4 January 1992



automount(1M) automount(1M)
host-name:/atlas/host-name Hierarchical map entries. A hierarchical map entry has this form: directory [/[subdirectory[-mount-options]location... ]... The initial slash (/) in /[subdirectory] is required; the optional subdirectory argument is taken as a filename relative to the value of directory. If subdirectory is omitted in the first occurrence, the / refers to the directory itself. Consider this direct map entry: /usr/local \ / -ro,intr loco:/usr/local alt:/usr/local \ /bin -ro,intr alt:/usr/local/bin loco:/usr/local/bin \ /man -ro,intr loco:/usr/local/man alt:/usr/local/man In this case, automount automatically mounts /usr/local, /usr/local/bin, and /usr/local/man, as needed, from either loco or alt, whichever computer responds first. Included Maps You can include the contents of another map within a map with an entry of the form: +mapname The value of mapname can be a filename, the name of an NIS map, or one of the special maps described in the ``Special Maps'' later in the ``Description'' section. Special Maps Three special maps are currently available: -hosts, -passwd, and -null. The -hosts map uses the NIS hosts.byname map to locate a remote computer when the host name is specified. This map specifies mounts of all exported file systems from any computer. For instance, say that this automount command is already in effect: automount /net -hosts A reference to /net/hermes/usr initiates an automatic mount of all file systems from hermes that automount can mount; references to a directory under /net/hermes refers to the corresponding directory on hermes. The -passwd map uses the /etc/passwd file to locate the home directory of a user. For instance, say that this automount January 1992 5



automount(1M) automount(1M)
command is already in effect: automount /homes -passwd If the home directory for a user has the form /dir/server/username, and if server matches the computer on which that directory resides, automount mounts the user's home directory as /homes/login-name. For this map, the tilde character (~) is recognized as a synonym for the login name. The -null map cancels a previous map for the specified directory. You can use the -null map to cancel a map given in auto.master. Configuration and the auto.master Map The automount daemon normally consults the auto.master NIS configuration map for a list of initial automount maps and sets up automatic mounts for them in addition to those given on the command line. If there are duplications, the command-line arguments take precedence. This configuration database contains arguments to the automount command rather than map entries. Unless the -f option is in effect, automount does not look for an auto.master file on the local computer. Maps given on the command line or those given in a local auto.master file specified with -f option override those in the NIS auto.master map. For instance, given the command automount -f /etc/auto.master /home -null - /etc/au to.direct and a file named /etc/auto.master that contains /homes -passwd automount mounts home directories under /homes instead of /home in addition to mounting the various directories specified in the file /etc/auto.direct. Environment Variables You can use environment variables within an automount map. For instance, if $HOME appears in a map, automount expands it to the current value for the HOME variable. If a reference needs to be protected from affixed characters, you can surround the variable name with curly braces. 6 January 1992



automount(1M) automount(1M)
LIMITATIONS Shell filename expansion does not apply to objects that are not currently mounted. Because automount is single-threaded, any request that is delayed by a slow or nonresponding NFS server delays all subsequent automount requests until the delayed request completes. Programs that read /etc/mtab and then touch files that reside under automatic mount points introduce further entries into /etc/mtab. File systems mounted by automount are mounted with type ignore; they do not appear in the output of either mount or df. NOTES When automount receives a SIGHUP signal, it rereads the /etc/mtab file to update its internal record of currently mounted file systems. You should send a SIGHUP signal to automount whenever you use umount to unmount a file system mounted by automount. FILES /etc/mtab File that records the currently mounted file systems /tmp_mnt Directory under which file systems are dynamically mounted /usr/etc/automount Executable file SEE ALSO mount(1M) Chapter 6, ``Configuring and Managing the Network File System,'' in A/UX Network System Administration January 1992 7

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026