In addition to using the form server:pathname to specify a location in a map entry, you can also specify a subdirectory in the location field, using the syntax server:pathname:directory. For a detailed example of the use of subdirectories, refer to ``Example: specifying subdirectories''.
In general, it's a good idea to provide a subdirectory entry in the location field when different map entries refer to the same resource shared by the same server. Where many subdirectories are specified within a single map, you can use substitutions as a form of entry shorthand: see ``Using substitutions'' for details.
Assume you have a master map on host oak that contains the following entry:
/home /etc/auto.home -rw, intr, secureHere, /etc/auto.home is the name of an indirect map that contains the entries to be mounted under /home.
Following is the auto.home map:
#key mount-options locationLook at the first entry in the map, and assume user adam has his home directory on host cypress. If adam has an entry in host oak's password database specifying his home directory as /home/cypress/adam, then he can log in to oak and the automounter will mount (as /tmp_mnt/home/cypress) the directory /home/cypress residing on cypress. If one of the directories is adam, then adam will be in his home directory. Because of the options specified in oak's master map, adam's home directory is mounted read/write, interruptible, and secure.
cypress cypress:/home/cypress poplar poplar:/home/poplar pine pine:/export/pine apple apple:/export/home ivy ivy:/home/ivy peach -rw,nosuid peach:/export/home john willow:/home/willow:john mary willow:/home/willow:mary joe willow:/home/willow:joe
Now look at the last three entries in the indirect map. Note that these entries refer to the same resource on the same host (/home/willow). They also specify subdirectories in the location field (john, mary, and joe).
Now when a user logs in to host oak and requests access to the home directory john on host willow, the automounter mounts willow:/home/willow. It then places a symbolic link between /tmp_mnt/home/willow/john and /home/john.
If user mary then tries to access her home directory from host oak, the automounter sees that willow:/home/willow is already mounted, so all it has to do is return the link between /tmp_mnt/home/willow/mary and /home/mary.