The automount facility contains three components
The AutoFS FS
The automountd daemon
The automount command
The AutoFs map types
Master Map The auto_master map associates a directory, also called a mount point, with a map.
Direct Map Lists the mount points as absolute path names. This map explicitly indicates
the mount point on the client.
Indirect Map Lists the mount points as relative path names. This map uses a relative path to
establish the mount point on the client.
Special Provides access to NFS servers by using their host names
# cat /etc/auto_master
/net -hosts -nosuid,nobrowse
/home auto_home -nobrowse
Mount point map name(direct or indirect map) mount options(similar to standard mount options. But nobrowse option is an AutoFS specific mount option
The plus(+) symbol at th beginning of the +auto_maser line directs the automountd daemon to look at the NIS, NIS+, or LDAP databases before it reads the rest of the map. If this line is commented out, only the local files are searched unless the /etc/nsswitch.conf file specifies that NIS, NIS+, or LDAP should be searched.
The two mount points for special maps are –hosts map & -xfn map
The –hosts map Provide access to all resources shared by NFS servers. The resources being shared by a server are mounted below the /net/hostname directory, or if only the server’s IP address is known below the /net/IPaddress directory. The server doesn’t have to be listed in the hosts database for this mechanism to work.
The –xfn map Provides access to resources acailable through the Federated Naming Service (FNS). Resources associated with FNS mount below the /xfn directory
# cat /etc/auto_master
/- auto_direct -ro
The /- mount point is a pointer that informs the automount facility that the full path names are defined in the file specified by map-name(the /etc/auto_direct file in this example)
# cat /etc/auto_direct
# Super User created direct map for automounter
/apps/frame -ro,soft server1:/export/framemaker
/opt/local -ro,soft server2:/export/unbundled
/usr/share/man -ro,soft server3,server4:/usr/share/man
The /home entry defines a mount point for an indirect map. The map auto_home list relative path names only. The Solaris 2.6 through Solaris 9 OE support browsing of indirect maps and special maps with the –browse option. The –nobrowse option disables the browsing of indirect maps. The default option is –browse
# cat /etc/auto_home
Reducing the auto_home map to a single line
The client remotely mont the /export/home/loginID directory from the NFS server server1 onto the local mount point /home/loginID. Wildcard character(*) to match any key. The substitution character (&) at the end of the location is replaced with the matched key field.
Run the automount command when making changes to the master map or creating a direct map to make the changes effective. You do not have to stop and restart the automountd daemon after making changes to existing entries in a direct map.
Automount [-t duration] [-v]
-t Specifies a time in seconds, the FS remains mounted when not in use. Default is 600 sec.
When to run the automount command
Automount Map Run if entry is added/deleted Run if entry is modified
Master map yes yes
Direct map yes no
Indirect map no no
# cat /etc/mnttab
-hosts /net autofs indirect,nosuid,ignore,nobrowse dev=4300001|1008255810
# /etc/init.d/autofs start (or) stop