Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
NFS Services Administrator's Guide: HP-UX 11i version 3 > Chapter 3 Configuring and Administering AutoFS

How AutoFS Works

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

This section describes how AutoFS works.

AutoFS mounts directories automatically when users or processes request access to them, and it unmounts directories automatically if they remain idle for a period of time (10 minutes, by default).

When deciding if AutoFS is right for your environment, see “Deciding Between Standard-Mounted Directories and Automounted Directories”.

AutoFS consists of the following components:

  • The automount command which reads AutoFS maps into memory

  • The AutoFS filesystem

  • The automountd daemon, which automounts filesystems when they are accessed by users or applications

The automount command reads the AutoFS master map to create the initial set of AutoFS mount points in the kernel mount table, /etc/mnttab. The automounted filesystems are not automatically mounted at startup. They are points under which filesystems are mounted later, when users or applications request access to them.

When AutoFS receives a request to mount a filesystem, it calls the automountd daemon, which mounts the requested filesystem. Once the filesystem is mounted, further access does not require any action from the automountd daemon.

The automountd daemon is independent from the automount command. As a result, you can add, delete, or change map information without stopping and restarting the automountd daemon.

Once AutoFS starts and the mount points are set up, you can modify the set of mount points by modifying maps and running the automount command, to read them and modify the mount table accordingly. You need not stop and restart AutoFS.

If an automounted filesystem remains idle for 10 minutes (the default), AutoFS unmounts it.

For more information on AutoFS, see automount(1M) and
automountd
(1M)
.

CAUTION: Filesystems under the management of AutoFS must always be maintained using the AutoFS utilities automountd and automount. Manually mounting and unmounting AutoFS-managed filesystems can lead to disruptive or unpredictable results, including but not limited to: commands hanging or not returning expected results, and applications failing because of their dependencies on these mounted filesystems.

Supported Filesystems

AutoFS can mount the following filesystems:

  • NFS

  • CacheFS

  • HFS

  • VxFS

  • CIFS

  • AutoFS

On-Demand Mounting

In HP-UX 11i v3, the filesystems being accessed are mounted automatically and other filesystems that are hierarchically related to these filesystems are mounted only when needed.

In the following example, the AutoFS master and direct maps are on the NFS client, sage:

# /etc/auto_master file
# local mount point map name mount options

/-                         /etc/auto_direct
# /etc/auto_direct file
# local mount point mount options remote server:directory

/auto/project/specs -nosuid thyme:/export/project/specs
/auto/project/specs/reqmnts -nosuid  / sage:/export/projects/specs/reqmnts
/auto/project/specs/reqmnts -nosuid

A user on the NFS client, sage, enters the following command:

cd /auto/project/specs

Only the /auto/project/specs subdirectory is mounted. The /auto/project/specs/designs subdirectory is mounted only when accessed using the following command:

cd /auto/project/specs/designs

shows the automounted file structure after the user runs the command.

Figure 3-1 Automounted Directories for On-Demand Mounting

Automounted Directories for On-Demand Mounting

Browsability for Indirect Maps

AutoFS now allows you to view the potential mount points for indirect maps, without mounting each filesystem.

In the following example, the AutoFS master and indirect maps are on the NFS client, sage:

# /etc/auto_master file
# local mount point map name mount options

/nfs/desktop            /etc/auto_indirect
# /etc/auto_indirect file
# local mount point mount options remote server:directory

/test               -nosuid      thyme:/export/project/test
/apps                 -nosuid       basil:/export/apps

Enter the following commands:

cd /nfs/desktop
ls

The ls command displays the following:

test          apps

The test and apps subdirectories are the potential mount points. However, they are not currently mounted, but if you enter the following commands, both test and apps subdirectories are mounted:

cd /nfs/desktop/test 
cd /nfs/desktop/apps

Browsing is enabled by default for all indirect AutoFS maps. To disable browsing for a specific indirect map, specify the -nobrowse option for that map. Optionally, you can disable browsing for all indirect maps by launching automountd with the -n option.

NFS Loopback Mount

By default, AutoFS uses the Loopback Filesystem (LOFS) mount for locally mounted filesystems. AutoFS provides an option to allow the loopback NFS mounts for the local mount. The automountd command with the -L option is used to enable the loopback NFS mounts for locally mounted filesystems. This option is useful when AutoFS is running on a node that is part of a High Availability NFS environment.

Map Locations (Backends)

AutoFS maps can be located in the following:

  • Files: A local file that stores the AutoFS map information. An example of a map that can be kept on the local system is the master map. The AUTO_MASTER variable in /etc/rc.config.d/nfsconf is set to the name of the master map. The default master map name is /etc/auto_master.

  • Network Information Service (NIS): A service that allows you to administer the configuration of many hosts from a central location. Common configuration information, which would have to be maintained separately on each host in a network without NIS, can be stored and maintained in a central location and propagated to all of the nodes in the network.

    For more information on NIS, see NIS Administrator’s Guide (5991-7656).

  • LDAP: A directory service that stores information, which is retrieved by clients throughout the network. The LDAP-UX Integration product centralizes user, group, and network information management in an LDAP directory, to simplify HP-UX system administration.

    For more information on the LDAP-UX Integration product, see the LDAP-UX Client Services B.04.00 Administrator’s Guide (J4269-90064).

To use NIS or LDAP maps, you need to perform the following:

  1. Configure the /etc/nsswitch.conf file

    This file enables you to specify one or more data stores to look up information (in this case, AutoFS maps). You can also specify the order in which these data sources are looked up. LDAP and NIS can be specified to lookup AutoFS maps.

    For more information on configuring the /etc/nsswitch.conf file, see nsswitch.conf (4).

  2. Configure AutoFS maps in LDAP or NIS

    You need to set up your AutoFS maps on the specified data store.
    For information on setting up AutoFS maps on NIS, see NIS Administrator’s Guide (5991-7656).

    For information on setting up AutoFS maps for LDAP, see “Enabling AutoFS for LDAP Support”.

Enabling AutoFS for LDAP Support

To enable AutoFS for LDAP support, follow these steps:

  1. Migrate your AutoFS maps to LDIF (LDAP Directory Interchange Format) files, using the migration scripts, if the AutoFS maps are not already migrated.

    For information on the specific migration scripts, see LDAP-UX Client Services B.04.10 Administrator’s Guide (J4269-90067).

  2. Import the LDIF files in to the LDAP directory server using the ldapmodify tool.

    For information on the migration scripts, see the LDAP-UX Client Services B.04.10 Administrator’s Guide (J4269-90067).

  3. Check whether the nisObject automount schema exists in the /var/opt/netscape/servers/slapd-<server-instance>/config/schema/10rfc2307.ldif file in the LDAP directory, by searching for entries that contain the following fields:

    • NAME ‘nisMapName’• NAME ‘nisMapEntry’• NAME ‘nisObject’• NAME ‘nisMap’

    If the entries do not exist, set up the attribute mappings on the LDAP-UX client. For more information, see the LDAP-UX Client Services B.04.10 Administrator’s Guide (J4269-90067).

  4. Configure the Name Service Switch (NSS), to enable AutoFS for LDAP support.

    Backup the current /etc/nsswitch.conf file. Then modify the working file, to add an entry for LDAP support to the automount service as follows:

    automount: ldap
  5. Enter the following command to run the AutoFS shutdown script:

    /sbin/init.d/autofs stop
  6. Enter the following command to run the AutoFS startup script:

    /sbin/init.d/autofs start
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2007 Hewlett-Packard Development Company, L.P.