automount(1M) automount(1M)
NAME
automount - automatically mount NFS file systems
SYNOPSIS
/usr/lib/nfs/automount [-mnTv] [-D name=value] [-M mount-directory]
[-f master-file] [-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 file system.
automount uses a map to locate an appropriate NFS file server,
exported file system, and mount options, for an automatically
mounted resource. It then mounts the file system in a
temporary location (/tmp_mnt), 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 an appropriate interval (five minutes by default), the
daemon unmounts the file system and removes the symbolic link.
If the indicated directory (/tmp_mnt) has not already been
created, the daemon creates it, and then removes it upon
exiting.
Files
/etc/auto.master default master map file
/tmp_mnt default parent directory for dynamically
mounted file systems
USAGE
You can assign a map to a directory using an entry in a direct
automount map, by specifying a master-map on the command line,
or by specifying an indirect map.
If you specify the dummy directory /-, 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 a file called an indirect map. An indirect map
contains a list of the subdirectories contained within the
indicated directory. With an indirect map, it is these
Copyright 1994 Novell, Inc. Page 1
automount(1M) automount(1M)
subdirectories that are mounted automatically. The map
argument must be a full pathname.
You can modify the automounter maps at any time. However,
observe the following when doing so:
master map Changes and additions will not take effect
until you kill and restart the
automounter.
direct map You can modify entries in this map but
cannot add to it. If you add entries,
these entries will not become visible
until you restart the automounter.
indirect map You can change and add entries in this map
without having to restart the automounter.
The -mount-options argument, when supplied, is a comma-
separated list of mount(1M) options, preceded by a hyphen (-).
If mount options are specified in the indicated map, however,
those in the map take precedence.
Only a privileged user can execute this command.
Options
automount takes the following options:
-m Disable the search of the Network Interface Services map
file. This option can only be used in conjunction with
the -f option.
-n Disable dynamic mounts. With this option, references
through the automount daemon only succeed when the
target file system 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 messages to the console.
-D name=value
Assign value to the indicated automount (environment)
variable.
Copyright 1994 Novell, Inc. Page 2
automount(1M) automount(1M)
-f master-file
Specify all arguments in master-file and instruct the
daemon to look in it for instructions.
-M mount-directory
Mount temporary file systems in the named directory,
instead of /tmp_mnt.
-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 file systems that have exceeded their
cached times. The default is 1 minute.
Environment Variables
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.
If a reference needs to be protected from affixed characters,
enclose the variable name within braces.
Direct/Indirect Map Entry Format
A simple map entry (mapping) takes the form:
directory [-mount-options] location . . .
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 location specifies a remote file system
from which the directory may be mounted. In the simple case,
location takes the form:
host:pathname
Copyright 1994 Novell, Inc. Page 3
automount(1M) automount(1M)
Replicated File Systems
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 may
respond.
If location 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 homebody:/home/homebody:able
baker homebody:/home/homebody:baker
and a user attempting to access a file in /home/able,
automount mounts homebody:/home/homebody, 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 subdirectory;
/home/homebody is already mounted. With the following map:
able homebody:/home/homebody/able
baker homebody:/home/homebody/baker
automount would have to mount the file system twice.
Requests for a server may be weighted by appending an integer
weighing factor, within parenthesis, to the server name. The
higher the weighing factor value, the lower the chance that
the server will be selected. Servers for which no weighing
factor is specified are assumed to have a value of zero (most
likely to be selected). In the example:
able -ro alpha,bravo,charlie(1),delta(4):/usr/man
hosts alpha and bravo have the highest selection priority,
while host delta has the lowest.
Copyright 1994 Novell, Inc. Page 4
automount(1M) automount(1M)
Note that server proximity takes priority over weighing
factors during server selection. In the example above, if the
server delta is on the same network segment as the client, and
the other servers reside on other network segments, then
automount would select delta (ignoring delta's high weighing
factor). In cases where servers have the same network
proximity, their weighing factors are taken into account
during selection.
In cases where each server has a different export point, you
can still assign weighing factors. For example:
able -ro alpha:/usr/man bravo,charlie(1):/usr/share/man\
delta(4):/export/man
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.
Map Key Substitution
The & character is expanded to the value of the directory
field for the entry in which it occurs. In this case:
able homebody:/home/homebody:&
the & expands to able.
Wildcard Key
The * character, when supplied as the directory field, is
recognized as the catch-all entry. Such an entry resolves to
any entry not previously 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] location . . .
[/[subdirectory] [-mount-options] location . . . ] . . .
Copyright 1994 Novell, Inc. Page 5
automount(1M) automount(1M)
The initial /[subdirectory] is optional for the first location
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.
Given the direct map entry:
/arch/src \
/ -ro,intr arch:/arch/src alt:/arch/src \
/1.0 -ro,intr alt:/arch/src/1.0 arch:/arch/src/1.0 \
/1.0/man -ro,intr arch:/arch/src/1.0/man alt:/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 arch 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.
Note that the 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 a ls
-l of the directory.
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
The -null map is the only special map currently available.
The -null map, when indicated on the command line, cancels a
Copyright 1994 Novell, Inc. Page 6
automount(1M) automount(1M)
previous map for the directory indicated.
Warnings
automount must not be terminated with the SIGKILL signal (kill
-9). Without an opportunity to unmount itself, automount's
mount points will appear to the kernel as belonging to a non-
responding NFS server. The recommended way to terminate
automount services is to send a SIGTERM (kill -15, the default
signal) to the daemon. This allows the automounter to catch
the signal, and to unmount not only the mount points
associated with its daemon, but also to unmount any mounts in
/tmp_mnt. Note that any mounts in /tmp_mnt that are busy will
not be unmounted.
Mount points used by automount are not recorded in
/etc/mnttab. mount(1M) on such mount points will fail, saying
mount point busy, although the mount point is not in
/etc/mnttab.
Shell filename expansion does not apply to objects not
currently mounted.
REFERENCES
df(1M), mount(1M_NFS), passwd(4)
the chapter ``Using the NFS Automounter'' of part ``NFS
Administration'' of the book Network Administration
Copyright 1994 Novell, Inc. Page 7