| United States-English |
|
|
|
![]() |
NFS Services Administrator’s Guide: HP-UX 11i version 3 > Chapter 3 Configuring and Administering AutoFSAdvanced AutoFS Administration |
|
This section presents advanced AutoFS concepts that enable you to improve mounting efficiency and also help make map building easier. This section addresses: AutoFS enables you to automount multiple directories simultaneously. Use an editor to create an entry with the following format in a direct or indirect map, and if needed, create the auto_master entry:
Adding these map entries does not automatically mount them. The listed remote directories are mounted only when referenced. 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:
The following is another example from an indirect map.
The nosuid mount option applies to all three automounted directories. For more information on the nosuid mount option, see automount(1M). This section describes how to configure multiple replicated servers for an AutoFS directory. Modify the entry that mounts the remote directory to list multiple servers in the appropriate map, as follows:
To configure multiple replicated servers for a directory, follow these steps:
The following example shows how AutoFS uses the /etc/netmasks file to determine the local client subnets in a multiple-server environment. In this example, servers basil and thyme export/nfs/mount. The IP address for server basil is 15.43.232.30, and the IP address for the server, thyme is 15.244.10.20:
AutoFS uses the /etc/netmasks file to determine that the masked value for the subnet of basil and the network number is the same (15. 42. 232. 0). This shows that the client is on the same network as basil. AutoFS then mounts /nfs/mount from basil on the local subnet. Directories with multiple servers must be mounted as read-only to ensure that the versions remain the same on all servers. The server selected for the mount is the one with the highest preference, based on a sorting order. The sorting order used gives highest preference to servers on the same local subnet. Servers on the local network are given the second strongest preference. As a result, if you configure multiple servers on both sides of a gateway, a server on the same side of the gateway as the NFS client is always preferred. For multiple servers outside the local network, and with no weighting factors assigned, the server with the lowest response time is used for the mount. Multiple servers provide users with reliable access to a mounted directory. If one server is down, the directory can be mounted from another. Moreover, multiple servers provide some load balancing across the network; a server that is not busy responds more quickly to an AutoFS poll than one that is heavily loaded. The directory is mounted from the server that is not busy. If the list of multiple servers contains a combination of servers that includes all versions of the NFS protocol, then AutoFS selects a subset of servers with the highest NFS protocol version configured. For example, a list contains a number of servers configured with the NFSv4 protocol, and a few servers configured with the NFSv2 protocol. AutoFS will use the subnet of servers configured with the NFSv4 protocol, unless a server configured with the NFSv2 protocol is closer. If you want your map to refer to an external map, you can do so by including the external map in your map. The entries in the external map are read as if they are part of your 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:
Assume that the /etc/auto_home map is listed in the master map with the following line:
If a user, whose home directory is in /home/basil, logs in, AutoFS mounts the /export/home/basil directory, from the host, basil. If a user, whose home directory is in /home/sage, /home/thyme, or any subdirectory of /home other than basil, logs in, AutoFS consults the auto_home map for information on mounting the user’s home directory. The plus (+) sign instructs AutoFS to look up 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 that 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, NIS map, or an LDAP map. You can include an AutoFS map inside a local file, but not inside an NIS or LDAP map. For more information on including a map in another map, see automount(1M). Hierarchical AutoFS maps provide a framework that enables you to organize large exported filesystems. Together with NIS, which allows you to share information across administrative domains, hierarchical maps enable you to decentralize the maintenance of a shared namespace. In the following example, an organization consisting of many departments, wants to organize a shared automounted directory structure. The shared top-level directory is called /org. The /org directory contains several subdirectories, which are listed in the auto_org map. Each department administers its own map for its subdirectory. The AutoFS master map needs only a single entry for /org as in the following example:
The auto_org map appears similar to the following:
The engineering department map, auto_eng, appears similar to the following:
A user in the blackhole project within engineering can use the following path:
Starting with the AutoFS mount at /org, the evaluation of this path dynamically creates additional AutoFS mounts at /org/eng and /org/eng/projects. No action is required for the changes to take effect on the user's system because the AutoFS mounts are created only when required. You need to run the automount command only when you make changes to the master map or to a direct map. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||