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

Using Wildcard Characters as Shortcuts in AutoFS Maps

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

Consider the following guidelines while using wildcard characters as shortcuts:

  • Use an asterisk (*) as a wildcard character in an indirect map, to represent the local subdirectory if you want the local subdirectory to be the same as the remote system name, or the remote subdirectory.

    You cannot use the asterisk (*) wildcard in a direct map.

  • Use an ampersand (&) in a direct or indirect map as the remote system name or the remote subdirectory. The entry in the local directory name field will replace the ampersand. If you have used an asterisk to represent the local subdirectory, the entry that replaces the asterisk (*) in the local subdirectory field also replaces the ampersand (&), in the remote system name or remote subdirectory field.

Notes on Using Wildcard Characters as Shortcuts in Maps

The following example illustrates the automounting of the users’ home directories. The home directories are physically located on the NFS server, basil, under the remote directory /export/home. On the local NFS client, the home directories are mounted under /home.

The following line from the /etc/auto_master master map lists the indirect map, /etc/auto_home:

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

/home /etc/auto_home -nosuid

The following line from the /etc/auto_home indirect map mounts the users home directories on demand:

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

*                                       basil:/export/home/&

The users home directory is configured in the /etc/passwd file as /home/username. For example, the home directory of the user terry is /home/terry. When Terry logs in, AutoFS looks up the /etc/auto_home map and substitutes terry for both the asterisk and the ampersand. AutoFS then mounts Terry’s home directory from /export/home/terry on the server, basil, to /home/terry on the local NFS client.

You can use the ampersand character to represent both the remote server and the remote subdirectory, in the same line of the indirect map. For example, if the user’s home directories are physically located on many different servers, but the directory under which the home directories are located is called /export/home/servername on all the servers, the following line in the /etc/auto_home map mounts all the users home directories from any server:

*         &:/export/home/&

If the home directory of the user terry is configured in the /etc/passwd file as /home/basil/terry, AutoFS mounts the remote directory /export/home/basil from the server basil on the local directory /home/basil when Terry logs in.

The line with the asterisk and ampersand must be the last line in an indirect map. AutoFS reads the lines in the indirect map sequentially until it finds a match for the requested local subdirectory. If asterisk (*) matches any subdirectory, AutoFS stops reading at the line with the asterisk.

For example, if the /etc/auto_home map contains the following lines,

*           basil:/export/home/& 
charlie thyme:/export/home/charlie

AutoFS attempts to mount /export/home/charlie from the host, basil. If the asterisk is a match for charlie, AutoFS looks no further and never reads the second line. However, if the /etc/auto_home map contains the following lines,

charlie     thyme:/export/home/charlie 
* basil:/export/home/&

AutoFS mounts Charlie’s home directory from host thyme and other home directories from host basil.

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