AutoFS is a client-side service that automatically mounts remote
filesystems. During system startup, AutoFS is initialized by the automount command. The automount daemon, automountd, runs continuously and mounts and unmounts remote directories as
required.
When a client running automountd attempts
to access a remote file or a remote directory, automountd mounts it, if it has been configured. If the mounted remote filesystem
is not accessed for a certain period of time, it is automatically
unmounted.
AutoFS uses maps to navigate the network. Maps define the mount-points
that AutoFS will mount. AutoFS can mount both directories and files.
For more information on AutoFS maps, see “Maps Overview”.
Following sections describe the different components of AutoFS
that work together to automatically mount and unmount filesystems,
in detail.
AutoFS Filesystem |
 |
The AutoFS filesystem is a virtual filesystem that provides
a directory structure to enable automatic mounting of filesystems.
It includes autofskd, a kernel-based process that
periodically cleans up mounts. The filesystem interacts with the automount command and the automountd daemon to mount filesystems automatically.
The automountd Daemon |
 |
The automountd daemon is a stateless, multi-threaded
daemon that mounts or unmounts directories and filesystems by accepting
Remote Procedure Calls (RPC) requests.
Figure 3-1 illustrates how
the AutoFS components interact.
The automount command reads the AutoFS master
map to create the initial set of AutoFS mount-points in the internal
mount table, /etc/mnttab. The automounted filesystems
are not mounted automatically at startup. The automounted filesystems
are points under which the filesystems are mounted when the clients
request access to them.
When AutoFS receives a request to mount a filesystem, it calls
the automountd daemon, which mounts the requested
filesystem. AutoFS mounts the filesystems at the configured mount-points.
The automountd daemon is independent of the automount command. This separation enables you to add,
delete, or modify the AutoFS map information, without stopping and
restarting the automountd daemon. You can modify
the set of mount-points by modifying the AutoFS maps and by running
the automount command to read them and update the
mount table.
If an automounted filesystem remains idle for a specified period
of time (the default is 10 minutes), AutoFS unmounts it. To change
the duration, in seconds, for which a file system is to remain mounted
when not in use, use the -t option of the automount command. For more information on the different
options supported by automount, see automount(1M) and automountd(1M).
 |
 |  |
 |
 | CAUTION: You must maintain filesystems managed by AutoFS, by using the automountd and automount utilities.
Manually mounting and unmounting file systems managed by AutoFS can
cause disruptive or unpredictable results, including but not limited
to commands hanging or not returning expected results. Applications
can also fail because of their dependencies on these mounted filesystems. |
 |
 |  |
 |