NFS Services Administrator's Guide (B.11.31.02) January 2008

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.
If you are using NIS to manage AutoFS maps, add the previous entry to the master map file
on the NIS master server. Rebuild the map and push it out to the slave servers. For more
information on NIS and NIS maps, see the NIS Administrator’s Guide (5991-7656). If you are
using LDAP, add the entry to the LDAP directory.
2. On each host that uses the map you modified, enter the following command to force AutoFS
to read the modified map:
/usr/sbin/automount
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.
74 Configuring and Administering AutoFS