Previous Table of Contents Next


How the Automounter Works

These sections provide an overview of how the automounter works. When a system is booted, the automounter daemon is started from the /etc/init.d/nfs.client script. With Solaris 2.3 system software and later, the boot procedure is split into two programs: an automount command and an automountd daemon. The startup script for Solaris 2.3 system software is /etc/init.d/autofs.

The automounter checks for the local auto_master map. When the first entry in the local auto_master map is +auto_master, the automounter consults the NIS+ auto_master table, builds a list of the specified mount points, and consults the auto_variable maps it finds listed there. When the first entry in the local auto_master map is not +auto_master, the automounter consults the local auto_variable maps. The startup procedure for Solaris 2.0, 2.1, and 2.2 system software is shown in Figure 7-1. If no NIS+ auto_master map is found, NIS+ searches for an NIS auto.master map.


Figure 7-1  Starting the automounter.

When a user changes to a directory that has a mount point controlled by the automounter, the automounter intercepts the request and mounts the remote file system in the /tmp_mnt directory if it is not already mounted.

On the other hand, when a user changes out of a directory controlled by the automounter, the automounter waits a predetermined amount of time (the default is 5 minutes) and unmounts the file system if it has not been accessed during that time. Figure7-2 shows how the automounter works.


Figure 7-2  How the automounter works.

In Figure 7-2, when the user types cd, the automounter looks in the table that was created at boot time from the NIS+ auto_master map and NIS+ auto_home map and mounts the user’s home directory from the server named oak. When the user types man lp, the automounter looks in the table that was created at boot time, mounts the manual pages on /usr/man, and displays the manual page for the lp command. After 5 minutes of inactivity, the manual pages are unmounted. When the user types maker&, the automounter looks in the table that was created at boot time and mounts the executable for FrameMaker on /bin/frame3.1.

How to Plan for Automounting

In these discussions about the automounter, it is assumed that you are administering a network of systems running SunOS 4.x and SunOS 5.x system software and that you are using NIS on the 4.x systems and NIS+ on the 5.x systems. This configuration provides you with a global namespace so that you can mount file systems that are exported from any server on the network. It also creates host-independent resources so that you can specify a list of servers from which file systems can be mounted, and it allows you to relocate resources from one server to another without disrupting the user environment.


NOTE:  Although you can set up the automounter using local maps (auto_master files on a local system instead of on an NIS+ root master server), SunSoft strongly recommends that you do not do so. Decentralized and local maps are more complicated and expensive to maintain, and they are difficult to update consistently. SunSoft is implementing many new automount features in future versions of Solaris system software. Some of these new features will work only with maps stored in NIS+.

Recommended Automounting Policies

Before you begin planning your automounting, review the list of recommended policies in the following sections. They may affect how you set up your automount maps.

  Use the default mount points /net and /home. If your site uses a different mount point naming scheme, convert your site gradually to use the default mount point names to ensure compatibility with future releases.
  Always use the NIS+ (or NIS) maps. Discourage the use of local maps.
  Use indirect maps as much as you can to minimize the excessive network traffic that can be generated by direct maps.
  Use direct maps only when absolutely necessary.
  Use two-level home directory names (/home/username) instead of the SunOS 4.x three-level home directory names (/home/server/username).
  Because the automounter uses the /home directory as a mount point, do not use just /home as the top-level directory name on the servers that contain users’ home directories. Create a user’s home directories as a three-level path (/export/home/username). Most importantly, make sure that user disk partitions are not mounted on or under /home. Multiple partitions may require separate mount points—for example, /export/home1, /export/home2, and so on.
  Never use the share command to automount local file systems or systems that are exported from a server. Mount them from the system’s local /etc/vfstab file.
  Do not put entries that are already in the /etc/vfstab file into automount direct maps.
  If your site has a mixture of systems running SunOS 4.x and SunOS 5.x, you do not need to change the names of your SunOS 4.x automount maps from auto.variable to auto_variable. NIS searches for auto.master if it cannot find an auto_master map.


CAUTION! You should never change the SunOS 4.x auto.master map name; this name is required by the SunOS 4.x automounter.

Prerequisites for Using the Automounter

These sections describe the prerequisites for using the automounter. Before creating automount maps, the network should be up and running NIS+ on SunOS 5.x systems and NIS on SunOS 4.x systems.

Each system on the network should have the default auto_master and auto_home maps in its local /etc directory. These maps are automatically installed with the system software.


Previous Table of Contents Next