Language and Page Formatting Options
One drawback to using
/etc/fstabis that, regardless of how infrequently a user accesses the NFS mounted file system, the system must dedicate resources to keep the mounted file system in place. This is not a problem with one or two mounts, but when the system is maintaining mounts to a dozen systems at one time, overall system performance can suffer. An alternative to
/etc/fstabis to use the kernel-based
automountutility, which can mount and unmount NFS file systems automatically, saving resources.
autofsservice is used to control the
automountcommand through the
/etc/auto.masterprimary configuration file. While
automountcan be specified on the command line, it is more convenient to specify the mount points, hostname, exported directory, and options in a set of files rather than typing them manually.
autofsconfiguration files are arranged in a parent-child relationship. The main configuration file (
/etc/auto.master) lists mount points on the system that are linked to a particular map type, which takes the form of other configuration files, programs, NIS maps, and other less common mount methods. The
auto.masterfile contains lines referring to each of these mount points, organized in the following manner:
<mount-point>element specifies the location of the mount on the local file system. The
<map-type>specifies how the mount point is mounted. The most common method for auto mounting NFS exports is to use a file as the map type for the particular mount point. The map file is usually named
<mount-point>is the mount point designated in
auto.master. A line within map files to mount an NFS export looks like the following example:
</local/directory> -<options> <server>:</remote/export>
</local/directory;>with the local file system on which the exported directory is mounted. This mount point must exist before the map file is read, else the mount fails.
Replace <options> with a comma separated list of options for the NFS file system (refer to Section 9.4.3, “Common NFS Mount Options” for details). Be sure to include the hyphen character (
-) immediately before the options list.
<server>with the hostname, IP address, or fully qualified domain name of the server exporting the file system.
</remote/export>with the path to the exported directory.
Replace <options> with a comma separated list of options for the NFS file system (refer to Section 9.4.3, “Common NFS Mount Options” for details).
autofsconfiguration files can be used for a variety of mounts to many types of devices and file systems, they are particularly useful in creating NFS mounts. For example, some organizations store a user's
/home/directory on a central server via an NFS share, then configure the
auto.masterfile on each of the workstations to point to an
auto.homefile containing the specifics for how to mount the
/home/directory via NFS. This allows the user to access personal data and configuration files in their
/home/directory by logging in anywhere on the network. The
auto.masterfile in this situation would look similar to this:
This sets up the
/home/mount point on the local system to be configured by the
/etc/auto.homefile, which looks similar to the example below:
* -fstype=nfs4,soft,intr,rsize=32768,wsize=32768,nosuid server.example.com:/home
This line states that any directory a user tries to access under the local
/home/directory (due to the asterisk character) should result in an NFS mount on the
server.example.comsystem on the mount point
/home/. The mount options specify that each
/home/directory NFS mounts should use a particular collection of settings. For more information on mount options, including the ones used in this example, refer to Section 9.4.3, “Common NFS Mount Options”.
For more information about the
autofsconfiguration files, refer to the