NFS Services Administrator's Guide

Configuring and Administering AutoFS
Automounting All Exported Directories from Any Host Using the -hosts Map
Chapter 3 127
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 or shared directories from that server. These
exported or shared directories can now be accessed. Directories stay
mounted until they remain left idle for 10 minutes. You can change the
default value by adding the -t
duration
option to the
AUTOMOUNT_OPTIONS variable in the /etc/rc.config.d/nfsconf file, or
by running the automount command with the -t option from the
command line.
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 find a
host on the network. The Name Service Switch configuration determines
which name services to search for host information. For more
information on configuring the name service switch, see nsswitch.conf
(4).
For example, if the server, sage exports /opt and /apps, and a user on
your NFS client enters the following command:
cd /net/sage/opt/frame
the subdirectory /sage is created under /net, and /opt is mounted
under /sage.
Figure 3-6 shows the automounted file structure after the user runs the
command.
Figure 3-6 Automounted Directories from the -hosts Map—One Server
In the following example, the server, thyme exports or shares the
directory /exports/proj1, and a user enters the following command:
more /net/thyme/exports/proj1/readme
/net
/sage
/opt