| United States-English |
|
|
|
![]() |
Enhanced AutoFS Administrator's Guide: HP-UX 11i v1 > Chapter 3 Configuring
and Administering AutoFSMounting a Remote Directory |
|
This section provides detailed information on how to mount a remote directory using both the direct and indirect AutoFS maps. To mount a remote directory using a direct AutoFS map, perform the following steps:
The local directory that you configure as the mount point should be empty or non-existent. AutoFS creates the non-existent directories between the root directory and the configured mount point. If the local directory that you configured as the mount point is not empty, the local files or directories in it are hidden and inaccessible while the automounted file system is mounted over it.
The mount options that you can specify in the AutoFS maps are the same ones that you use for the type of file system you attempt to automount. For more information on the mount options, see the “Changing the Default Mount Options” section of NFS Services Administrator’s Guide. You cannot use the bg option for an automounted directory. The mount options configured in the direct map override the options in the master map if there is a conflict. You can configure all your direct automounts in the same map. Many users 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, restrict the map name to 10 characters or fewer. If the direct map name in the AutoFS master map begins with a slash (/), it is a local file for AutoFS. If the direct map does not contain a slash, AutoFS uses the Name Service Switch to determine whether it is a file or an NIS map. See the “Configuring the Name Service Switch” chapter of NFS Services Administrator’s Guide. Before you can mount a remote directory on your system, ensure that you configure the remote system where the directory is located as an NFS server. In addition, ensure that you export the directory. You must enable AutoFS before any directory is automounted. Automounted directories stay mounted until they are idle for 10 minutes. You can change the 10-minute default time 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 the automount(1M) man page.
The following example contains sample lines from an AutoFS direct map on the NFS client, sage. The sharp sign (#) indicates a comment line.
The following example contains sample lines from the AutoFS master map on the NFS client, sage.
Figure 3-6 “Example of Direct Mounts” illustrates how AutoFS sets up the direct mounts for this configuration. To mount a remote directory using an indirect AutoFS map, perform the following steps:
The local_subdirectory specified in the indirect map is the deepest subdirectory in the local directory path name. For example, if you were mounting a remote directory on /nfs/apps/draw, the local_subdirectory specified in the indirect map is draw. The local_parent_directory specified in the master map is all but the deepest subdirectory in the local directory path name. For example, if you were mounting a remote directory on /nfs/apps/draw, the local_parent_directory specified in the master map is /nfs/apps. The local_parent_directory and local_subdirectory should not exist; AutoFS creates them when it mounts the remote directory. If the local_parent_directory or local_subdirectory contains files or directories, they are hidden beneath the remote directory when it is mounted.
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 a list of mount options, see the “Changing the Default Mount Options” section of NFS Services Administrator’s Guide. 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. 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, you can configure indirect mounts with the local mount points, /nfs/apps/draw and /nfs/apps/word, in the same indirect map. Indirect maps are usually called /etc/auto_name, where name helps you in identifying 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, restrict your indirect map names to 10 characters or fewer. If the indirect map name in the AutoFS master map begins with a slash (/), then it is a local file for AutoFS. 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 “Configuring the Name Service Switch” chapter of NFS Services Administrator’s Guide. Before you can mount a remote directory on your system, ensure to configure the remote system where the directory is located as an NFS server. In addition, make sure to export the directory. Automounted directories stay mounted until they are idle for ten minutes. You can change the ten-minute default time 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 directory is automounted. See “Enabling Enhanced 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. The changes you make to an existing indirect map take effect when AutoFS mounts the directory the next time. 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 the AutoFS configuration, see the automount(1M) man page.
The following example contains sample lines from an AutoFS indirect map on the NFS client, sage. The sharp sign (#) indicates a comment. AutoFS ignores everything from the sharp sign to the end of the line.
The following example contains sample lines from the AutoFS master map on the NFS client, sage. The master map also includes an entry for the direct map, /etc/auto_direct.
Figure 3-7 “Example of Indirect Mounts” illustrates how AutoFS sets up the indirect mounts for this configuration. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||