automount Daemon
Purpose
Mounts automatic mount points.
Syntax
automount [ -m ] [ -n ] [ -v ] [ -t duration ] [ -i interval ] [ -f file ] [ -s timeout ] [ -D name=value ] ... [ -d value ]
Description
The automount command is used as an administration tool for AutoFS. It installs AutoFS mount points and associates an automount map with each mount point. The AutoFS filesystem monitors attempts to access directories within it and notifies the automountd daemon. The daemon uses the map to locate a filesystem, which it then mounts at the point of reference within the AutoFS filesystem.
The previous automount behavior can be specified whether the COMPAT_AUTOMOUNT environment variable is set to any value before running the automount command. The current behavior became the default behavior in AIX 5.0.
If the filesystem is not accessed within an appropriate interval (ten minutes by default), the automountd daemon unmounts the filesystem.
If the automountd daemon has not been started the
automount command attempts to start it using SRC
.
- Maps
-
Automount maps specify the mount points to be automatically mounted when accessed, and what must be mounted over those mount points. The /etc/auto_master map file specifies the initial mount points, which are known as keys, and their corresponding maps that determine which remote filesystem is mounted over it. The format of the /etc/auto_master file is:
/key map
Note: The /etc/auto_master file is read only when the automount command is initially executed. Changes to it will not take effect until the automount command is run again.The most common maps are direct maps, indirect maps, and host maps.
Direct maps require a special key (/-) in the /etc/auto_master file, and their map is a file with the following format:/directkey [-options] server:/dir
When a user accesses the /directkey directory, the automountd daemon will mount server:/dir over /directkey.
Indirect maps have the following format:indirectkey [-options] server:/dir
When a user accesses the /key/indirectkey directory, the automountd daemon will mount server:/dir over /key/indirectkey.
Host maps require a special map (-hosts) in the /etc/auto_master file. The automountd daemon creates a subdirectory under the /key directory for every server that is listed in the /etc/hosts file. When a user accesses the /key/server directory, the automountd daemon mounts the server's exported directories over the /key/server directory.
- Alternate Map Locations
-
Automount maps might also be located on NIS and LDAP servers. The automount command looks for maps as files on the local system by default, unless the automount entry in the /etc/irs.conf file is changed. For example:
automount nis_ldap
It is possible to specify more than one name service, in the order that they will be used, by using a whitespace separated list. For example, to indicate that LDAP maps should be used first, followed by local files, the automount entry would be the following:automount nis_ldap files
The valid values for the automount entry are
files
,nis
, andnis_ldap
.
Flags
Item | Description |
---|---|
-d value | Specifies the debug level of the autofs extension and automount daemon. |
-D name=value | Specifies an environment variable and its value. You can specify multiple environment variables by using the -D flag multiple times. |
-f file | Specifies a new master map file to use. The default is /etc/auto_master. |
-i Interval | Specifies the amount of time, in seconds, that an inactive autofs mounted directory exists. |
-m | Specifies not to search NIS for automount maps. |
-n | Specifies the nobrowse option. |
-s timeout | Specifies the amount of time, in seconds, before a new process is forked off if a mount takes too long. The minimum value is 30. |
-t Duration | Specifies the amount of time, in seconds, that the auto unmount process sleeps before it starts to work again. The minimum value is 21. The default value is 120. The maximum value is 600. |
-v | Displays on standard output verbose status and warning messages. |
Examples
- To specify the LocalOpts, LocalCaching, and
Server environment variables for automatic mounting of mount points, enter the
following
command:
automount -D LocalOpts=-rsize=16384,wsize=16384,timeo=15 \ -D LocalCaching=-rsize=16384,wsize=16384,timeo=15 -D Server=autoserver
- To use a master map file (/etc/myFile) instead of the default file
(/etc/auto_master), enter the following
command:
automount -f /etc/myFile
- To set the interval time to 5 minutes, the timeout value to 30 seconds, and the duration time to
one minute for the automount daemon, enter the following
command:
automount -i 300 -s 30 -t 60
Files
Item | Description |
---|---|
/etc/auto_master | The default map file is used to create the initial automount keys. |
/etc/hosts | Specifies servers that are used in automount host maps. |
/etc/irs.conf | Specifies the location of the automount maps. |