automount(1M) automount(1M)
NAME
automount - automatically mount NFS file systems
SYNOPSIS
automount [-nTT1qv] [-D name=value] [-f master-file]
[-M mount-directory] [-o hard | intr] [-t sub-options]
[directory map [-mount-options]] ...
DESCRIPTION
automount is a daemon that automatically and transparently mounts an
NFS file system as needed. It monitors attempts to access directories
that are associated with an automount map, along with any directories
or files that reside under them. When a file is to be accessed, the
daemon mounts the appropriate NFS directory. A directory which is to
be monitored can be specified either in a direct or in an indirect
assignment file.
automount uses entries in a 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 creates a symbolic link from
the mount point specified in the map to the temporary mount point. If
the file system is not accessed within an appropriate interval (five
minutes by default), the daemon unmounts the file system and removes
the symbolic link. If the indicated directory has not already been
created, the daemon creates it.
If you specify the dummy directory /-, automount treats the map argu-
ment that follows as the name of a direct map. In a direct map, each
entry associates the full pathname of a mount point with a remote file
system to mount.
If the directory argument is a pathname, the map argument points to an
indirect map. An indirect map contains a list of the subdirectories
contained within the indicated directory. With an indirect map, it is
these subdirectories that are mounted automatically. The map argument
must be a full pathname.
The -mount-options argument, when supplied, is a comma-separated list
of mount(1M-nfs) options, preceded by a hyphen (-). If mount options
are specified in the indicated map, however, those in the map take
precedence.
OPTIONS
-n Disable dynamic mounts. With this option, links through the
automount daemon only succeed when the target file system has
been previously mounted. This option can be used to prevent NFS
servers from cross-mounting each other.
-T Log function. Logs each NFS call and stores it in an internal
buffer. The log is then written continuously from this buffer to
standard error output.
Page 1 Reliant UNIX 5.44 Printed 11/98
automount(1M) automount(1M)
The output is suppressed by sending the SIGUSR1 (kill -16 pid)
signal to automount. All messages that have accumulated meanwhile
in the buffer are output by sending this signal again and the
continuous log output is disabled.
-T1 automount actions are also logged.
-q The log is not output initially, but output can be forced again
with the SIGUSR1 signal. This makes sense if automount is started
in a startup script, but the log messages are not to appear con-
stantly on the console.
-v Verbose. Log status messages to the console.
-D name=value
Assign value to the indicated automount (environment) variable.
-f master-file
Specifies a master map. A master map contains links to direct or
indirect maps (see also the Network Administration manual).
-M mount-directory
Mount temporary file systems in the named directory, instead of
/tmpmnt.
-o hard | intr
Access to the mount point (i.e. the symbolic link created by
automount) is not interruptible. They are retried indefinitely if
hard is specified. If you specify intr, access is also retried
indefinitely but can be interrupted by signals.
-t sub-options
Specify sub-options as a comma-separated list that contains any
combination of the following:
l duration
Specify a duration, in seconds, that a file system is to
remain mounted when not in use. The default is 5 minutes.
m interval
Specify an interval, in seconds, between attempts to mount a
file system. The default is 30 seconds.
w interval
Specify an interval, in seconds, between attempts to unmount
resources whose mount duration has expired. The default is 1
minute.
Page 2 Reliant UNIX 5.44 Printed 11/98
automount(1M) automount(1M)
p duration
If the sub-option is specified, automount checks that the
server can be accessed when attempting to unmount an unused
file system. If the server does not respond within a
duration of seconds the unmount attempt fails.
If the sub-option is not specified, the accessibility check
is not performed. If the server cannot be accessed, the
unmount attempt only fails after 75 seconds.
ENVIRONMENT
Environment variables can be used within an automount map. For
instance, if $HOME appeared within a map, automount would expand it to
its current value for the $HOME variable.
Enclose the variable name within braces if it is followed by further
characters other than blanks.
USAGE
Direct/indirect map entry format
A simple map entry (mapping) takes the form:
directory [-mount-options] resource ...
where directory is the full pathname of the directory to mount when
used in a direct map, or the basename of a subdirectory in an indirect
map. mount-options is a comma-separated list of mount options, and
resource specifies a remote file system from which the directory may
be mounted. In the simple case, resource takes the form:
host:pathname
Multiple resource fields can be specified, in which case automount
sends multiple mount requests; automount mounts the file system from
the first host that replies to the mount request.
If resource is specified in the form:
host:path:subdir
host is the name of the host 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
can be used to prevent duplicate mounts when multiple directories in
the same remote file system may be accessed. With a map for /home such
as:
able homeboy:/home/homeboy:able
baker homeboy:/home/homeboy:baker
Page 3 Reliant UNIX 5.44 Printed 11/98
automount(1M) automount(1M)
and a user attempting to access a file in /home/able, automount mounts
homeboy:/home/homeboy, but creates a symbolic link called /home/able
to the able subdirectory in the temporarily mounted file system. If a
user immediately tries to access a file in /home/baker, automount
needs only to create a symbolic link that points to the baker sub-
directory; /home/homeboy is already mounted. With the following map,
automount would have to mount the file system twice:
able homeboy:/home/homeboy/able
baker homeboy:/home/homeboy/baker
A mapping can be continued across input lines by escaping the NEWLINE
with a backslash. Comments begin with a # and end at the subsequent
NEWLINE.
Directory pattern matching
The & character is expanded to the value of the directory field for
the entry in which it occurs. In this case:
able homeboy:/home/homeboy:&
the & expands to able.
The * character, when supplied as the directory field, is recognized
as the catch-all entry. Such an entry resolves to any entry not previ-
ously matched. For instance, if the following entry appeared in the
indirect map for /home:
* &:/home/&
this would allow automatic mounts in /home of any remote file system
whose location could be specified as:
hostname:/home/hostname
Hierarchical mappings
A hierarchical mapping takes the form:
directory [[subdirectory]] [-mount-options] resource ... \
[[subdirectory] [-mount-options] resource ...] ...
The initial /[subdirectory] is optional for the first resource list
and mandatory for all subsequent lists. The optional subdirectory is
taken as a filename relative to the directory. If subdirectory is
omitted in the first occurrence, the / refers to the directory itself.
Page 4 Reliant UNIX 5.44 Printed 11/98
automount(1M) automount(1M)
Given the direct map entry:
/arch/src \
/ -ro,intr host1:/arch/src host2:/arch/src \
/1.0 -ro,intr host2:/arch/src/1.0 host1:/arch/src/1.0 \
/1.0/man -ro,intr host1:/arch/src/1.0/man host2:/arch/src/1.0/man
automount would automatically mount /arch/src, /arch/src/1.0 and
/arch/src/1.0/man, as needed, from either host1 or host2, whichever
host responded first. This directory structure must be available on
the local system.
Direct maps
A direct map 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 allows you to specify mappings for the subdirectories
you wish to mount under the directory indicated on the command line.
Local subdirectories for which no mapping entry is specified are not
visible during mounting. Every mountpoint field in an indirect map
comprises the relative pathname of a subdirectory which is to be
mounted as required.
Included maps
The contents of another map can be included within a map with an entry
of the form
+mapname
where mapname is a filename.
Special maps
-null The -null map, when indicated on the command line, cancels a
previous map for the directory indicated.
-hosts If -hosts is used as the name of a map, pathnames following
the directory specified are treated as host names. If a path-
name of this type is used, the automounter queries what
resources are available from the specified host, mounts them
under the mount point /tmpmnt/net/hostname and generates a
symbolic link as usual between /net/hostname and
/tmpmnt/net/hostname.
Page 5 Reliant UNIX 5.44 Printed 11/98
automount(1M) automount(1M)
NOTES
When it receives signal number 1 (kill -1), automount rereads the
/etc/mnttab file to update its internal record of currently-mounted
file systems. If a file system mounted with automount is unmounted by
a umount command, automount should be forced to reread the file.
Shell filename expansion does not apply to objects not currently
mounted.
Since automount is single-threaded, any request that is delayed by a
slow or non-responding NFS server will delay all subsequent automatic
mount requests until it completes.
If automount is terminated with signal number 9, the directories moni-
tored by automount remain inconsistent and can then no longer be
accessed. The directories only become accessible again by calling
automount once more with the same parameters: automount then performs
a recovery. The recovery information required here is stored in the
kernel and in the /tmp/automount.pid file when automount is started,
where pid refers to the automount process number.
FILES
/tmpmnt
parent directory for dynamically mounted file systems
/tmp/automount.pid
recovery information
SEE ALSO
df(1), mount(1M-nfs), passwd(4).
Page 6 Reliant UNIX 5.44 Printed 11/98