NFS Services Administrator's Guide
Configuring and Administering NFS
Configuring and Administering AutoFS
Chapter 2114
To Use Wildcard Characters as Shortcuts in
Automounter Maps
1. Use the asterisk (*) in an indirect map as a wildcard character to
represent the local subdirectory, when you want the local
subdirectory to be the same as the remote system name or the
remote subdirectory.
2. Use the ampersand (&) in a direct or indirect map as the remote
system name or the remote subdirectory. Whatever is in the local
directory name field will replace the ampersand. If you have used an
asterisk to represent the local subdirectory, whatever replaces the
asterisk (*) in the local subdirectory field also replaces the
ampersand (&) in the remote system name or remote subdirectory
field.
You cannot use the asterisk (*) wildcard in a direct map.
The following example automounts users’ home directories. The home
directories are physically located on NFS server basil, under the remote
directory /export/home. On the local NFS client, the home directories
will be mounted under /home.
Following is the line from the automounter master map
/etc/auto_master that lists the indirect map /etc/auto_home.
# /etc/auto_master file
# local mount point map name mount options
/home /etc/auto_home -nosuid
Following is the line from the automounter indirect map
/etc/auto_home that mounts users’ home directories on demand.
# /etc/auto_home file
# local mount point mount options remote
server:directory
* basil:/export/home/&
A user’s home directory is configured in the /etc/passwd file as
/home/username. For example, the home directory of user terry is
/home/terry. When Terry logs in, AutoFS looks in 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 server basil to /home/terry on the local NFS client.