NFS Services Administrator's Guide (762805-001, March 2014)

Example of automounting a user’s home directory
User Howard’s home directory is located on the NFS server, basil, where it is called
/export/home/howard. Each client in the network has the following entry in the /etc/passwd
file on all the systems in the network:
howard:*:700:70:Howard:/home/howard:/usr/bin/ksh
When Howard logs in to any NFS client, AutoFS recognizes /home as an AutoFS mount-point,
because it is configured in the master map, as follows:
/home auto_home
AutoFS reads the auto_home map to find out how to mount Howard’s home directory. It finds the
following line:
howard basil:/export/home/& -nosuid
AutoFS substitutes howard for the ampersand (&) character in that line:
howard basil:/export/home/howard -nosuid
AutoFS mounts /export/home/howard from server basil to the local mount-point
/home/howard on the NFS client. Figure 12 illustrates this configuration.
Figure 12 Home Directories Automounted with Wildcards
Special maps
There are two types of special maps: -hosts and -null.
By default, the -hosts map is used with the /net directory and assumes that the map entry is
the hostname of the NFS server. The automountd daemon dynamically creates a map entry from
the server's list of exported filesystems. For example, a reference to /net/Casey/usr initiates
an automatic mount of all the exported filesystems from Casey which can be mounted by the client.
References to the directory under /net/Casey refers to the corresponding directory relative to
the root directory of Casey.
The -null map, when included in a map entry, cancels a map for the directory indicated. This
is especially useful in the AutoFS master map, /etc/auto_master, for cancelling entries that
would otherwise be inherited from the +auto_master include entry. To be effective, the -null
entry must be inserted before the included map entry. For information on how to include a map in
another map, see “Including a map in another map” (page 73).
Automounting all exported directories from any host using the -hosts map
To automount all exported directories using the -hosts map, follow these steps:
1. If you are using local files for AutoFS maps, use an editor to add the following entry to the
/etc/auto_master master map file:
/net -hosts -nosuid,soft,nobrowse
NOTE: The nobrowse option in the local default master map file for a newly installed system
is specified for the /net map.
68 Configuring and administering AutoFS