System Administration Commands automount(1M)
NAME
automount - install automatic mount points
SYNOPSIS
/usr/sbin/automount [-t duration] [-v]
DESCRIPTION
The automount utility installs autofs mount points and asso-
ciates an automount map with each mount point. It starts the
automountd(1M) daemon if it finds any non-trivial entries in
either local or distributed automount maps and if the daemon
is not already running. The autofs file system monitors attempts to access directories within it and notifies theautomountd(1M) daemon. The daemon uses the map to locate a
file system, which it then mounts at the point of reference within the autofs file system. A map can be assigned to anautofs mount using an entry in the /etc/auto_master map or a
direct map. If the file system is not accessed within an appropriateinterval (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:# Master map for automounter
#
+auto_master
/net -hosts -nosuid
/home auto_home
The +auto_master entry is a reference to an external NIS
master map. If one exists, then its entries are read as ifthey occurred in place of the +auto_master entry. The
remaining entries in the master file specify a directory onwhich an autofs mount will be made followed by the auto-
mounter 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 mapthat do not specify mount options explicitly. The automount
command is usually run without arguments. It compares theentries /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 theSunOS 5.11 Last change: 19 Aug 2010 1
System Administration Commands automount(1M)
/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. SMF ManagementThe automount service is managed by the service management
facility, smf(5), under the service identifier: svc:/system/filesystem/autofs:default 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.Startup autofs SMF parameters for automount can be manipu-
lated using sharectl(1M). Refer to sharectl(1M) for instruc-
tions for viewing and updating these parameters. Supported parameters are: timeout=num Specifies a duration, in seconds, that a file system is to remain mounted when not in use. The default value is600 (10 minutes). Equivalent to the -t option in auto-
mount.automount_verbose=TRUE | FALSE
Verbose mode. Causes you to be notified of non-critical
events, suchs as autofs mounts and unmounts. The defaultvalue is FALSE. Equivalent to the -v option in auto-
mount. Automount with Solaris Trusted Extensions If a system is configured with Solaris Trusted Extensions, additional processing is performed to facilitate multilevelhome directory access. A list of zones whose labels are dom-
inated by the current zone is generated and defaultauto_home automount maps are generated if they do not
currently exist. These automount maps are named
auto_home_
, where is the name of each zone's lower-level zone. An autofs mount of each such
auto_home map is then performed, regardless of whether it is
SunOS 5.11 Last change: 19 Aug 2010 2
System Administration Commands automount(1M)
explicitly or implicitly listed in the master map. Insteadof autofs mounting the standard auto_home map, the zone uses
an auto_home file appended with its own zone name. Each
zone's auto_home map is uniquely named so that it can be
maintained and shared by all zones using a common name server.By default, the home directories of lower-level zones are
mounted read-only under /zone/
/export/home when each zone is booted. The default auto_home_
mount map specifies that path as the source directory for an lofs remount onto /zone/auto- /home/ . 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 notmatch 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 whosehome directory does not exist in the public zone, the direc-
tory is automatically created on behalf of the user. OPTIONS The following options are supported:-t duration Specifies a duration, in seconds, that a file
system is to remain mounted when not in use. The default is 10 minutes.-v Verbose mode. Notifies of autofs mounts,
unmounts, or other non-essential information.
USAGE
Map Entry Format A simple map entry (mapping) takes the form:key [ -mount-options ] location ...
SunOS 5.11 Last change: 19 Aug 2010 3
System Administration Commands automount(1M)
where key is the full pathname of the directory to mountwhen used in a direct map, or the simple name of a subdirec-
tory 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 asimple NFS mount, the options that can be used are as speci-
fied in mount_nfs(1M), and location takes the form:
host:pathname host is the name of the host from which to mount the filesystem, and pathname is the absolute pathname of the direc-
tory to mount. Options to other file systems are documented on the othermount_* reference manual pages, for example,
mount_cachefs(1M).
Replicated File Systems Multiple location fields can be specified for replicated NFSfile systems, in which case automount and the kernel will
each try to use that information to increase availability.If the read-only flag is set in the map entry, automountd
mounts a list of locations that the kernel may use, sorted by several criteria. Only locations available at mount time will be mounted, and thus be available to the kernel. When aserver does not respond, the kernel will switch to an alter-
nate server. The sort ordering of automount is used to
determine how the next server is chosen. If the read-only
flag is not set, automount will mount the best single loca-
tion, chosen by the same sort ordering, and new servers will only be chosen when an unmount has been possible, and a remount is done. Servers on the same local subnet are given the strongest preference, and servers on the local net are given the second strongest preference. Among servers equally far away, response times will determine the order if no weighting factors (see below) are used. If the list includes server locations using both the NFSVersion 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.SunOS 5.11 Last change: 19 Aug 2010 4
System Administration Commands automount(1M)
If each location in the list shares the same pathname then asingle location may be used with a comma-separated list of
hostnames: hostname,hostname...:pathname 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,man -ro alpha,bravo,charlie(1),delta(4):/usr/man
hosts alpha and bravo have the highest priority; host delta has the lowest. Server proximity takes priority in the selection process. Inthe example above, if the server delta is on the same net-
work segment as the client, but the others are on different network segments, then delta will be selected; the weightingvalue is ignored. The weighting has effect only when select-
ing between servers with the same network proximity. Theautomounter 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:man -ro alpha:/usr/man bravo,charlie(1):/usr/share/man
delta(3):/export/man A mapping can be continued across input lines by escaping the NEWLINE with a backslash (\) Comments begin with anumber sign (#) and end at the subsequent NEWLINE.
Map Key Substitution The ampersand (&) character is expanded to the value of the key field for the entry in which it occurs. In this case:SunOS 5.11 Last change: 19 Aug 2010 5
System Administration Commands automount(1M)
jane sparcserver:/home/& the & expands to jane. Wildcard Key The asterisk (*) character, when supplied as the key field,is recognized as the catch-all entry. Such an entry will
match any key not previously matched. For instance, if the following entry appeared in the indirect map for /config: * &:/export/config/& this would allow automatic mounts in /config of any remote file system whose location could be specified as: hostname:/export/config/hostname Note that the wildcard key does not work in conjunction withthe -browse option.
Variable SubstitutionClient specific variables can be used within an automount
map. For instance, if $HOST appeared within a map, automount
would expand it to its current value for the client's host name. Supported variables are: 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 architec-
ture 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.
SunOS 5.11 Last change: 19 Aug 2010 6
System Administration Commands automount(1M)
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 charac-
ters, you can surround the variable name with curly braces ({}). Multiple Mounts A multiple mount entry takes the form:key [-mount-options] [[mountpoint] [-mount-options] location...]...
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 /srcbeta -ro\
/ svr1,svr2:/export/src/beta \ /1.0 svr1,svr2:/export/src/beta/1.0 \ /1.0/man svr1,svr2:/export/src/beta/1.0/manAll 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. Other File System TypesThe automounter assumes NFS mounts as a default file system
type. Other file system types can be described using the fstype mount option. Other mount options specific to thisSunOS 5.11 Last change: 19 Aug 2010 7
System Administration Commands automount(1M)
file system type can be combined with the fstype option. The location field must contain information specific to the file system type. If the location field begins with a slash, a colon character must be prepended, for instance, to mount a CD file system:cdrom -fstype=hsfs,ro :/dev/sr0
or to perform an autofs mount:src -fstype=autofs auto_src
Use this procedure only if you are not using Volume Manager. Mounts using CacheFS are most useful when applied to anentire map as map defaults. The following entry in the mas-
ter map describes cached home directory mounts. It assumes the default location of the cache directory, /cache./home auto_home -fstype =cachefs,backfstype=nfs
See the NOTES section for information on option inheritance. Indirect MapsAn indirect map allows you to specify mappings for the sub-
directories you wish to mount under the directory indicated on the command line. In an indirect map, each key consists of a simple name that refers to one or more file systems that are to be mounted as needed. Direct Maps Entries in a direct map are associated directly with autofs mount points. Each key is the full pathname of an autofs mount point. The direct map as a whole is not associated with any single directory.Direct maps are distinguished from indirect maps by the /-
key. For example:# Master map for automounter
#
SunOS 5.11 Last change: 19 Aug 2010 8
System Administration Commands automount(1M)
+auto_master
/net -hosts -nosuid,nobrowse
/home auto_home -nobrowse
/- auto_direct
Included Maps The contents of another map can be included within a map with an entry of the form +mapname 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 switchaccording to the entry for the automounter in
/etc/nsswitch.conf, such asautomount: files nis
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. Special MapsThere are two special maps available: -hosts and -null. The
-hosts map is used with the /net directory and assumes that
the map key is the hostname of an NFS server. The automountd
daemon dynamically constructs a map entry from the server's list of exported file systems. References to a directory under /net/hermes will refer to the corresponding directory relative to hermes root.The -null map cancels a previous map for the directory indi-
cated. This is most useful in the /etc/auto_master for can-
celling 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. Executable MapsLocal maps that have the execute bit set in their file per-
missions will be executed by the automounter and provided
with a key to be looked up as an argument. The executableSunOS 5.11 Last change: 19 Aug 2010 9
System Administration Commands automount(1M)
map is expected to return the content of an automounter map
entry on its stdout or no output if the entry cannot be determined. A direct map cannot be made executable.Configuration and the auto_master Map
When initiated without arguments, automount consults the
master map for a list of autofs mount points and their maps. It mounts any autofs mounts that are not already mounted, and unmounts autofs mounts that have been removed from the master map or direct map.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.
BrowsingThe automount daemon supports browsability of indirect maps.
This allows all of the potential mount points to be visible,whether or not they are mounted. The -nobrowse option can be
added to any indirect autofs map to disable browsing. For example:/net -hosts -nosuid,nobrowse
/home auto_home
In this case, any hostnames would only be visible in /net after they are mounted, but all potential mount points wouldbe visible under /home. The -browse option enables browsa-
bility of autofs file systems. This is the default for all indirect maps.The -browse option does not work in conjunction with the
wildcard key. Restricting Mount Maps Options specified for a map are used as the default options for all the entries in that map. They are ignored when map entries specify their own mount options. 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 additionalmount option, -restrict.
/home auto_home -restrict,nosuid,hard
SunOS 5.11 Last change: 19 Aug 2010 10
System Administration Commands automount(1M)
The -restrict option forces the inheritance of all the res-
trictive options nosuid, nodevices, nosetuid, and noexec aswell as the restrict option itself. In this particular exam-
ple, 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. EXIT STATUS The following exit values are returned: 0 Successful completion. 1 An error occurred. FILES/etc/auto_master Master automount map.
/etc/auto_home Map to support automounted home direc-
tories. /etc/nsswitch.conf Name service switch configuration file. See nsswitch.conf(4).ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Availability | SUNWcs ||_____________________________|_____________________________|
SEE ALSO
isainfo(1), ls(1), svcs(1), uname(1), automountd(1M),
mount(1M), mount_cachefs( 1M), mount_nfs(1M), sharectl(1M),
svcadm(1M), attributes(5), nfssec(5), smf(5) System Administration Guide: Network ServicesSunOS 5.11 Last change: 19 Aug 2010 11
System Administration Commands automount(1M)
NOTES autofs mount points must not be hierarchically related.automount does not allow an autofs mount point to be created
within another autofs mount. 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 atany 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 beuseful 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 thedefault options, as at this time, the options do not con-
catenate. The concatenation feature is planned for a future release. When operating on a map that invokes an NFS mount, thedefault 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 themount_nfs(1M) utility.
The Network Information Service (NIS) was formerly known as Sun Yellow Pages (YP). The functionality of the two remains the same.SunOS 5.11 Last change: 19 Aug 2010 12