Using multiple direct mounts
You can mount multiple remote filesystems
to a single local directory with a direct mount configuration.
This section compares the two ways
in which you can configure direct multiple mounts with an
analogous indirect mount.
Figure 13-2, ``An example of indirect mounting using automount'',
illustrates an indirect mount where two filesystems, each from
a different server, are mounted under a single parent directory.
In this indirect mount, each of the remote filesystems is mounted
only when that remote filesystem is accessed.
Further, if you access one directory, causing it to be mounted,
and then try to cd to the other using a relative path, the system
will not find or mount the other directory. For example:
cd /doc_tools/spellers
cd ../roff
../roff: No such file or directory
To reach /doc_tools/roff would require:
cd /doc_tools/roff
If you access /doc_tools/roff before executing cd ../roff, with the ls command for example, then /doc_tools/roff gets mounted and you can reach it using a relative path.
Here is an example showing one way in which you could mount the same two remote filesystems under a single parent, but using a direct mount configuration:
/doc_tools/spellers -r,soft madrid:/doc.stuff/spellers /doc_tools/roff -r,soft oslo:/doc/bin/roffLike the indirect mount configuration, each of the remote filesystems here is mounted separately and only when that remote filesystem is accessed. With this configuration, if you access one directory, causing it to be mounted, and then try to cd to the other using a relative path, automount will mount the other filesystem and place the user in the desired directory if the user is running ksh. If the user is not running ksh, the system will not find or mount the other directory, as in the indirect map configuration.
Here is an example showing a second way in which you can mount the same two remote filesystems under a single parent, but using a single direct configuration.
/doc_tools \ /spellers -r,soft madrid:/doc.stuff/spellers \ /roff -r,soft oslo:/doc/bin/roffWith this configuration, both filesystems are mounted if either one is accessed. Because both filesystems are always mounted at the same time, a cd using a relative path between the two filesystems will work regardless of the shell being used. Note that the syntax of this configuration differs from the direct map syntax shown in ``About automount maps''. The parent directory appears on the first line with a ``\'' indicating a continued entry. Each subsequent line contains a mount point (that begins with a slash), options, and a location. Redundant locations can be specified as described in ``Specifying redundant servers''.
This ``unified mount'' has these advantages over the previous direct mount example:
The above examples show remote filesystems residing on different servers. The above examples would still be valid if all remote filesystems were from the same server or there were more than two remote filesystems being mounted and all were from different servers.
If unified direct mounts share the same options, it is not necessary to duplicate these options for each server. Rather, the options can precede the different mounts:
/doc_tools -r,soft \ /spellers madrid:/doc.stuff/spellers \ /roff oslo:/doc/bin/roffIf one of the mount points needs a different specification, modify only its options:
/doc_tools -r,soft \ /spellers -rw madrid:/doc.stuff/spellers \ /roff oslo:/doc/bin/roff
A special case of multiple direct mounts occurs when the root of a filesystem has to be mounted as well. This is called a ``hierarchical'' mount. A true hierarchical mount might be:
/usr/local \ / prague:/usr/local \ /bin -r,soft tokyo:/usr/local/bin \ /src -r milan:/usr/local/src