|
|
automount uses a map to locate an appropriate NFS file server, exported filesystem, and mount options, for an automatically mounted resource. It then mounts the filesystem in a temporary location (/tmp_mnt), and replaces the filesystem entry for the directory or subdirectory with a symbolic link to the temporary location. If the filesystem is not accessed within an appropriate interval (five minutes by default), the daemon unmounts the filesystem 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.
If a reference needs to be protected from affixed characters, enclose the variable name within braces.
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
If location is specified in the form:
host:path:subdirhost 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 filesystem may be accessed. With a map for /home such as:
able homebody:/home/homebody:able baker homebody:/home/homebody:bakerand 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 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/homebody is already mounted. With the following map:
able homebody:/home/homebody/able baker homebody:/home/homebody/bakerautomount would have to mount the filesystem 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/manhosts alpha and bravo have the highest selection priority, while host delta has the lowest.
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/manA mapping can be continued across input lines by escaping the NEWLINE with a backslash. Comments begin with a ``#'' and end at the subsequent NEWLINE.
able homebody:/home/homebody:&the ``&'' expands to able.
&:/home/&this would allow automatic mounts in /home of any remote file system whose location could be specified as:
hostname:/home/hostname
directory [/[subdirectory]] [-mount-options] location . . . [/[subdirectory] [-mount-options] location . . . ] . . .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/manautomount 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.
This is a deliberate policy to avoid inadvertent mounting of every entry in a map via a ls -l of the directory.
then a reference to /net/hermes/usr would initiate an automatic mount of all filesystems from hermes that automount can mount; references to a directory under /net/hermes will refer to the corresponding directory on hermes.
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.
+mapnamein the automounter map on the NIS client, where mapname is the name of the NIS map to be included at that point in the automounter map.
For example, to include the contents of the map auto.master on the NIS master server within the automounter master map on an NIS client, add an entry that specifies
+auto.masterin the /etc/auto.master file on the NIS client. To include the contents of the NIS map auto.home, add an entry that specifies
+auto.homein the /etc/auto.home file on the NIS client.
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 filesystem 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 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:
Changes and additions will not take effect until you kill and restart the automounter.
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.
You can change and add entries in this map without having to restart the automounter.
Only a privileged user can execute this command.
Mount points used by automount are not recorded in /etc/mnttab. mount(NADM) 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.