up | Inhaltsverzeichniss | Kommentar

Manual page for AUTOMOUNT(8)

autonfsmount - automatically mount NFS file systems

SYNOPSIS

autonfsmount [ -mnT ] [ -tl duration ] [ -tm interval ] [ -tw interval ] [ -a directory ]
          [ directory mapname [ -mount-options ] ] ...

DESCRIPTION

autonfsmount is a daemon that will automatically and transparently mount an NFS file system whenever a file or directory within that system is opened. autonfsmount 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, a Yellow Pages map or some special "maps" which are hardwired into autonfsmount itself. directory is a full pathname starting with a `/'.

When supplied, -mount-options consists of the leading - and a comma-separated 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 Yellow Pages 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

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

An autonfsmount 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 autonfsmount 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 YP 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 two special maps currently available. The -hosts map uses the Yellow Pages 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 autonfsmount command is already in effect:

autonfsmount /net -hosts

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

The -fstab special map uses the mounts database (fstab(5)) 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 in the mounts database. The advantage of -fstab over -hosts is that you can list the available servers and also leverage off of the mount options available in the familiar fstab(5) format. Note that for autonfsmount to pick up entries in the mounts database, the entries must have the fstab(5) "net" option and also must have a mount point identical to that of autonfsmount. For instance, if the following autonfsmount command is already in effect:

autonfsmount /Net -fstab

and hermes is in the mounts database as follows:

hermes:/usr /Net nfs rw,net 0 0

then a reference to /Net/hermes/usr would initiate an automatic mount of all file systems from hermes that autonfsmount can find in the mounts database; references to a directory under /Net/hermes will refer to the corresponding directory on hermes.

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

autonfsmount /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

autonfsmount normally consults the auto.master Yellow Pages 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 autonfsmount command, rather than mappings, and that autonfsmount 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 Yellow Pages database.
-n
Disable dynamic mounts. With this option, references through the autonfsmount 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.
-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 file system. The default is 30 seconds.
-tw interval
Specify an interval, in seconds, between attempts to dismount file systems that have exceeded their cached times. The default is 1 minute.
-a directory
Specify an alternate directory for the actual mounts performed by autonfsmount. The default is /tmp_mnt.

EXAMPLE

tutorial# autonfsmount -m /net -hosts

Provide autonfsmount access to the exported file systems of any host in the Yellow Pages hosts.byname database, by prefixing the pathname with /net/hostname/ :

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

FILES

/tmp_mnt
directory under which file systems 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. However, the special map -fstab does not suffer from this bug.


index | Inhaltsverzeichniss | Kommentar

Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97