NFS Services Administrator's Guide (B.11.31.04) March 2009
Notes on the -hosts Map
The -hosts map is a built-in AutoFS map. It enables AutoFS to mount exported
directories from any NFS server found in the hosts database, whenever a user or a
process requests access to one of the exported directories from that server.
CAUTION: You may inadvertently cause an NFS mount over X.25 or SLIP, which is
unsupported, or through a slow router or gateway, because the -hosts map allows
NFS access to any reachable remote system. Mounts over slow links can cause excessive
retransmissions and degrade the performance for all users.
When a user or a process requests a directory from an NFS server, AutoFS creates a
subdirectory named after the NFS server, under the local mount-point you configured
in the AutoFS master map. (The conventional mount-point for the -hosts map is
/net). AutoFS then mounts the exported directories from that server. These exported
directories are now accessible.
The -hosts map is an indirect map. It uses the hosts database (the /etc/hosts file,
the NIS hosts map, LDAP, or BIND [DNS]) to discover the host on the network. The
NSS configuration determines which name services to search for host information. For
more information on configuring the NSS, see nsswitch.conf(4).
For example, if the server, Basil exports /opt and /apps, and a user on your NFS
client enters the following command:
cd /net/basil/opt/frame
the subdirectory, /basil is created under /net, and /opt is mounted under /basil.
Figure 3-8 shows the automounted file structure after the user enters the command.
Figure 3-8 Automounted Directories from the -hosts Map—One Server
In the following example, the server thyme exports the directory /exports/proj1,
and a user enters the following command:
more /net/thyme/exports/proj1/readme
The subdirectory /thyme is created under /net, and /exports/proj1 is mounted
under /thyme.
92 Configuring and Administering AutoFS