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.
An autonfsmount map is composed of a list of mappings, with one mapping per line. Each mapping is composed of the following fields:
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:
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:
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.
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:
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:
and hermes is in the mounts database as follows:
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:
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.
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/ :