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 2 > Chapter 2 Configuring and Administering NFS Services

Configuring and Administering AutoFS

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

This section tells you how to configure AutoFS. AutoFS mounts directories automatically when users or processes request access to them, and it unmounts them automatically after they have been idle for a period of time (10 minutes, by default).

This section documents the tasks involved in configuring AutoFS to get AutoFS up and running on your system.

Before configuring AutoFS, see “Deciding Between Standard-Mounted Directories and Automounted Directories”.

The following topics are covered in this section:

New Features of AutoFS 2.3

AutoFS has been enhanced to provide the features of the SUN ONC+ version 2.3 AutoFS product on HP-UX release 11i version 2. These new features include the following:

  • On-demand mounting - Previous releases of AutoFS would mount an entire set of file systems if they were hierarchically related. Now, only the file systems that are being accessed are mounted. Other file systems hierarchically related to these file systems are mounted when they are needed. This results in increased performance by preventing unnecessary mounting and unmounting.

  • Browsability - AutoFS 2.3 allows a user to see what directories could be mounted for indirect maps without having to actually mount each file system.

  • Device ID - AutoFS 2.3 can now use the device id of a mounted file system in the /etc/mnttab file for reference during a future unmount. This results in increased performance as the unmount does not have to get the information from the remote file system.

  • Concurrent mount/unmount - AutoFS performs concurrent mounts and unmounts in a multithreaded automount daemon. This results in a performance enhancement, which prevents services from hanging if a server is unavailable.

  • Reliable NFS ping - AutoFS now supports a -retry=n mount option for an NFS map entry to configure the ping timeout value based on the network setup.

  • CIFS Client support - AutoFS 2.3 has the ability to support HP CIFS Client.

  • NFS loopback mount - By default, AutoFS uses the loopback LOFS mount for locally mounted file systems. AutoFS 2.3 provides an option to allow the loopback NFS mounts for the local mount. This option should be used in the HA NFS environments.

With AutoFS 2.3 implementation, both performance and scalability are significantly improved.

Comparing AutoFS To an Old Automounter

Beginning with the HP-UX Extension Pack Release, August 1998 (for HP-UX 11.0), the new automounting utility, AutoFS, was available. Now, AutoFS has been enhanced to include the features of the SUN ONC+ 2.3 AutoFS on the HP-UX release 11i verison 2 (release 11.23). The old automounter is obsoleted from the HP-UX release 11i version 2. AutoFS mounts directories automatically when users or processes request access to them. It unmounts them automatically after they have been idle for a period of time (10 minutes, by default). AutoFS has the following advantages over old Automounter:

  • AutoFS can be used to mount any type of file system, including NFS protocol versions 2 and 3.

  • With AutoFS, the configured mount points are the actual mount points.

  • You do not have to stop AutoFS to change your AutoFS maps. The AutoFS daemon, automountd, runs continuously. When you make a change to an AutoFS map, you run the automount command, which reads the maps and then exits.

  • AutoFS can support the different types of file systems, including NFS, HFS, CacheFS, VxFS and HP CIFS Client file system.

Comparing AutoFS 2.3 To AutoFS 1.2

AutoFS 2.3 has the following advantages over AutoFS 1.2:

  • AutoFS 2.3 only mounts the file systems that are being accessed. But, AutoFS 1.2 would mount an entire set of file systems if they were hierarchically related. With AutoFS 2.3 implementation, performance is improved by preventing unnecessary mounting and unmounting.

  • AutoFS 2.3 allows a user to see what directories could be mounted for indirect maps without having to actually mount each file system. AutoFS 1.2 doesn’t allow a user to see the available mount points for indirect maps.

  • AutoFS 2.3 performs concurrent mounts and unmounts in a multithreaded automount daemon. This results in a performance enhancement, which prevents services from hanging if a server is unavailable.

  • AutoFS 2.3 provides the ability to support HP CIFS Client file system. AutoFS 1.2 doesn’t support HP CIFS Client file system.

  • AutoFS 2.3 provides an option to allow the loopback NFS mounts for the local mount, This option should be used in the HA NFS environments. AutoFS 1.2 doesn’t provide the ability to support loopback NFS mounts for locally mounted file systems.

Updating From Automounter to AutoFS 2.3

With AutoFS 2.3 implementation in HP-UX release 11i verion 2, the following tasks are automatically done to update all users from the Automounter configuration to AutoFS with no user intervention necessary:

  1. In the /etc/rc.config.d/nfsconf file, the AUTOFS variable is set to 1.

  2. Any options you had specified in the AUTO_OPTIONS variable are copied to either the AUTOMOUNT_OPTIONS or the AUTOMOUNTD_OPTIONS variable. Obsolete options are removed.

    Table 2-4 “Old Automount Command-Line Options Used By AutoFS” lists the options to the old automount command and the equivalent AutoFS command options. It also indicates which automount options are obsolete with AutoFS.

    Table 2-4 Old Automount Command-Line Options Used By AutoFS

    Old automount OptionEquivalent AutoFS Command OptionPurpose
    -D variable=valueautomountd -D variable=valueAssign value to environment variable.
    -f master_fileautomount -f master_fileUse master_file as local master map.
    -M mount_directoryObsolete with AutoFS.Automount directories under mount_directory instead of /tmp_mnt.
    -mObsolete with AutoFS.Ignore NIS auto.master map.
    -nObsolete with AutoFS.Allow automounts only of previously mounted target file systems.
    -Tautomountd -TEnable automount tracing.
    -tl durationautomount -t durationSpecify time before unmounting idle directories.
    -tm intervalObsolete with AutoFS.Specify interval between mount attempts.
    -tw intervalObsolete with AutoFS.Specify interval between unmount attempts.
    -vautomount -v
    automountd -v
    Verbose mode.

     

  3. Modify any scripts that kill and restart automount. The new AutoFS daemon, automountd, rarely needs to be restarted. If you need to make changes to your AutoFS maps, just run the automount program after modifying the maps. It is not a daemon, like the old automount process; it is a program that runs once to read the maps and then terminates.

How AutoFS Works

AutoFS consists of the following components:

  1. The automount command, for reading AutoFS maps into memory.

  2. The AutoFS file system.

  3. The automountd daemon, which automounts file systems when they are requested by users.

The automount command is invoked at system startup. It reads the AutoFS master map to create the initial set of AutoFS mount points in the internal mount table, /etc/mnttab. The automounted file systems are not automatically mounted at startup. They are points under which file systems will be mounted later, when users request access to them.

When AutoFS receives a request to mount a file system that is not currently mounted, it calls the automountd daemon, which actually mounts the requested file system. Once the file system is mounted, further access does not require any action from the automountd daemon. AutoFS mounts file systems at the configured mount points. It does not maintain its own directory of mount points with symbolic links into it.

The automountd daemon is completely independent from the automount command. Because of this separation, it is possible to add, delete, or change AutoFS map information without having to stop and restart the automountd daemon.

After system startup, when the AutoFS mount points are set up, you can modify the set of mount points by modifying AutoFS maps and running the automount command to read them and modify the mount table accordingly. You do not have to stop and restart AutoFS.

If an automounted file system has been idle for 10 minutes, AutoFS unmounts it.

See the following man pages for more information on AutoFS: automount (1M), automountd (1M).

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

On-Demand Mounting

Previous releases of AutoFS would mount an entire set of file systems if they were hierarchically related. With AutoFS 2.3 implementation, only the file systems that are being accessed are mounted. Other file systems hierarchically related to these file systems are mounted when they are needed.

For example, if you have the following AutoFS master and direct maps on 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/budget -nosuid       basil:/export/FY99/proj1

and a user on NFS client, sage, types the following command:

cd /auto/project/specs

Only /auto/project/specs subdirectories are mounted as on-demand mounting. Figure 2-4 shows the automounted file structure after the user’s command is issued.

Figure 2-4 Automounted Directories for On-Demand Mounting

Automounted Directories for On-Demand Mounting

Browsability for Indirect Maps

AutoFS 2.3 allows a user to see the potential mount points for indirect maps without having to actually mount each file system.Browsing is turned on by default for all indirect AutoFS maps.To disable browsing, you can specify the -nobrowse option for each indirect map that you do not want to be browseable. The automountd with -n option is used to disable browsing for all indirect maps without having to specify the -nobrowse option for each indirect map.

For example, if you have the following AutoFS master and indirect maps on 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

and you issue the following commands,

cd /nfs/desktop
ls

the ls command will diplay

test          apps

because the test and apps subdirectories are the potential mount points (browsability), but not currently mounted. However, if you issue the following commands,

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

Now, both test and apps subdirectories are mounted.

NFS Loopback Mount

By default, AutoFS uses the loopback LOFS mount for locally mounted file systems. AutoFS 2.3 provides an option to allow the loopback NFS mounts for the local mount. The automountd command with -L option is used to enable the loopback NFS mounts for locally mounted file systems. This option should be used in the HA NFS environments.

Automount Command Line Options

Table 2-5 lists the options for the automount command available for AutoFS 2.3.

Table 2-5 Automount Command-Line Options available for AutoFS 2.3

Option

Purpose
automount -f master/ file

Specify a local master file for initialization. When the -f option is used and the master file specified is not found, then automount tries to use the switch policy for automount in /etc/nsswitch.conf. If it fails to access nsswitch.conf file or the switch policy for automount doesn’t exist,then automount defaults to /etc/auto_master and then to the NIS auto_master map.

automount -t duration

Specify time in seconds, so that if a file system is not accessed within this interval, AutoFS unmounts it. Default value is 10 minutes.

automount -v

Verbose mode. Notify of AutoFS mounts, unmounts or other non-essential information

 

Automountd Command Line Options

Table 2-6 lists the automountd command line options available for AutoFS 2.3.

Table 2-6 Automountd Command-Line Options available for AutoFS 2.3

Option

Purpose

automountd -D\ variable = value

Assign value to the indicated AutoFS map substitution variable. These assignments cannot be used to substitute variables in the master map.

automountd  -n

Turn off browsing for all AutoFS mount points. It gives an easy way to disable browsing of all maps without having to specify the “nobrowse” option for each indirect AutoFS map.

automountd  -T

Enable tracing and display tracing information to the /var/adm/automount.log file.

automountd  -v

Verbose mode. Logs status messages to the /var/adm/syslog/syslog.log file.

automountd -L

Force all mounts to the local host to be NFS mounts instead of the default LOFS mounts.

 

Automounting All Exported Directories from Any Host Using the -hosts Map

  1. If you are using local files for your AutoFS maps, use an editor to add the following line to AutoFS master map file, /etc/auto_master:

    /net -host -nosuid,soft,nobrowse 

    If you are using NIS to manage your AutoFS maps, add the line to the master map file on the NIS master server, and then issue the following commands to rebuild the map and push it out to slave servers:

    cd /var/yp
    /usr/ccs/bin/make auto_master
    CAUTION: We recommend you to modify your /net map entry with the nobrowse option when you upgrade from AutoFS 1.2 to AutoFS 2.3. The local default master map file for a newly installed system has the nobrowse option set for /net map entry by default.
  2. On each host that will use the map you have modified, issue the following command to force AutoFS to read the modified map:

    /usr/sbin/automount

You must enable AutoFS before any directories can be automounted.

The -hosts map is a built-in AutoFS map; you do not have to create it. The -hosts map causes AutoFS to mount exported directories from any NFS server found in the hosts database whenever a user or process requests access to one of the exported directories from that server.

CAUTION: Because the -hosts map allows NFS access to any reachable remote system, a user may inadvertently cause an NFS mount over X.25 or SLIP, which is unsupported, or through a slow router or gateway. Mounts over slow links may cause excessive retransmissions and degrade performance for all users.

When a user or process requests a directory from an NFS server, AutoFS creates a subdirectory, named after the NFS server, under the local mount point you configured in AutoFS master map. (The conventional mount point for the -hosts map is /net.) Then AutoFS mounts the exported directories from that server which are accessed with on-demand mounting. Directories will stay mounted until they are left idle for ten minutes. The ten minute default can be changed by adding the -t duration option to the AUTOMOUNT_OPTIONS variable in the /etc/rc.config.d/nfsconf file or by running the automount command with the -t option from the command line.

The -hosts map is an indirect map. It uses the hosts database (the /etc/hosts file, the NIS hosts map, or BIND [DNS]) to find a host on the network. The Name Service Switch configuration determines which name services will be searched for host information. See Chapter 6 “Configuring the Name Service Switch”.

For example, if server sage exports /opt and /apps, and a user on your NFS client types the following command,

cd /net/sage/opt/frame

the subdirectory /sage is created under /net, and /opt is mounted under /sage using on-demand mounting. Figure 2-5 “Automounted Directories from -hosts Map—One Server” shows the automounted file structure after the user’s command.

Figure 2-5 Automounted Directories from -hosts Map—One Server

Automounted Directories from -hosts Map—One Server

If server thyme exports the directory /exports/proj1, and a user types the following command,

more /net/thyme/exports/proj1/readme

the subdirectory /thyme is created under /net, and /exports/proj1 is mounted under /thyme using on-demand mounting. Figure 2-6 “Automounted Directories from -hosts Map—Two Servers” shows the automounted directory structure after the user’s second command.

Figure 2-6 Automounted Directories from -hosts Map—Two Servers

Automounted Directories from -hosts Map—Two Servers

Deciding Between Direct and Indirect NFS Automounts

Before you automount a remote directory, decide whether you want to use a direct or indirect AutoFS map. Table 2-7 “Direct vs. Indirect AutoFS Map Types” lists the advantages and disadvantages of each type of map.

In general, an indirect map is better than a direct map, because it is easier to modify while AutoFS is running, and because it does not cause “mount storms” in directories with many AutoFS mount points.

However, if your automounted directory must share the same parent directory with local or standard-mounted directories, you should choose a direct map.

Table 2-7 “Direct vs. Indirect AutoFS Map Types” lists the advantages and disadvantages of direct and indirect AutoFS maps.

Table 2-7 Direct vs. Indirect AutoFS Map Types

Direct Map

Indirect Map

Advantage: A user can see the contents of a direct-mounted directory with the ls command. If the contents are not currently mounted, ls causes them to be mounted.

Advantage: AutoFS 2.3 allows a user to see the available mount points for indirect maps without having to actually mount each file system when browsability is enabled by default.

Advantage: Direct-mounted automounted directories can share the same parent directory with local or standard-mounted files and directories.

Disadvantage: An indirect map hides any local, standard-mounted, or direct-mounted files or directories underneath the mount point for the map.

Disadvantage: If you add or remove mounts in a direct map, or if you change the local mount point for an existing mount in a direct map, you have to force AutoFS to reread its maps.

Advantage: If you modify an indirect map, AutoFS will see the changes the next time it mounts the directory, so you do not have to force AutoFS to reread its maps.

Disadvantage: When automount reads a direct map, it creates an entry for each automounted directory in the internal mount table, /etc/mnttab. This can cause the mount table to become very large.

Advantage: When automount reads an indirect map, it creates only one entry for the entire map in the internal mount table, /etc/mnttab. Additional entries are created as directories are actually mounted. The mount table takes up no more space than necessary, because only mounted directories appear in it.

 

How AutoFS Sets Up Direct and Indirect Mounts

The automounts configured in a direct map may be mounted in various places in the local file system; they do not have to be located under the same parent directory.

The automounts configured in an indirect map are all mounted under the same local parent directory.

Figure 2-7 “The Difference Between Direct Mounts and Indirect Mounts” shows the difference between direct mounts and indirect mounts on an NFS client.

Figure 2-7 The Difference Between Direct Mounts and Indirect Mounts

The Difference Between Direct Mounts and Indirect Mounts

Mounting a Remote Directory Using a Direct AutoFS Map

  1. If you are using local files for your AutoFS 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 a line to the direct map with the following syntax:

    local_directory [mount_options] server:remote_directory

    For CIFS file system mount entries in AutoFS direct map files, the mount option for the filesystem type, fstype, must be set to cifs. The remote server must be a CIFS server and remote directory must be a CIFS share.

    If you are using NIS to manage your AutoFS maps, add the line to the direct map on the NIS master server.

  2. If you are using local files for your AutoFS maps, use an editor to open or create the AutoFS master map in the /etc directory. The master map should be called /etc/auto_master. If you are using NIS, open the master map on the NIS master server.

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

    /-  direct_map_name  [mount_options]
  3. If you are using NIS to manage your AutoFS maps, issue the following commands on the NIS master server to rebuild the maps and push them to the slave servers:

    cd /var/yp
    /usr/ccs/bin/make auto_master auto_direct
  4. On each host that will use the map you have modified, issue the following command to force AutoFS to read the modified map:

    /usr/sbin/automount

The local directory you configure as the mount point should be empty or non-existent. AutoFS will create any non-existent directories between the root directory and the configured mount point. If the local directory you configured as the mount point is not empty, any local files or directories in it will be hidden and inaccessible while the automounted filesystem is mounted over it.

CAUTION: Do not automount a remote directory on a local directory that is a symbolic link.

If you are using NIS to manage your AutoFS maps, you should be careful of situations where the NIS server is also the server from which filesystems will be automounted. If the mount point specified by the NIS map is the same as the actual source directory on the server, then AutoFS may attempt to mount the source directory over itself when a user accesses the mount point on the NIS server. This could result in the directory becoming unavailable.

The mount options that you can specify in the AutoFS maps are the same ones that you would use for the type of filesystem you attempt to automount. The mount options are the same ones used for standard NFS mounted directories. For detailed mount options, see “Changing the Default Mount Options” for a list of mount options. The bg option cannot be used 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 your direct automounts in the same map. Many people use the file name /etc/auto_direct for their direct map. If you plan to use NIS to manage your AutoFS maps, you can have only one direct map in your configuration. If you plan to use NIS to manage your AutoFS maps, and your file system does not allow file names longer than 14 characters, keep the map name to 10 characters or fewer.

If the direct map name in the AutoFS master map begins with a slash (/), AutoFS assumes 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 or an NIS map. See Chapter 6 “Configuring the Name Service Switch”.

Before you can mount a remote directory on your system, the remote system where the directory is located must be configured as an NFS server and must export the directory.

You must enable AutoFS before any directories can be automounted.

Automounted directories stay mounted until they are left idle for ten minutes. The ten minute default can be changed by adding the -t duration option to the AUTOMOUNT_OPTIONS variable in the /etc/rc.config.d/nfsconf file or by running the automount command with the -t option from the command line.

If you change the mount options, the remote server name, or the remote directory name for an existing direct mount while AutoFS is running, the changes you made will take effect the next time the directory is mounted. However, if you change the local directory name in the direct map, or if you change the master map, these changes will not take effect until you issue the automount command to force AutoFS to reread its maps.

For more information on AutoFS configuration, see man page automount(1M).

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

Example File Entries for NFS Direct Automounts

Following are example lines from an AutoFS direct map on NFS client sage. The sharp sign (#) indicates a comment 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

Following are example lines from the AutoFS master map on NFS client sage.

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

/- /etc/auto_direct

Figure 2-8 illustrates how the AutoFS sets up the direct mounts for this configuration.

Figure 2-8 Example of Direct Mounts

Example of Direct Mounts

Mounting a Remote Directory Using an Indirect AutoFS Map

  1. 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

    For CIFS file system mount entries in AutoFS indirect map files, the mount option for the filesystem type, fstype, must be set to cifs.The remote server must be a CIFS server and remote directory must be a CIFS share.

    If you are using NIS to manage your AutoFS maps, add the line to an indirect map on the NIS master server.

  2. If you are using local files for your AutoFS maps, use an editor to open or create AutoFS master map in the /etc directory. The master map should be called /etc/auto_master. If you are using NIS, open the master map on the NIS master server.

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

    local_parent_directory indirect_map_name [mount_options]
  3. If you are using NIS to manage your AutoFS maps, issue the following commands on the NIS master server to rebuild the maps and push them to the slave servers:

    cd /var/yp
    /usr/ccs/bin/make auto_master indirect_mapname
  4. If you modified the AutoFS master map, issue the following command on each host that will use the map, to force AutoFS to read the modified master map:

    /usr/sbin/automount

The local_subdirectory specified in the indirect map is the deepest subdirectory in the local directory pathname. For example, if you were mounting a remote directory on /nfs/apps/draw, the local_subdirectory specified in the indirect map would be draw.

The local_parent_directory specified in the master map is all but the deepest subdirectory in the local directory pathname. For example, if you were mounting a remote directory on /nfs/apps/draw, the local_parent_directory specified in the master map would be /nfs/apps.

The local_parent_directory and local_subdirectory should not exist; AutoFS will create them when it mounts the remote directory. If the local_parent_directory or local_subdirectory contains files or directories, they will be hidden beneath the remote directory when it is mounted.

CAUTION: The local_subdirectory and local_parent_directory must not be symbolic links.

If you are using NIS to manage your AutoFS maps, make sure the local mount point is different from the exported directory on the server. If they are the same, the server may attempt to mount its exported directory over itself, and the directory will become unavailable.

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

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

Indirect maps are usually called /etc/auto_name, where name is something that helps you remember what is configured in the map. If you plan to use NIS to manage your AutoFS maps, and if your file system does not support file names longer than 14 characters, keep your indirect map names to 10 characters or fewer.

If the indirect map name in the AutoFS master map begins with a slash (/), AutoFS assumes 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 or an NIS map. See Chapter 6 “Configuring the Name Service Switch”.

Before you can mount a remote directory on your system, the remote system where the directory is located must be configured as an NFS server and must export the directory.

Automounted directories stay mounted until they are left idle for ten minutes. The ten minute default can be changed by adding the -t duration option to the AUTOMOUNT_OPTIONS variable in the /etc/rc.config.d/nfsconf file or by running the automount command with the -t option from the command line.

You must enable AutoFS before any directories can be automounted. See “Enabling AutoFS”.

If AutoFS is already running when you add an indirect mount to your configuration, you do not have to run the automount command unless you change the master map. Any changes you make to an existing indirect map will take effect the next time AutoFS mounts the directory. However, changes to the master map will not take effect until you issue the automount command to force AutoFS to reread its maps.

For more information on AutoFS configuration, see man page automount(1M).

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

Example File Entries for NFS Indirect Automounts

Following are example lines from an AutoFS indirect map on NFS client sage. The sharp sign (#) indicates a comment. Everything from the sharp sign to the end of the line is ignored by AutoFS.

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

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

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

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

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

Figure 2-9 “How AutoFS Sets Up NFS Indirect Mounts” illustrates how AutoFS sets up the indirect mounts for this configuration.

Figure 2-9 How AutoFS Sets Up NFS Indirect Mounts

How AutoFS Sets Up NFS Indirect Mounts

Executable Maps

An executabe map has its entries generated dynamically by a program or a script. AutoFS determines whether a map is executable by checking whether the execute bit is set in its permissions string. If a map is not executable, make sure its execute bit is not set. When AutoFS daemon locates a map and its execute bit is set, then intead of opening the file and searching for an entry, the AutoFS daemon executes the file as a program and passes the key to be located within the map as an argument. The executable AutoFS maps return a map entry on the standard output . If they cannot supply a map entry for the key, they should return nothing.You can list executable AutoFS maps in the master map, or include them in local AutoFS map files.

For example,the following executable map, implemented as a shell script, emulates the AutoFS built-in -hosts map for /net. It obtains a list of exported filesystems from an NFS server (its name given as the key argument), formats the pathnames into a multiple-mount map entry, and sorts the list to order the mounts correctly into a top-down hierarchy:

# ! /bin/sh
Server=$1
showmount -e $1 | awk ‘{print $1 “\t’$Server’: $1 “\\”} | sort 

Configuring Multiple (Replicated) Servers for an AutoFS Directory

  1. Follow the instructions in “Mounting a Remote Directory Using a Direct AutoFS Map” or “Mounting a Remote Directory Using an Indirect AutoFS Map”.

  2. In the direct or indirect map, modify the line that mounts the remote directory so that multiple servers are listed.

    • If the remote directory has a different name on the different servers, use a syntax such as the following example from a direct map:

      /nfs/proj2/schedule -ro  \ broccoli:/export/proj2/schedule\
      cauliflower:/proj2/FY94/schedule

      AutoFS reads this entry as one line. The line has been broken for readability, and the backslash (\) tells AutoFS that the line continues after the line break.

    • If the remote directory has the same name on every server, use a syntax like the following example from an indirect map:

      man  -ro  broccoli,cabbage,cauliflower:/usr/share/man
    • You can assign weights to the various servers, by specifying a number in parentheses after each server name. The lower the weight number, the more likely the server is to be selected.

      man -ro\ broccoli(1),cabbage(2),cauliflower(3):/usr/share/man

      Servers with no weight specified have a default weight of zero (most likely to be selected).

      Server proximity is more important than the weights you assign. A server on the same network segment as the client is more likely to be selected than a server on another network segment, regardless of the weights you assign. The weight has effect only when selecting between servers with the same network proximity.

  3. The /etc/netmasks file is required by AutoFS to determine the local client’s subnets in the replicated servers environment. The /etc/netmasks file must be created and configured manually for the replicated servers functionality to work properly.

    The /etc/netmasks file contains Internet Protocol (IP) address masks with IP network numbers. It supports both standard subnetting as specified in RFC-950 and variable length subnetting as specified in RFC-1519. When using the standard subnetting, there should be a single line for each network with the network number and the network mask to use on that network. The network number and mask can be specified in the conventional IP ‘.’(dot) notation. The network number is restricted to be a class A, B or C network number. For example:

    # network number            netmask

     128.32.0.0               255.255.255.0

    When using variable length subnetting, the format is identical. However, there should be a line for each subnet with the first field being the subnet and the second field being the netmask.

    The following example shows how AutoFS uses /etc/netmasks file to determine the local client’s subnets in the replicated servers environment. In this example, servers sage and thyme export /nfs/mont, the IP address for server sage is 15.43.232.30 and the IP address for server thyme is 15.244.10.20:

    # /etc/auto_direct file

    /nfs_mount         sage,thyme:/user

    #/etc/netmasks file on the client basil:

    #network number    netmask

    15.43.234.210    255.255.248.0

    AutoFS uses /etc/netmasks file to determine the local client’s subnets and mounts /nfs/mount from the server sage on the local subnet.

Directories with multiple servers should be mounted read-only to ensure that the versions remain the same on all the servers.

The server chosen for the mount is the one with the strongest preference based on a sorting order. The sorting order used gives strongest preference to servers on the same local subnet, servers on the local net are given the second strongest preference.So, if you configure multiple servers on both sides of a gateway, a server on the same side of the gateway as the NFS client will always be used. Among servers equally far away, response times will determine the order if no wighting factors are used. Multiple servers give users reliable access to a mounted directory, because if one server is down, the directory can be mounted from another. Also, multiple servers provide some load balancing across the network; a server that is not busy will respond more quickly to AutoFS poll than one that is heavily loaded, so the directory will be mounted from the server that is not busy.

If the list of multiple servers contains some servers using the NFS Version 2 Protocol and some servers using the NFS Version 3 Protocol, then AutoFS chooses a subset of the list having only servers with the same protocol. This subnet is formed of servers using the NFS Version 3 Protocol, unless there are no such servers on the list or there is a server using NFS Version 2 Protocol that has the strongest preference.

Use Environment Variables as Shortcuts in AutoFS Maps

  1. Use an environment variable anywhere in a direct or indirect AutoFS map except the first field, which specifies the local mount point. An environment variable must be preceded by a dollar sign ($) or enclosed in curly braces {}. The following direct map uses a variable called HOST:

    /private_files  sage:/export/private_files/$HOST
  2. Add the -D option to the AUTOMOUNTD_OPTIONS variable in the /etc/rc.config.d/nfsconf file to assign a value to the variable, as in the following example:

    AUTOMOUNTD_OPTIONS=”-D HOST='hostname'”

The example shown above assumes that NFS server sage has subdirectories in its /export/private_files directory that are named after the hosts in its network. Every host in the network can use the same AutoFS map and the same AUTOMOUNTD_OPTIONS definition to mount its private files from server sage.

For example, when AutoFS starts up on host basil, it assigns the value basil to the HOST variable. Then, when someone requests access to the local /private_files directory on basil, AutoFS mounts /export/private_files/basil from server sage.

Any environment variable that is set to a value may be used in an AutoFS map. If you do not set the variable with the -D option in /etc/rc.config.d/nfsconf, AutoFS uses the current value of the environment variable on the local host.

You cannot use environment variables in the AutoFS master map.

Use Wildcard Characters as Shortcuts in AutoFS Maps

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

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

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

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

Following is the line from the AutoFS master map /etc/auto_master that lists the indirect map /etc/auto_home.

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

/home /etc/auto_home -nosuid

Following is the line from the AutoFS indirect map /etc/auto_home that mounts users’ home directories on demand.

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

*                                       basil:/export/home/&

A user’s home directory is configured in the /etc/passwd file as /home/username. For example, the home directory of user terry is /home/terry. When Terry logs in, AutoFS looks in 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 server basil to /home/terry on the local NFS client.

The ampersand character can be used to represent both the remote server and the remote subdirectory, in the same line of the indirect map. For example, if users’ 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 will mount all users’ home directories from any server:

*         &:/export/home/&

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

The line with the asterisk and ampersand should 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. The asterisk (*) matches any subdirectory, so AutoFS stops reading at the line with the asterisk, because it has found a match. Any lines after the asterisk are never read.

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 host basil. The asterisk is a match for charlie, so 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 will mount Charlie’s home directory from host thyme and everyone else’s home directory from host basil.

For more information on AutoFS configuration, see man page automount(1M).

Automounting Home Directories

  1. Make sure the machines where users’ home directories are located are set up as NFS servers and are exporting the home directories. See “Configuring and Administering an NFS Server”.

  2. In the /etc/passwd file on the NFS clients, or in the NIS passwd map or NIS+ passwd table, configure the home directory of each user as the NFS mount point where the user’s home directory will be mounted. For example, if home directories are mounted under /home, Claire’s home directory would be configured as /home/claire in the /etc/passwd file.

  3. If you are using local files for your AutoFS maps, create a file called /etc/auto_home on the NFS clients, and add a line to it for each user, such as the following example. If you are using NIS to manage your AutoFS maps, add the lines to the /etc/auto_home file on the NIS master server.

    sammy       thyme:/export/home/&     -nosuid

    The ampersand (&) character takes the value of the user name in each line. In the example above, user sammy’s home directory is physically located on host thyme in /export/home/sammy.

  4. If you are using local files for your AutoFS maps, add the following line to AutoFS master map, /etc/auto_master, on the NFS clients:

    /home  /etc/auto_home

    If you are using NIS to manage your AutoFS maps, add the line to the /etc/auto_master file on the NIS master server.

  5. If you are using NIS to manage your AutoFS maps, issue the following commands on the NIS master server to rebuild the maps and push them to slave servers:

    cd /var/yp
    /usr/ccs/bin/make auto_master
  6. Issue the following command, on each NFS client that will use these AutoFS maps, to force AutoFS to reread the maps:

    /usr/sbin/automount

Before you can automount home directories, you must enable AutoFS. See “Enabling AutoFS”.

Example of Automounting a User’s Home Directory

User Howard’s home directory is located on NFS server basil, where it is called /export/home/howard. On all the machines in the network, Howard has the following entry in the /etc/passwd file:

howard:*:700:70:Howard:/home/howard:/usr/bin/ksh

When Howard logs into any NFS client, AutoFS recognizes /home as an AutoFS mount point, because it is configured in the master map:

/home  auto_home

AutoFS reads the auto_home map to find out how to mount Howard’s home directory. It finds the following line:

howard       basil:/export/home/&     -nosuid

AutoFS substitutes howard for the ampersand (&) character in that line:

howard    basil:/export/home/howard   -nosuid

AutoFS mounts /export/home/howard from server basil to the local mount point /home/howard on the NFS client. Figure 2-10 “Home Directories Automounted with Wildcards” illustrates this configuration:

Figure 2-10 Home Directories Automounted with Wildcards

Home Directories Automounted with Wildcards

Automounting Multiple Directories Simultaneously (Hierarchical Mounts)

Use an editor to create an entry with the following format in a direct or indirect AutoFS map. (Create the map, if necessary, and add it to the AutoFS master map.)

local_dir   /local_subdirectory [-options] \ server:remote_directory \
/local_subdirectory [-options] server:remote_directory \ ..

The backslash (\) characters tell AutoFS to ignore the line breaks, so this entry is effectively all one line.

Map entries with this format cause all the remote directories on the line to be mounted at the same time. For example, the following entry from a direct map mounts the source code and the data files for a project whenever anyone requests access to both of them, they are mounted for on-demand mounting.

/our_project   /source   -ro    broccoli:/opt/proj1/src  \
/datafiles cauliflower:/opt/proj1/samples/data

Here is another example from an indirect map. In this example, the same mount option (nosuid) applies to all three automounted directories.

chap2 -nosuid   /text       sage:/our_book/chap2  \
/graphics basil:/our_book/artwork/chap2 \
   /old   sage:/our_book/oldfiles/chap2

Including an AutoFS Map in Another AutoFS Map

  • To include the contents of an AutoFS map in another AutoFS map, add a plus sign (+) before the map name, as in the following example:

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

    basil -nosuid basil:/export/home/basil
    +auto_home

Assume the /etc/auto_home map is listed in the master map with the following line:

/home           /etc/auto_home

This example causes the following:

If a user logs in whose home directory is in /home/basil, AutoFS will mount the directory /export/home/basil from host basil.

If a user logs in whose home directory is in /home/sage, /home/thyme, or any subdirectory of /home other than basil, AutoFS will consult the NIS map auto_home for information on mounting the user’s home directory.

The plus sign (+) tells AutoFS to look in a different map for the information it needs to mount the directory. If the map name following the plus sign begins with a slash, AutoFS assumes it is a local file. If the map name contains no slashes, AutoFS uses the Name Service Switch to determine whether it is a file or an NIS map. See Chapter 6 “Configuring the Name Service Switch”.

You can include an AutoFS map inside a local file but not inside an NIS map.

See the following man pages for more information: automount(1M) or nsswitch.conf(4).

Creating a Hierarchy of AutoFS Maps

An organization made up of many departments may wish to organize a shared automounted directory structure. In the following example, the shared top-level directory is called /org. The /org directory contains several subdirectories, listed in the auto_org AutoFS map. Each department administers its own AutoFS map for its subdirectory.

The AutoFS master map needs only a single entry for /org:

# auto_master map
# Directory Map Name

/org auto_org

The auto_org map looks like this:

finance    -fstype=autofs    auto_finance
marketing -fstype=autofs auto_marketing
legal -fstype=autofs auto_legal
research -fstype=autofs auto_research
eng -fstype=autofs  auto_eng

And the engineering department’s map, auto_eng, looks like this:

releases                      bigiron:/export/releases
tools                         mickey,minnie:/export/tools
source -fstype=autofs auto_eng_source
projects     -fstype=autofs   auto_eng_projects

A user in the blackhole project within engineering might use the following path:

/org/eng/projects/blackhole

Beginning with the AutoFS mount at /org, the evaluation of this path would dynamically create additional AutoFS mounts at /org/eng and /org/eng/projects. Since AutoFS mounts are created only when needed, changes to maps require no action to become visible at the user’s workstation. The automount command needs to be run only when changes are made to the master map or to a direct map.

Hierarchical AutoFS maps provide a framework within which large shared filesystems can be organized. Together with NIS, which allows you to share information across administrative domains, the maintenance of the shared namespace can be effectively decentralized.

Turning Off an AutoFS Map with the -null Map

  1. Add a line with the following syntax to AutoFS master map:

    local_directory -null
  2. If AutoFS is running, issue the following command on each client that will use the map, to force AutoFS to reread its maps:

    /usr/sbin/automount

The -null option turns off the map that is mounted on local_directory. For example, if the NIS auto_master map mounts the auto_home map on /home, and you include the following line in your local /etc/auto_master file,

/home -null

the NIS auto_home map will not be used on your system.

The -null option is useful for turning off NIS AutoFS maps that do not apply to your host.

You can also replace NIS maps with local maps, as in the following example from /etc/auto_master:

/home /etc/auto_ourhome

Because AutoFS reads the local /etc/auto_master file before the NIS auto_master map, this entry causes AutoFS to look for mount information in the local file /etc/auto_ourhome instead of the auto_home NIS map.

To use a local AutoFS master map, make sure the AUTOMOUNT_OPTIONS variable in /etc/rc.config.d/nfsconf includes the string -f $AUTO_MASTER, and make sure the AUTO_MASTER variable is set to the name of your local AutoFS master map file.

For more information, see man page automount(1M).

AutoFS 2.3 Support for HP CIFS Client

AutoFS 2.3 now supports the integration with HP CIFS Client to enable the automatic mounting and unmounting of CIFS filesystems. HP CIFS Client must be installed and configured on the system along with AutoFS 2.3 for this feature to be enabled. More information on CIFS Client installation and configuration can be found in HP CIFS Client Administrator’s Guide. AutoFS 2.3 only supports the automatic mounting of CIFS filesystems with direct and indirect map; it does not support CIFS filesystem mounts with special or executable map files, or with multiple (replicated) servers.

The following procedures must be used to use AutoFS with the HP CIFS Client:

  1. The filesystem type mount option, fstype, must be set to cifs in all of the CIFS file system mount entries of the AutoFS direct and indirect map files.

  2. The remote system and directory of the CIFS file system mount entries must be a CIFS server and a share exported by the CIFS server; i.e. cifsSrv:/share.

  3. The user authentication to the CIFS Server must be enabled so that the user can have access to the mounted CIFS filesystems. List below are options for authentication methods, more information on CIFS authentication can be found in Chapter 3 of HP CIFS Client Administrator ‘s Guide.

    1. Supply a user name and password in the CIFS mount entry of the direct or indirect map file

    2. Enable one of the following CIFS Client automatic login options:

      1. Store CIFS user password in the CIFS Client database

      2. Enable guest user support where all unauthenticated users are automatically logged on as same guest user

      3. Integrate with PAM NTLM cache

      4. Integrate with system Kerberos cache (kinit(1) and PAM Kerberos)

Example File Entries for CIFS Direct Map Automounts

Following are example lines from an AutoFS direct map on CIFS client mamoth. The sharp sign (#) indicates a comment line.

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

/cifs/mnt1 -fstype=cifs,username=user,password=cifs \ WinSrv1:/cifs-share1

Following are example lines from the AutoFS master map on CIFS client mamoth:

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

/-                       /etc/auto_direct_cifs

Figure 2-11 “Example of CIFS Direct Mounts” illustrates how the AutoFS sets up the direct mounts for this configuration.

Figure 2-11 Example of CIFS Direct Mounts

Example of CIFS Direct Mounts

Example File Entries for CIFS Indirect Map Automounts

Following are example lines from an AutoFS indirect map on CIFS client mamoth. The sharp sign (#) indicates a comment. Everything from the sharp sign to the end of the line is ignored by AutoFS.

# /etc/auto_indirect_cifs
# local mount point  mount options remote server:directory

cifs_mnt1 -fstype=cifs,username=user1,password=cifs\ WinSrv1:/cifs-share1
cifs_mnt2 -fstype=cifs,username=user2,password=cifs\ WinSrv2:/cifs-share2

Following are example lines from the AutoFS master map on CIFS client mamoth. The master map also includes an entry for the direct map /etc/auto_direct.

# /etc/auto_master file
# local mount point map name mount options
/cifs/desktop             /etc/auto_indirect_cifs

Figure 2-12 illustrates how AutoFS sets up the indirect mounts for this configuration.

Figure 2-12 How AutoFS Sets Up CIFS Indirect Mounts

How AutoFS Sets Up CIFS Indirect Mounts

Enabling AutoFS

  1. In the /etc/rc.config.d/nfsconf file, make sure the NFS_CLIENT and AUTOFS variables are set to 1, as follows:

    NFS_CLIENT=1 
    AUTOFS=1
  2. If you will use a local file as your AutoFS master map, make sure the AUTO_MASTER variable in /etc/rc.config.d/nfsconf is set to the name of your AutoFS master map. (The default master map name is /etc/auto_master.)

    AUTO_MASTER=”/etc/auto_master”

    If you will use an NIS AutoFS master map, remove -f $AUTO_MASTER from the AUTOMOUNT_OPTIONS variable.

  3. Issue the following command to run the NFS client startup script:

    /sbin/init.d/nfs.client start

When AutoFS starts up, if your AUTOMOUNT_OPTIONS variable specifies a master map file with the -f filename option, AutoFS will look for a file by that name on the local host. It can also use the Name Service Switch to determine which name services you are using and find the master maps that are available from those name services. If your AUTOMOUNT_OPTIONS variable does not specify the -f filename option, AutoFS will consult the Name Service Switch configuration to determine where to look for your AutoFS master map.

See the following man pages for more information: nsswitch.conf(4) or automount(1M).

Disabling AutoFS

  1. Issue the following command to run the NFS client shutdown script:

    /sbin/init.d/nfs.client stop
  2. In the /etc/rc.config.d/nfsconf file, make sure the NFS_CLIENT is set to 1, and the AUTOFS variable is set to 0, as follows:

    NFS_CLIENT=1 
    AUTOFS=0
CAUTION: Do not kill the automountd daemon with the kill command. It does not terminate gracefully. It does not unmount AutoFS mount points before it dies. Use the nfs.client stop script to ensure that automountd dies cleanly.

After you have disabled AutoFS using the nfs.client stop script, you may notice that the autofskd process is still running. autofskd is the kernel daemon, it is dormant when the AutoFS variable is 0. You can safely ignore this process. (The autofskd cannot be killed; the only way to stop autofskd is to reboot.)

Verifying the AutoFS Configuration

  1. Type the following command to change the current working directory to an automounted directory:

    /usr/bin/cd local_directory

    where local_directory is the configured mount point in the AutoFS map.

  2. Type the following command to verify that the contents of the remote directory have been mounted under the local mount point:

    /usr/bin/ls

If the directory is configured in an indirect map, issuing the ls command from the parent directory will display potential mount points (browsability). When you cd to a subdirectory configured in the indirect map, or issue the command ls subdirectory, the subdirectory will be mounted.

Therefore, if you have the following indirect map configuration,

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

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

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

and you issue the following commands,

cd /nfs/desktop
ls

the ls command will diplay

draw         write

because the draw and write subdirectories are the potential mount points(browsability), but not currently mounted. However, if you issue the following commands,

cd /nfs/desktop/write
cd /nfs/desktop/draw

Now, both draw and write subdirectories are mounted(on-demand mounting).

If AutoFS is not mounting your configured directories, see Chapter 8 “Troubleshooting NFS Services”.

Modifying or Removing an Automounted Directory Within a Map

  1. If you are planning to remove an automounted directory, issue the following command to determine whether the directory is currently in use:

    /usr/sbin/fuser -cu local_mount_point

    This command lists the process IDs and user names of everyone using the mounted directory.

  2. Warn any users to cd out of the directory, and kill any processes that are using the directory, or wait until the processes terminate. You can issue the following command to kill all the processes using the mounted directory:

    /usr/sbin/fuser -ck local_mount_point
  3. Use an editor to make your changes to the direct or indirect map.

  4. If you removed all of the entries in the direct or indirect map, remove that map‘s entry in the AutoFS master map.

  5. If you made any changes to the master map, or if you added or modified a local mount point in a direct map, run the following command to force AutoFS to reread its maps:

    /usr/sbin/automount
CAUTION: File systems under the management of AutoFS must always be maintained through AutoFS utilities, automountd and automount. Manually mounting and unmounting AutoFS managed file systems can lead to disruptive or unpredictable results, including but not limited to: commands hanging or not returning expected results, and applications failing due to their dependencies on these mounted filesystems.

Restarting AutoFS

AutoFS rarely needs to be restarted. In case there is a need to restart AutoFS, please use the following procedures to do it:

  1. Issue the following scripts to find a list of all the automounted directories on the client:

    for FS in $(grep autofs /etc/mnttab | awk ‘{print $2}’)
    do 
      grep ‘nfs’ /etc/mnttab | awk ‘{print $2}’ | grep ^${FS} 
    done
  2. For every automounted directory listed by the grep command, issue the following command to determine whether the directory is currently in use:

    /usr/sbin/fuser -cu local_mount_point

    This command lists the process IDs and user names of everyone using the mounted directory.

  3. Warn any users to cd out of the directory, and kill any processes that are using the directory, or wait until the processes terminate. You can issue the following command to kill all the processes using the mounted directory:

    /usr/sbin/fuser -ck local_mount_point
  4. Issue the following commands to kill the AutoFS:

    /sbin/init.d/nfs.client stop
    CAUTION: Do not kill the automountd daemon with the kill command. it does not die gracefully. It does not unmount AutoFS mount points before it dies. Use the nfs.client stop script to ensure that automountd dies cleanly.
  5. Type the ps command to make sure AutoFS is no longer active:

    /usr/bin/ps -ef | grep automount

    If the ps command indicates AutoFS is still active, make sure all users are out of the automounted directories and then try again. Do not restart AutoFS until all automount processes have terminated.

  6. Issue the following command to start the AutoFS:

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