IBM Books

Administration Guide


Understanding the automounter implementation

An automounter is a facility used to manage the mounting activity of a file system. When you access a file or directory under automounter control, the automounter transparently mounts the required file system. When there has been no activity to that file system for some pre-determined amount of time, the automounter unmounts the file system.

Automounters are typically used with the Network File System (NFS). NFS is a distributed file system that allows you to access files and directories located on remote systems and treat those files and directories as if they were local. When performing the mounting activity for an NFS file system, the automounter uses the NFS mounting facilities. The automounter reduces the period of time that a file system is actively mounted, thereby minimizing local system hangs due to NFS server outages.

On an SP system, you can choose to use the automounter to manage mounting of user home directories and other directories. When configured, an automounter daemon runs on each node and is started at the time the node is booted. It mounts directories on demand and unmounts them after a period of inactivity. The mounted directories can come from SP boot-install servers or any workstation or server in the network, including local directories on that node.

The automounter manages directories specifically defined in automounter map files. Typically, there is one map file for each file system to be controlled by the automounter. The map files contain entries for each directory supported within the file system and the specific mount information for that directory. If SP user management services have been configured, the SP creates and maintains a map file to control user home directories in the /u file system.

Requesting SP automounter support

You can choose to allow the SP to use the automounter to provide remote access to users' home directories or you can rely on other methods of automounting or file system management established at your site. You specify your choice by setting the automounter configuration site environment variable amd_config when defining your site environment. You can specify your choice for the Automount Configuration variable on the Site Environment Information SMIT panel or using the spsitenv command on the control workstation. If amd_config is true (the default setting), the SP does the necessary directory and file configuration, and starts the automounter daemon. If SP User Management services have also been configured (the usermgmt_config site environment variable is true), the SP adds, removes, and changes entries in the automounter map file for the /u file system to maintain user home directory information when SP users are added, removed, or changed.

If you set amd_config to false when you initially install the SP system, it will not configure or start the automounter daemon and it will not maintain user home directory information in automounter map files. You can change the initial setting of amd_config at a later time using SMIT or the spsitenv command. However, this change will not affect the running state of the automounter daemon until the next time you reboot your nodes or control workstation or take other actions to start or kill the daemon. Note that if amd_config is initially false and then later set to true, all user management changes that had occurred while amd_config was false will not be reflected in the automounter map file for user home directories and that information may need to be manually added. If you choose to unconfigure the automounter by changing amd_config from true to false, make sure that all user home directories, as well as other directories previously served by the automounter, are distributed and made available by some other means.

When amd_config is true, the SP system uses the AIX automount daemon that is shipped as part of NFS in the AIX Network Support Facilities of the Base Operating System (BOS) Runtime. In systems with AIX 4.3.1 or later, this is the AutoFS automounter. In previous levels of AIX, this is the Automount automounter. IBM AIX Version 4 System Management Guide: Communications and Networks describes the operation and use of this automounter and the format of the map files. In addition to the map file for the /u file system maintained by the SP system, you may provide your own automount map files to enable the automount daemon to control similar access to directories in other file systems that you would like to have automatically mounted on demand.

If you choose to install and use a different automounter, the SP system allows you to provide a set of user customization scripts that the system will use to replace its functions for configuring and starting the automounter daemon and managing the map file for the user home directory information. amd_config must still be set to true.

Automount map files

The AIX automount daemon reads automount map files to determine which directories to support. Typically, there is one map file for each file system to be controlled by the automounter. The map file contains entries for each directory supported within the file system, the host name where the directory resides, and the specific mount information for that directory. The automount map files are kept in the /etc/auto/maps directory, by default. The list of all map files to be used by the automount daemon is specified in the master map file /etc/auto.master. This master map file contains entries for each file system to be controlled by the automounter, the name of the map file containing the directory information, and optional default mount information.

If automounter support and the SP User Management interface are both configured for your site environment, /u is automatically controlled by the automounter. The SP-managed automount map file for the /u file system is /etc/auto/maps/auto.u. This map file contains a stanza for each user added using SP User Administration (either the spmkuser command or SMIT panels), containing the server name and directory location of the user's home directory. Existing users must be added to the map file using the mkamdent command.

An entry in the automount map file has the following format:

key -mount_options server_name:mount_directory:sub_directory

where:

key
The directory of interest within the file system

mount_options
Options used during the mount operation

server_name
The name of the machine that contains the directory

mount_directory
The exported directory from that machine

sub_directory
An optional sub-path under the exported directory

A special substitution value of & can be used to substitute the key value in the entry.

Note:
An entry is added to auto.u for the net install ID's home directory. This netinst user ID is required by AIX for a net install.
Note for Users of AIX 4.3.0 or Earlier

The automount daemon will mount file systems in the /tmp_mnt directory using the following naming convention:

/tmp_mnt/filesystem/first-accessed-sub_directory

where filesystem is the name of the file system under automount control and first-accessed-sub_directory is the name of the first sub-directory accessed within a mounted directory. A symbolic link is made from the directory the user accessed to the appropriate sub-directory within that mount point:

/filesystem/sub_directory>/tmp_mnt/filesystem \
first-accessed-sub-directory/sub_directory

where sub_directory is the name of the subpath currently being accessed by a user. This naming convention can be quite confusing because the physical directory path is dependent on some arbitrary name (that is, the first sub-directory accessed within a mounted directory). Because this name can change from one access period to another, you should not make any assumptions about this name or directly use it in any scripts or programs. Always access the directory through the automounter-supported path name. This naming convention may cause problems for C-shell users because the C-shell pwd built-in command returns the actual physical path and not the automounter-supported path, which is a symbolic link. The results of the C-shell command should not be stored for later use by the same program or another program or shared across a parallel execution environment; there is no guarantee the physical path name will exist.

Automount daemon example and AutoFS example

The following examples illustrate how an automount map entry is used by the automount daemon and the AutoFS daemon to provide access to a user's home directory.

In the SP system, by default, the users' directories reside in /home/hostname, where hostname is the short name for the host system. The following stanza shows the entry in the automount map /etc/auto/maps/auto.u for user jws whose home directory resides on luna:

jws luna:/home/luna:&

In this case, if a user is on luna and changes directories to /u/jws, automount will create a symbolic link to the local directory:

/u/jws>/home/luna/jws

AutoFS locally mounts the /home/luna/jws JFS directory at /u/jws. Issuing the mount command will show an entry similar to:

/home/luna/jws   /u/jws   jfs   Aug 07 09:07

However, if the user is on any machine other than luna and changes directories to /u/jws, automount mounts luna:/home/luna in the local /tmp_mnt directory at /tmp_mnt/u/jws. Automount then creates a symbolic link to the jws sub-directory under that mount point:

/u/jws>/tmp_mnt/u/jws/jws

AutoFS mounts the luna:/home/luna/jws NFS directory at /u/jws. Issuing the mount command will show an entry similar to:

luna   luna:/home/luna/jws   nfs   Aug 07  09:07

In the automount environment, because jws was the first user to access a sub-directory in luna:/home/luna, the jws subdirectory name appears twice in the physical path name. If a second user, kcb, also accesses a subdirectory in luna:/home/luna, automount creates the following symbolic link:

/u/kcb>/tmp_mnt/u/jws/kcb

In the automount environment, note the presence of jws in the physical path name. This is the name of the mount point the automounter used when mounting luna:/home/luna.

If a user's home directory resides in some other type of file system that already appears locally on the machine (for example, AFS), the server name should be specified as the local host. A map entry for a user with an AFS home directory would look like this:

tberry $HOST:/afs/kgn.ibm.com/usr2:&

In this case, when a user changes directories to /u/tberry, automount creates a symbolic link to the AFS directory:

/u/tberry>/afs/kgn.ibm.com/usr2/tberry

AutoFS mounts the /afs/kgn.ibm.com/usr2/tberry AFS directory at /u/tberry.

Note:
The use of the $HOST substitution variable is specific to the SP invocation of the automount daemon. The AIX automount command allows you to specify substitution variables and values to be used in the map files. The SP invocation of the automount daemon includes the parameter -D HOST='uname -n' which sets $HOST to the name of the local machine as returned by the uname command.

See IBM AIX 4 System Management Guide: Communications and Networks for more information on the automount. daemon and map file format.

Automount master map files

The SP invocation of the automount daemon uses the master map file /etc/auto.master. This master map file contains entries for each file system to be controlled by automount, the name of the map file containing the directory information, and optional default mount information. If you add additional file systems to be controlled by the automount daemon, you must edit this file and add an entry indicating the name of the file system and the full directory path of the associated map file. See Using automount for other file systems.

If you wish to change the default mount options for mounting directories for the /u file system or any other file system controlled by the automount daemon, edit the /etc/auto.master file to add the mount options to the end of the appropriate file system entry. For example, to add mount options to the /u file system, your /etc/auto.master entry may be modified to appear as follows:

/u /etc/auto/maps/auto.u -rw,hard,retry=3,timeo=40,rsize=4096,wsize=4096

The master map file can also specify an NIS database as a map file. The Network Information Service (NIS) is a distributed database that allows you to maintain consistent configuration files throughout a network. By default, the SP invocation of the automount daemon turns off the use of the auto.master NIS database. If you are using NIS to maintain and distribute your automounter map files, you will need to edit the /etc/auto.master file to add as the first entry +auto.master which includes the NIS auto.master database.

See IBM AIX 4 System Management Guide: Communications and Networks for more information on the automount master map file format and on NIS.

File collections and automounter files

If you have configured the SP to use file collections by setting the site environment variable filecoll_config to true, automount map files will be automatically distributed to all nodes. The automount map files are part of the user.admin file collection. The /var/sysman/sup/user.admin/list file contains entries to distribute the /etc/auto.master file, all files in the /etc/auto/maps directory, and all files in the /etc/auto/cust directory.

If you decide to replace some or all of the SP automounter function with your own, you might need to edit the /var/sysman/sup/user.admin/list file to distribute your own files or to remove the currently distributed SP files. In the list file, there exists a comment mentioning that SP automounter configuration has been added. Do NOT delete or change this comment. You may change or remove any other entries in the file as necessary for your automounter installation. However, if this comment is removed or altered on the control workstation, the next time your system is booted or the services_config command is run, the SP configuration will add the automount entries back again. See Customizing the SP automounter function for more details on providing your own automounter customizations.

If you are not using file collections on your SP, you must use some other local means of distributing the automount map file, master map files, and user customization scripts to all of the nodes on your system. The SP will not copy your map files to the nodes for you.

See Chapter 7, Managing file collections for more information on the file collection processes.

Automounter diagnostics

The SP automounter configuration and execution functions write error messages to an error log file, /var/adm/SPlogs/auto/auto.log. Also, the automount daemon uses the daemon facility of the BSD syslog subsystem to record errors. The control workstation and nodes have been configured to write all daemon.notice and greater messages to /var/adm/SPlogs/SPdaemon.log. If you are having problems with the automounter, you may need to stop the daemon, check the diagnostic information recorded in these logs, and restart the automount daemon. For more information on error logging, refer to Chapter 28, Managing error logs. You can find a description of the automounter error log, messages, and instructions for stopping and starting the automount daemon in PSSP: Diagnosis Guide.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]