AUTOMOUNT(8)

NAME
automount - automatically mount NFS file systems

SYNOPSIS
automount [ -mnTv ] [ -D name = value ] [ -f master-file ] [ -M mount-directory ] [ -tl duration ] [ -tm interval ] [ -tw interval ] [ directory mapname [ -mount-options ] ] ...

DESCRIPTION
automount is a daemon that will automatically and transparently mount an NFS file system whenever a file or directory within that system is opened. automount forks a daemon, which appears to be an NFS server to the kernel; lookups on the specified directory are intercepted by this daemon, which uses the map contained in mapname to determine a server, exported file system, and appropriate mount options for a given file system. The named map can either be a file on the local system, or a Network Information Service map. directory is a full pathname starting with a `/'.

When supplied, -mount-options consists of the leading - and a comma-separate list of mount(8) options; if mount options are specified in the map, however, those in the map take precedence.

Once mounted, members of the directory are made available using a symbolic link to the real mount point within a temporary directory.

If directory does not exist, the daemon creates it, and then removes it automatically when the daemon exits.

Since the name-to-location binding is dynamic, updates to a Network Information Service map are transparent to the user. This obviates the need to ``pre-mount'' shared file systems for applications that have ``hard coded'' references to files. It also obviates the need to maintain records of which hosts must be mounted for what applications.

  Maps
automount looks first for the indicated mapname in a file by that name. If there is no such file, it looks for a NIS map by that name.

An automount map is composed of a list of mappings, with one mapping per line. Each mapping is composed of the following fields:

    basename [-mount-options] location [...]

where basename is the name of a subdirectory within the directory specified in the automount command line (not a relative pathname). The location field consists of an entry of the form:

    host:directory[:subdir]

where host is the name of the host from which to mount the file system, directory 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 can be used to prevent duplicate mounts in cases where multiple directories in the same remote file system are accessed.

The contents of a NIS map can be included within a map by adding an entry of the form:

    +mapname

A mapping can be continued across line breaks using a \ as the last character before the NEWLINE. Comments begin with a # and end at the subsequent NEWLINE.

If more than one location is supplied, there is no guarantee as to which location will be used; the first location to respond to the mount request gets mounted. The mount-options field can be used to supply options to the mount(8) command for the mounted file system.

  Special Maps

There are three special maps currently available: -hosts, -null, and -passwd.

The -hosts map uses the Network Information Service hosts.byname map to locate a remote host when the hostname is specified as a subdirectory of directory. This map specifies mounts of all exported file systems from any host. For instance, if the following automount command is already in effect:

    automount /net -hosts

then a reference to /net/hermes/usr would initiate an automatic mount of all file systems from hermes that automount can mount; references to a directory under /net/hermes will refer to the corresponding directory on hermes.

The -null map cancels any subsequent map for the directory indicated. It can be used to cancel a map given in auto.master or for a mount point specified as an entry in a direct map.

The -passwd map uses the passwd(5) database to attempt to locate the home directory of a user. For instance, if the following automount command is already in effect:

    automount /homes -passwd

then if the home directory shown in the passwd entry for the user username has the form /dir/server/username, and server matches the host system on which that directory resides, references to files in /homes/username result in the file system containing that directory being mounted if necessary, and all such references will refer to that user's home directory.

  Configuration
automount normally consults the auto.master Network Information Service configuration database for a list of initial directory to mapname pairs, 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. (Note that this database contains arguments to the automount command, rather than mappings, and that automount does not look for an auto.master file on the local host.)

OPTIONS

-m  Suppress initialization of directory-mapname pairs listed in the auto.master Network Information Service database.

-n  Disable dynamic mounts. With this option, references through the automount daemon only succeed when the target filesystem has been previously mounted. This can be used to prevent NFS servers from cross-mounting each other.

-T  Trace. Expand each NFS call and display it on the standard output.

-v  Verbose. Log status and warning messages to the console.

-D envar=value
    Assign value to the indicated automount (environment) variable.

-f master-file
    Read a local initialisation file, ahead of the auto.master NIS map.

-M mount-directory
    Mount temporary file systems in the named directory, rather than /tmp_mnt.

-tl duration
    Specify a duration, in seconds, that a looked up name remains cached when not in use. The default is 5 minutes.

-tm interval
    Specify an interval, in seconds, between attempts to mount a filesystem. The default is 30 seconds.

-tw interval
    Specify an interval, in seconds, between attempts to dismount filesystems that have exceeded their cached times. The default is 1 minute.

EXAMPLE

    tutorial# automount -m /net -hosts

Provide automount access to the exported file systems of any host in the Network Information Service hosts.byname database, by prefixing the pathname with /net/hostname/ :

    tutorial% ls /net/hermes/usr/src ...

FILES
/tmp_mnt
    directory under which filesystems are dynamically mounted

SEE ALSO
mount(8)

BUGS
Shell filename expansion does not apply to objects not currently mounted or cached. For instance, in the above example, the command ls /net/* might not list hermes as a subdirectory of /net.