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

Configuring AutoFS Direct and Indirect Mounts

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

A direct map is an automount mount-point. It creates a direct association between a mount-point on the client and a directory on the server. Direct maps have the absolute path name. The automounts configured in a direct map can be mounted in various places in the local filesystem; they need not be located under the same parent directory.

An indirect map uses the key to establish a connection between a mount-point on the client and a directory on the server. Indirect maps are useful for accessing specific file systems, such as home directories. The automounts configured in an indirect map are mounted under the same local parent directory.

Figure 3-4 shows the difference between direct mounts and indirect mounts on an NFS client.

Figure 3-4 Difference Between Direct Mounts and Indirect Mounts

Difference Between Direct Mounts and Indirect Mounts

In the Mounts in a Direct Map figure, mounts are configured in various places in the local filesystem and not located under the same parent directory. In the Mounts in an Indirect Map figure, all the mounts are configured under the same parent directory.

CAUTION: You must maintain filesystems managed by AutoFS, by using the automountd and automount utilities. Manually mounting and unmounting file systems managed by AutoFS can cause disruptive or unpredictable results, including but not limited to commands hanging or not returning expected results. Applications can also fail because of their dependencies on these mounted filesystems.

Automounting a Remote Directory Using a Direct Map

This section describes how to automount a remote directory using a direct map.

To mount a remote directory using a direct map, follow these steps:

  1. If you are using local files for maps, use an editor to edit the master map in the /etc directory. The master map is commonly called /etc/auto_master. If you are using NIS, open the master map on the NIS master server.

    If you are using LDAP, the map must be modified on the LDAP server. For information on modifying maps, see the LDAP-UX Client Services B.04.00 Administrator’s Guide (J4269-90064).

    If the direct map you just modified is not listed in the master map, add the following entry to the master map:

    /-  direct_map_name  [mount_options]
  2. If you are using local files for maps, use an editor to open or create a direct map in the /etc directory. The direct map is commonly called /etc/auto_direct. Add an entry to the direct map with the following syntax:

    local_directory [mount_options] server:remote_directory

    If you are using NIS or LDAP to manage maps, add an entry to the direct map on the NIS master server or the LDAP directory.

  3. If you are using NIS to manage maps, rebuild the maps and push them to the slave servers. For more information on management of NIS maps, see the NIS Administrator’s Guide (5991-7656).

  4. On each host that uses the map you have modified, enter the following command to force AutoFS to read the modified map:

    /usr/sbin/automount
IMPORTANT: Do not automount a remote directory on a local directory, which is a symbolic link.

Ensure that the local mount-point specified in the AutoFS map entry is different from the exported directory on the NFS server. If it is the same, and the NFS server also acts as an NFS client and uses AutoFS with these map entries, the exported directory can attempt to mount over itself. This can result in unexpected behavior. A directory might also attempt to mount over itself if you use a single set of AutoFS maps that are distributed using NIS or LDAP, or are in a High Availability environment.

Consider the following sample entries in the /etc/auto_master, and /etc/auto_direct maps:

# Contents of the /etc/auto_master sample map
/net 		-hosts 			-nosuid,soft,nobrowse
/-      auto_direct
# Contents of the /etc/auto_direct sample map:
/tmp/export auto23:/tmp/export

If the NFS server also acts as an NFS client, for example auto23 acts as the NFS server and client, and the AutoFS map references the NFS server and tries to overlay a VxFS path, it may result in unexpected behavior.

Notes on Direct Maps

The mount options that you can specify in the AutoFS maps are the same options that you use for the type of filesystems you attempt to automount. For example, if the filesystem type is NFS, then the mount options you use are identical to the ones used for standard NFS mounted directories. For more information on the different mount options, see “Changing the Default Mount Options”.

You cannot use the bg option for an automounted directory. The mount options configured in the direct map override the ones in the master map, if there is a conflict.

You can configure all the direct automounts in the same map. Most users use the file name, /etc/auto_direct, for their direct map. Following is the syntax for a direct map:

local mount-point	   mount options   remote server:directory

where:

local mount-point

The path name of the mount-point

mount options

Options you want to apply to this mount.

remote server:directory

Location of the directory, on the server, that is to be mounted.

If you plan to use NIS or LDAP to manage maps, there can be only one direct map in your configuration.

If the direct map name in the master map begins with a slash (/), AutoFS considers it to be a local file. If it does not contain a slash, AutoFS uses the NSS to determine whether it is a file, LDAP, or an NIS map. For more information on using NSS, see nsswitch.conf(4).

Sample File Entries for NFS Direct Automounts

Following are sample entries from the AutoFS master map on the NFS client, sage:

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

/-                         /etc/auto_direct

Following are sample entries from an AutoFS direct map on the NFS client, sage. The hash (#) symbol indicates a commented line.

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

/auto/project/specs  -nosuid      thyme:/export/project/specs
/auto/project/budget   -nosuid       basil:/export/FY94/proj1

Figure 3-5 illustrates how AutoFS sets up direct mounts.

Figure 3-5 How AutoFS Sets Up Direct Mounts

How AutoFS Sets Up Direct Mounts

Automounting a Remote Directory Using an Indirect Map

This section describes how to automount a remote directory using an indirect map.

To automount a remote directory using an indirect map, follow these steps:

  1. If you are using local files for maps, use an editor to edit the master map in the /etc directory. The master map is commonly called /etc/auto_master. If you are using NIS, open the master map on the corresponding master server.

    If you are using LDAP, the map must be modified on the LDAP server. For information on modifying the map, see theLDAP-UX Client Services B.04.00 Administrator’s Guide (J4269-90064).

    If the indirect map you modified is not listed in the master map, add the following entry to the master map:

    local_parent_directory indirect_map_name [mount_options]
  2. If you are using local files for your AutoFS maps, use an editor to open or create an indirect map in the /etc directory. Add a line with the following syntax, to the indirect map:

    local_subdirectory [mount_options] server:remote_directory

    If you are using NIS or LDAP to manage maps, add an entry to an indirect map on the corresponding NIS master server or the LDAP directory.

  3. If you are using NIS to manage maps, rebuild the maps and push them to the slave servers. For more information on NIS maps, see the NIS Administrator’s Guide (5991-7656).

  4. If you modified the master map, enter the following command on each host that uses the map, to force AutoFS to read the modified master map:

    /usr/sbin/automount
IMPORTANT: Ensure that local_parent_directory and local_subdirectory are not already created. AutoFS creates them when it mounts the remote directory. If these directories exist, their files and directories in them are hidden when the remote directory is mounted.

Ensure that the local mount-point specified in the AutoFS map entry is different from the exported directory on the NFS server. If it is the same, and the NFS server also acts as an NFS client and uses AutoFS with these map entries, the exported directory might attempt to mount over itself. This can result in unexpected behavior. A directory might also attempt to mount over itself if you use a single set of AutoFS maps that are distributed using NIS or LDAP, or are in a High Availability environment.

Notes on Indirect Maps

The mount options that you can specify in the AutoFS maps are the same ones that you use for the type of filesystem you attempt to automount. For example, if the filesystem type is NFS, then the mount options you use are identical to the ones used for standard NFS mounted directories. For a list of mount options, see “Changing the Default Mount Options”. You cannot use the bg option for an automounted directory. The mount options configured in the indirect map override the ones in the master map if there is a conflict.

Indirect maps are usually called /etc/auto_name, where name helps you remember what is configured in the map. Following is the syntax of the indirect map:

local mount-point    mount options   remote server:directory

where:

local mount-point

Simple name in the indirect map

mount options

Options you want to apply to this mount.

remote server:directory

Location of the directory, on the server, that is to be mounted.

If the indirect map name in the AutoFS master map begins with a slash (/), AutoFS assumes that it is a local file. If it does not contain a slash, AutoFS uses the Name Service Switch to determine whether it is a file, LDAP, or an NIS map. For more information on configuring the Name Service Switch, see nsswitch.conf(4).

Sample File Entries for NFS Indirect Automounts

The local_subdirectory specified in an indirect map is the lowest-level subdirectory in the local directory path name. For example, if you are mounting a remote directory on /nfs/apps/draw, draw is the local_subdirectory specified in the indirect map.

Following are sample lines from the AutoFS master map on the NFS client, sage. The master map also includes an entry for the /etc/auto_direct direct map.

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

/-                         /etc/auto_direct
/nfs/desktop                 /etc/auto_desktop

The local_parent_directory specified in the master map consists of directories, except the lowest-level subdirectory in the local directory pathname. For example, if you are mounting a remote directory on /nfs/apps/draw, /nfs/apps is the local_parent_directory specified in the master map.

You can configure indirect automounts in the same indirect map only if their local_parent_directory, as specified in the master map, is the same. For example, indirect mounts with the local mount-points, /nfs/apps/draw and /nfs/apps/word, can be configured in the same indirect map.

Following are sample lines from an AutoFS indirect map on the NFS client, sage. The hash (#) symbol indicates a commented line.

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

draw                     -nosuid          thyme:/export/apps/draw
write                    -nosuid           basil:/export/write

Figure 3-6 illustrates how AutoFS sets up indirect mounts.

Figure 3-6 How AutoFS Sets Up NFS Indirect Mounts

How AutoFS Sets Up NFS Indirect Mounts
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2008 Hewlett-Packard Development Company, L.P.