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

Automounting a Remote Directory Using a Direct Map

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

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 open or create the master map in the /etc directory. Name the master map as /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 how to modify the map, see 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, see 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 might attempt to mount over itself. As a result, unexpected behavior can occur. 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 example entries in the /etc/auto_master, /etc/auto_home and /etc/auto_direct maps:

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

If the NFS server is also the NFS 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 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 more information, 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. If you plan to use NIS or LDAP to manage maps, you can have only one direct map in your configuration.

If the direct map name in the 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 using the name service switch, see nsswitch.conf (4).

Sample File Entries for NFS Direct Automounts

Following are sample lines 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 lines 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-3 “How AutoFS Sets Up Direct Mounts” illustrates how AutoFS sets up direct mounts.

Figure 3-3 How AutoFS Sets Up Direct Mounts

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