AUTOMOUNT(1M) | Maintenance Commands | AUTOMOUNT(1M) |
If the file system is not accessed within an appropriate interval (10 minutes by default), the automountd daemon unmounts the file system.
The file /etc/auto_master determines the locations of all autofs mount points. By default, this file contains three entries:
The +auto_master entry is a reference to an external NIS or NIS+ master map. If one exists, then its entries are read as if they occurred in place of the +auto_master entry. The remaining entries in the master file specify a directory on which an autofs mount will be made followed by the automounter map to be associated with it. Optional mount options may be supplied as an optional third field in the each entry. These options are used for any entries in the map that do not specify mount options explicitly. The automount command is usually run without arguments. It compares the entries /etc/auto_master with the current list of autofs mounts in /etc/mnttab and adds, removes or updates autofs mounts to bring the /etc/mnttab up to date with the /etc/auto_master. At boot time it installs all autofs mounts from the master map. Subsequently, it may be run to install autofs mounts for new entries in the master map or the direct map, or to perform unmounts for entries that have been removed from these maps.
By default, the home directories of lower-level zones are mounted read-only under /zone/<zonename>/export/home when each zone is booted. The default auto_home_<zonename> automount map specifies that path as the source directory for an lofs remount onto /zone/<zonename>/home/<username>. For example, the file auto_home_public, as generated from a higher level zone would contain:
+auto_home_public
* -fstype=lofs :/zone/public/export/home/&
When a home directory is referenced and the name does not match any other keys in the auto_home_public map, it will match this loopback mount specification. If this loopback match occurs and the name corresponds to a valid user whose home directory does not exist in the public zone, the directory is automatically created on behalf of the user.
where key is the full pathname of the directory to mount when used in a direct map, or the simple name of a subdirectory in an indirect map. mount-options is a comma-separated list of mount options, and location specifies a file system from which the directory may be mounted. In the case of a simple NFS mount, the options that can be used are specified in mount_nfs(1M), and location takes the form:
host is the name of the host from which to mount the file system, and pathname is the absolute pathname of the directory to mount.
Options to other file systems are documented in the other mount_* reference manual pages.
If the list includes server locations using both the NFS Version 2 Protocol and the NFS Version 3 Protocol, automount will choose only a subset of the server locations on the list, so that all entries will be the same protocol. It will choose servers with the NFS Version 3 Protocol so long as an NFS Version 2 Protocol server on a local subnet will not be ignored. See the for additional details.
If each location in the list shares the same pathname then a single location may be used with a comma-separated list of hostnames:
Requests for a server may be weighted, with the weighting factor appended to the server name as an integer in parentheses. Servers without a weighting are assumed to have a value of zero (most likely to be selected). Progressively higher values decrease the chance of being selected. In the example,
hosts alpha and bravo have the highest priority; host delta has the lowest.
Server proximity takes priority in the selection process. In the example above, if the server delta is on the same network segment as the client, but the others are on different network segments, then delta will be selected; the weighting value is ignored. The weighting has effect only when selecting between servers with the same network proximity. The automounter always selects the localhost over other servers on the same network segment, regardless of weighting.
In cases where each server has a different export point, the weighting can still be applied. For example:
A mapping can be continued across input lines by escaping the NEWLINE with a backslash (\) Comments begin with a number sign ( #) and end at the subsequent NEWLINE.
the & expands to jane.
this would allow automatic mounts in /config of any remote file system whose location could be specified as:
Note that the wildcard key does not work in conjunction with the -browse option.
ARCH | The output of arch | The architecture name. For example, sun4 on a sun4u machine. |
CPU | The output of uname -p | The processor type. |
For example, "sparc" | ||
HOST | The output of uname -n | The host name. |
For example, myhost. | ||
KARCH | The output of arch -k or uname -m | The kernel architecture name or machine hardware name. For example, sun4u. |
OSNAME | The output of uname -s | The OS name. |
For example, "SunOS" | ||
OSREL | The output of uname -r | The OS release name. |
For example "5.3" | ||
OSVERS | The output of uname -v | The OS version. |
For example, "beta1.0" | ||
NATISA | The output of isainfo -n | The native instruction set architecture for the system. |
For example, "sparcv9" | ||
PLATFORM | The output of uname -i | The platform name. For example, SUNW,Sun-Fire-V240. |
If a reference needs to be protected from affixed characters, you can surround the variable name with curly braces ( {}).
The initial /[mountpoint] is optional for the first mount and mandatory for all subsequent mounts. The optional mountpoint is taken as a pathname relative to the directory named by key. If mountpoint is omitted in the first occurrence, a mountpoint of / (root) is implied.
Given an entry in the indirect map for /src
All offsets must exist on the server under beta. automount will automatically mount /src/beta, /src/beta/1.0, and /src/beta/1.0/man, as needed, from either svr1 or svr2, whichever host is nearest and responds first.
or to perform an autofs mount:
Use this procedure only if you are not using Volume Manager.
See the NOTES section for information on option inheritance.
Direct maps are distinguished from indirect maps by the /- key. For example:
If mapname begins with a slash, it is assumed to be the pathname of a local file. Otherwise, the location of the map is determined by the policy of the name service switch according to the entry for the automounter in /etc/nsswitch.conf, such as
If the name service is files, then the name is assumed to be that of a local file in /etc. If the key being searched for is not found in the included map, the search continues with the next entry.
The -null map cancels a previous map for the directory indicated. This is most useful in the /etc/auto_master for cancelling entries that would otherwise be inherited from the +auto_master include entry. To be effective, the -null entries must be inserted before the included map entry.
The master map is assumed to be called auto_master and its location is determined by the name service switch policy. Normally the master map is located initially as a local file /etc/auto_master.
In this case, any hostnames would only be visible in /net after they are mounted, but all potential mount points would be visible under /home. The -browse option enables browsability of autofs file systems. This is the default for all indirect maps.
The -browse option does not work in conjunction with the wildcard key.
In some cases, however, it is desirable to force nosuid, nodevices, nosetuid, or noexec for a complete mount map and its submounts. This can be done by specifying the additional mount option, -restrict.
The -restrict option forces the inheritance of all the restrictive options nosuid, nodevices, nosetuid, and noexec as well as the restrict option itself. In this particular example, the nosuid and restrict option are inherited but the hard option is not. The restrict option also prevents the execution of "executable maps" and is enforced for auto mounts established by programs with fewer than all privileges available in their zone.
Since each direct map entry results in a new autofs mount such maps should be kept short.
Entries in both direct and indirect maps can be modified at any time. The new information is used when automountd next uses the map entry to do a mount.
New entries added to a master map or direct map will not be useful until the automount command is run to install them as new autofs mount points. New entries added to an indirect map may be used immediately.
As of the Solaris 2.6 release, a listing (see ls(1)) of the autofs directory associated with an indirect map shows all potential mountable entries. The attributes associated with the potential mountable entries are temporary. The real file system attributes will only be shown once the file system has been mounted.
Default mount options can be assigned to an entire map when specified as an optional third field in the master map. These options apply only to map entries that have no mount options. Note that map entities with options override the default options, as at this time, the options do not concatenate. The concatenation feature is planned for a future release.
When operating on a map that invokes an NFS mount, the default number of retries for the automounter is 0, that is, a single mount attempt, with no retries. Note that this is significantly different from the default (10000) for the mount_nfs(1M) utility.
The Network Information Service (NIS) was formerly known as Sun Yellow Pages (YP). The functionality of the two remains the same.
The automount service is managed by the service management facility, smf(5), under the service identifier:
Administrative actions on this service, such as enabling, disabling, or requesting restart, can be performed using svcadm(1M). The service's status can be queried using the svcs(1) command.
September 8, 2015 |