NFS Services Administrator's Guide (B.11.31.04) March 2009
The following line from the /etc/auto_home indirect map mounts the user's home
directories on demand:
# /etc/auto_home file
# local mount-point mount options remote server:directory
* basil:/export/home/&
The user's home directory is configured in the /etc/passwd file as /home/username.
For example, the home directory of the user terry is /home/terry. When Terry logs
in, AutoFS looks up the /etc/auto_home map and substitutes terry for both the
asterisk and the ampersand. AutoFS then mounts Terry’s home directory from
/export/home/terry on the server, basil, to /home/terry on the local NFS client.
You can use the ampersand character to represent both the remote server and the
remote subdirectory, in the same line of the indirect map. For example, if the user’s
home directory is physically located on many different servers, but the directory under
which the home directory is located is called /export/home/servername on all the
servers, the following line in the /etc/auto_home map mounts all the user's home
directories from any server:
* &:/export/home/&
If the home directory of the user terry is configured in the /etc/passwd file as
/home/basil/terry, AutoFS mounts the remote directory /export/home/basil
from the server, basil, on the local directory /home/basil when Terry logs in.
The line with the asterisk must 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. If asterisk (*) matches any subdirectory, AutoFS stops reading at the line
with the asterisk.
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 the host, basil. If the
asterisk is a match for charlie, 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 mounts Charlie’s home directory from host thyme and other home directories
from host basil.
Automounting Home Directories
To automount users’ home directories, follow these steps:
1. Ensure that the systems where the users’ home directories are located are set up
as NFS servers and are exporting the home directories. For more information on
Automounting Home Directories 89