automount(8) CLIX automount(8)
NAME
automount - Automatically mounts NFS file systems
SYNOPSIS
automount [-mnTv] [-D envar=value] [-f master_file] [-M mount_dir] [-tl
duration] [-tm interval] [-tw interval] [directory map [-mount_options]]
...
FLAGS
-D envar=value
Assigns value to the specified automount environment variable
(envar).
-f master_file
Reads a local file for initialization, ahead of the auto.master NIS
map.
-m Suppresses initialization of directory-map pairs listed in the
auto.master Network Information Services (NIS) database.
-M mount_dir
Mounts temporary file systems to the mount_dir directory, instead
of to /tmp_mnt.
-n Disables dynamic mounts. With this flag, 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.
-tl duration
Specifies a duration, in seconds, that a file system is to remain
mounted when not in use. The default is 5 minutes.
-tm interval
Specifies an interval, in seconds, between attempts to mount a
filesystem. The default is 30 seconds.
-tw interval
Specifies an interval, in seconds, between attempts to unmount
filesystems that have exceeded their cached times. The default is
1 minute.
-T Turns on tracing. Expands each NFS call and displays it on the
standard output.
-v Turns on verbose mode. Logs status messages to the console.
DESCRIPTION
2/94 - Intergraph Corporation 1
automount(8) CLIX automount(8)
The automount command 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 file system. You can
assign a map to a directory using an entry in a direct automount map, or
by specifying an indirect map on the command line.
The automount daemon appears to be an NFS server to the kernel. 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 certain time (five minutes by
default), the daemon unmounts the file system and removes the symbolic
link. If the specified directory has not already been created, the daemon
creates it, and then removes it upon exiting.
Since the name-to-location binding is dynamic, updates to an automount map
are transparent to the user. This makes it unnecessary to pre-mount
shared file systems for applications that have hard-coded references to
files. If you specify the dummy directory o-, automount treats the map
argument 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.
A map can be a file or a Network Information Services map; if a file, the
map argument must be a full pathname.
The -mount_options argument, when supplied, is a comma-separated list of
NFS mount options, preceded by an ``m.'' If mount options are specified in
the indicated map, however, those in the map take precedence.
USAGE
The following sections decribe the usage of the automount command.
Map Entry Format
A simple map entry (mapping) takes the following form 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. The mount_options
parameter is a comma-separated list of NFS mount options, and location
specifies a remote filesystem from which the directory can be mounted.
directory [ -mount_options ] location ...
2 Intergraph Corporation - 2/94
automount(8) CLIX automount(8)
In the simple case, location takes the form:
host:pathname
Multiple location 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. This request is first made to the
local net or subnet. If there is no response, any connected server can
respond.
The location can be specified in the following form where 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.
host:path:subdir
This format can be used to prevent duplicate mounts when multiple
directories in the same remote file system can be accessed. Consider the
following example:
able homeboy:/home/homeboy:able
baker homeboy:/home/homeboy:baker
With a map for /home such as this one 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 filesystem. 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 subdirectory; /home/homeboy is already mounted. With
the following map automount would have to mount the filesystem 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 number sign (#) and end at the
subsequent NEWLINE.
Directory Pattern Matching
The ampersand (&) character is expanded to the value of the directory
field for the entry in which it occurs. In the following case the
ampersand expands to able.
able homeboy:/home/homeboy:&
The asterisk (*) character, when supplied as the directory field, is
recognized as the catch-all entry. Such an entry resolves to any entry
2/94 - Intergraph Corporation 3
automount(8) CLIX automount(8)
not previously matched. For instance, consider the following example:
* &:/home/&
If this entry appeared in the indirect map for /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 following form:
directory [ /[subdirectory [ -mount_options ] location ... ] ...
The initial slash (/) within the `/[subdirectory]' is required; 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.
Consider the following 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/locann
In this example automount would automatically mount /usr/local,
/usr/local/bin and /usr/local/man, as needed, from either loco or alt,
whichever host responded first.
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. It also
obscures local subdirectories for which no mapping is specified. In an
indirect map, each directory field consists of the basename of a
subdirectory to be mounted as needed.
Included Maps
The contents of another map can be included within a map with an entry of
the form:
4 Intergraph Corporation - 2/94
automount(8) CLIX automount(8)
+mapname
The mapname parameter can either be a filename, or the name of a NIS map,
or one of the special maps described below. All three map types, (master,
direct, and indirect) can include an NIS map. Only the indirect map can
include local maps and built-in maps.
Special Maps
There are three special maps currently available: -hosts, -passwd and -
null. The -hosts map uses the hostname resolution facilities available on
the system to locate a remote host when the hostname is specified. 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 -passwd map uses the passwd 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 for a user has the form /dir/server/username,
and server matches the host system on which that directory resides,
automount will mount the user's home directory as: /homes/username.
For this map, the tilde character (~) is recognized as a synonym for the
username.
The -null map, when indicated on the command line, cancels a previous map
for the directory indicated. It can be used to cancel a map given in
auto.master.
Configuration and the auto.master Map
The automount command 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 mappings; unless the -f flag is in effect, automount does not look
for an auto.master file on the local host.
Maps given on the command line, or those given in a local auto.master file
specified with the -f flag override those in the NIS auto.master map. For
instance, given the command:
2/94 - Intergraph Corporation 5
automount(8) CLIX automount(8)
automount -f /etc/auto.master /home -null /- /etc/auto.direct
and a file named /etc/auto.master that contains the following:
/homes -passwd
automount would mount home directories under /homes instead of /home, in
addition to the various directories specified in the /etc/auto.direct
file.
Environment
Environment variables can be used within an automount map. For instance,
if one appeared within a map, automount would expand it to its current
value for the variable.
If a reference needs to be protected from affixed characters, you can
surround the variable name with braces ({}).
FILES
/tmp_mnt
Directory under which filesystems are dynamically mounted.
/etc/auto.master
List of master NIS configuration maps.
/etc/auto.direct
List of direct automounter maps.
/etc/auto.indirect
List of indirect automounter maps.
NOTES
When it receives signal number 1, SIGHUP, 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 with the
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.
Programs that read /etc/mnttab and then touch files that reside under
automatic mount points will introduce further entries to the file.
RELATED INFORMATION
6 Intergraph Corporation - 2/94
automount(8) CLIX automount(8)
Commands: df(1), mount(8)
Files: passwd(4)
2/94 - Intergraph Corporation 7