NFS Services Administrator's Guide

Configuring and Administering NFS
Configuring and Administering AutoFS
Chapter 2 115
The ampersand character can be used to represent both the remote
server and the remote subdirectory, in the same line of the indirect map.
For example, if users’ home directories are physically located on many
different servers, but the directory under which the home directories are
located is called /export/home/servername on all the servers, the
following line in the /etc/auto_home map will mount all users’ home
directories from any server:
* &:/export/home/&
If the home directory of user terry is configured in the /etc/passwd file
as /home/basil/terry, when Terry logs in, AutoFS will mount the
remote directory /export/home/basil from server basil on the local
directory /home/basil.
The line with the asterisk and ampersand should be the last line in an
indirect map. AutoFS reads the lines in the indirect map sequentially
until it finds a match for the requested local subdirectory. The asterisk
(*) matches any subdirectory, so AutoFS stops reading at the line with
the asterisk, because it has found a match. Any lines after the asterisk
are never read.
For example, if the /etc/auto_home map contains the following lines,
* basil:/export/home/&
charlie thyme:/export/home/charlie
AutoFS attempts to mount /export/home/charlie from host basil.
The asterisk is a match for charlie, so AutoFS looks no further and
never reads the second line. However, if the /etc/auto_home map
contains the following lines,
charlie thyme:/export/home/charlie
* basil:/export/home/&
AutoFS will mount Charlie’s home directory from host thyme and
everyone else’s home directory from host basil.
For more information on AutoFS configuration, type man 1M automount
at the HP-UX prompt.