2 .\" The contents of this file are subject to the terms of the
3 .\" Common Development and Distribution License (the "License").
4 .\" You may not use this file except in compliance with the License.
6 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7 .\" or http://www.opensolaris.org/os/licensing.
8 .\" See the License for the specific language governing permissions
9 .\" and limitations under the License.
11 .\" When distributing Covered Code, include this CDDL HEADER in each
12 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
13 .\" If applicable, add the following below this CDDL HEADER, with the
14 .\" fields enclosed by brackets "[]" replaced with your own identifying
15 .\" information: Portions Copyright [yyyy] [name of copyright owner]
18 .\" Copyright 1989 AT&T
19 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
20 .\" Copyright 2016 Nexenta Systems, Inc.
27 .Nd install automatic mount points
37 mount points and associates an automount map with each mount point. It starts
40 daemon if it finds any non-trivial entries in either local or distributed
41 automount maps and if the daemon is not already running. The
43 file system monitors attempts to access directories within it and notifies the
45 daemon. The daemon uses the map to locate a file system, which it then mounts at
46 the point of reference within the
48 file system. A map can be assigned to an
50 mount using an entry in the
54 If the file system is not accessed within an appropriate interval
55 .Pq 10 minutes by default ,
58 daemon unmounts the file system.
62 determines the locations of all
68 command is usually run without arguments. It compares the entries
70 with the current list of
74 and adds, removes or updates
79 .Pa /etc/auto_master .
80 At boot time it installs all
82 mounts from the master map. Subsequently, it may be run to install
84 mounts for new entries in the master map or the direct map, or to perform
85 unmounts for entries that have been removed from these maps.
87 The following options are supported:
90 Verbose mode. Notifies of
92 mounts, unmounts, or other non-essential information.
96 in seconds, that a file system is to remain mounted when not in use. The default
106 .Bd -literal -offset indent
107 .Ar key Oo Fl Ns Ar mount-options Oc Ar location Ns ...
112 is the full pathname of the directory to mount when used in a direct map, or the
113 simple name of a subdirectory in an indirect map.
115 is a comma-separated list of
119 specifies a file system from which the directory may be mounted. In the case of
120 a simple NFS mount, the options that can be used are specified in
126 .Dl Ar host Ns : Ns Ar pathname
129 is the name of the host from which to mount the file system, and
131 is the absolute pathname of the directory to mount.
133 Options to other file systems are documented in the other
135 reference manual pages.
136 .Ss Replicated File Systems
139 fields can be specified for replicated NFS file systems, in which case
141 and the kernel will each try to use that information to increase availability.
142 If the read-only flag is set in the map entry,
144 mounts a list of locations that the kernel may use, sorted by several criteria.
145 Only locations available at mount time will be mounted, and thus be available to
146 the kernel. When a server does not respond, the kernel will switch to an
147 alternate server. The sort ordering of
149 is used to determine how the next server is chosen. If the read-only flag is not
152 will mount the best single location, chosen by the same sort ordering, and new
153 servers will only be chosen when an unmount has been possible, and a remount is
154 done. Servers on the same local subnet are given the strongest preference, and
155 servers on the local net are given the second strongest preference. Among
156 servers equally far away, response times will determine the order if no
161 If the list includes server locations using both the NFS Version 2 Protocol and
162 the NFS Version 3 Protocol,
164 will choose only a subset of the server locations on the list, so that all
165 entries will be the same protocol. It will choose servers with the NFS Version 3
166 Protocol so long as an NFS Version 2 Protocol server on a local subnet will not
167 be ignored. See the FIXME for additional details.
171 in the list shares the same
175 may be used with a comma-separated list of hostnames:
176 .Bd -literal -offset indent
177 .Ar hostname Ns , Ns Ar hostname Ns ...: Ns Ar pathname
180 Requests for a server may be weighted, with the weighting factor appended to
181 the server name as an integer in parentheses. Servers without a weighting are
182 assumed to have a value of zero
183 .Pq most likely to be selected .
184 Progressively higher values decrease the chance of being selected. In the
186 .Bd -literal -offset indent
187 man -ro alpha,bravo,charlie(1),delta(4):/usr/man
194 have the highest priority; host
198 Server proximity takes priority in the selection process. In the example above,
201 is on the same network segment as the client, but the others are on different
202 network segments, then
204 will be selected; the weighting value is ignored. The weighting has effect only
205 when selecting between servers with the same network proximity. The automounter
206 always selects the localhost over other servers on the same network segment,
207 regardless of weighting.
209 In cases where each server has a different export point, the weighting can
210 still be applied. For example:
211 .Bd -literal -offset indent
212 man -ro alpha:/usr/man bravo,charlie(1):/usr/share/man \e
216 A mapping can be continued across input lines by escaping the NEWLINE with a
219 Comments begin with a number sign
221 and end at the subsequent NEWLINE.
222 .Ss Map Key Substitution
225 character is expanded to the value of the
227 field for the entry in which it occurs. In this case:
228 .Bd -literal -offset indent
229 jane sparcserver:/home/&
239 character, when supplied as the
241 field, is recognized as the catch-all entry. Such an entry will match any key
242 not previously matched. For instance, if the following entry appeared in the
245 .Bd -literal -offset indent
249 this would allow automatic mounts in
251 of any remote file system whose location could be specified as:
252 .Bd -literal -offset indent
253 .Ar hostname Ns : Ns Pa /export/config/ Ns Ar hostname
256 Note that the wildcard key does not work in conjunction with the
259 .Ss Variable Substitution
260 Client specific variables can be used within an
262 map. For instance, if
264 appeared within a map,
266 would expand it to its current value for the client's host name. Supported
268 .Bl -column "PLATFORM" "arch -k or uname -m"
269 .It Sy NAME Ta Sy OUTPUT OF Ta Sy DESCRIPTION (EXAMPLE)
272 .Ta architecture name
283 .Ta Nm arch Fl k No or Nm uname Fl m
284 .Ta kernel architecture name or machine hardware name
300 .Ta native instruction set architecture for the system
305 .Pq Qq Sy SUNW,Sun-Fire-V240
308 If a reference needs to be protected from affixed characters, you can surround
309 the variable name with curly braces
310 .Pq Qq Sy \(lC Ns Sy \(rC .
312 A multiple mount entry takes the form:
313 .Bd -literal -offset indent
314 .Ar key Oo Fl Ns Ar mount-options Oc Oo Oo Ar mountpoint Oc
315 .Oo Fl Ns Ar mount-options Oc Ar location Ns ... Oc Ns ...
320 is optional for the first mount and mandatory for all subsequent mounts. The
323 is taken as a pathname relative to the directory named by
327 is omitted in the first occurrence, a
334 Given an entry in the indirect map for
336 .Bd -literal -offset indent
338 / svr1,svr2:/export/src/beta \e
339 /1.0 svr1,svr2:/export/src/beta/1.0 \e
340 /1.0/man svr1,svr2:/export/src/beta/1.0/man
343 All offsets must exist on the server under
346 will automatically mount
350 .Pa /src/beta/1.0/man ,
351 as needed, from either
355 whichever host is nearest and responds first.
356 .Ss Other File System Types
357 The automounter assumes NFS mounts as a default file system type. Other file
358 system types can be described using the
360 mount option. Other mount options specific to this file system type can be
363 option. The location field must contain information specific to the file system
364 type. If the location field begins with a slash, a colon character must be
365 prepended, for instance, to mount a CD file system:
366 .Bd -literal -offset indent
367 cdrom -fstype=hsfs,ro :/dev/sr0
373 .Bd -literal -offset indent
374 src -fstype=autofs auto_src
377 Use this procedure only if you are not using Volume Manager.
381 section for information on option inheritance.
383 An indirect map allows you to specify mappings for the subdirectories you wish
386 indicated on the command line. In an indirect map, each
388 consists of a simple name that refers to one or more file systems that are to be
391 Entries in a direct map are associated directly with
395 is the full pathname of an
397 mount point. The direct map as a whole is not associated with any single
400 Direct maps are distinguished from indirect maps by the
403 .Bd -literal -offset indent
404 # Master map for automounter
407 /net -hosts -nosuid,nobrowse
408 /home auto_home -nobrowse
412 The contents of another map can be included within a map with an entry of the
414 .Bd -literal -offset indent
420 begins with a slash, it is assumed to be the pathname of a local file.
421 Otherwise, the location of the map is determined by the policy of the name
422 service switch according to the entry for the automounter in
423 .Pa /etc/nsswitch.conf ,
425 .Bd -literal -offset indent
429 If the name service is
431 then the name is assumed to be that of a local file in
433 If the key being searched for is not found in the included map, the search
434 continues with the next entry.
436 There are two special maps available:
444 directory and assumes that the map key is the hostname of an NFS server. The
446 daemon dynamically constructs a map entry from the server's list of exported
447 file systems. References to a directory under
449 will refer to the corresponding directory relative to
455 map cancels a previous map for the directory indicated. This is most useful in
458 for cancelling entries that would otherwise be inherited from the
460 include entry. To be effective, the
462 entries must be inserted before the included map entry.
464 Local maps that have the execute bit set in their file permissions will be
465 executed by the automounter and provided with a key to be looked up as an
466 argument. The executable map is expected to return the content of an
467 automounter map entry on its stdout or no output if the entry cannot be
468 determined. A direct map cannot be made executable.
469 .Ss Configuration and the auto_master Map
470 When initiated without arguments,
472 consults the master map for a list of
474 mount points and their maps. It mounts any
476 mounts that are not already mounted, and unmounts
478 mounts that have been removed from the master map or direct map.
480 The master map is assumed to be called
482 and its location is determined by the name service switch policy. Normally the
483 master map is located initially as a local file
484 .Pa /etc/auto_master .
488 daemon supports browsability of indirect maps. This allows all of the potential
489 mount points to be visible, whether or not they are mounted. The
491 option can be added to any indirect
493 map to disable browsing. For example:
494 .Bd -literal -offset indent
495 /net -hosts -nosuid,nobrowse
501 would only be visible in
503 after they are mounted, but all potential mount points would be visible under
507 option enables browsability of
509 file systems. This is the default for all indirect maps.
513 option does not work in conjunction with the wildcard key.
514 .Ss Restricting Mount Maps
515 Options specified for a map are used as the default options for all the entries
516 in that map. They are ignored when map entries specify their own mount options.
518 In some cases, however, it is desirable to force
519 .Sy nosuid , nodevices , nosetuid ,
522 for a complete mount map and its submounts. This can be done by specifying the
523 additional mount option,
525 .Bd -literal -offset indent
526 /home auto_home -restrict,nosuid,hard
531 option forces the inheritance of all the restrictive options
532 .Sy nosuid , nodevices , nosetuid ,
535 as well as the restrict option itself. In this particular example, the
539 option are inherited but the
543 option also prevents the execution of
545 and is enforced for auto mounts established by programs with fewer than all
546 privileges available in their zone.
549 .It Pa /etc/auto_master
550 Master automount map.
551 .It Pa /etc/auto_home
552 Map to support automounted home directories.
553 .It Pa /etc/nsswitch.conf
554 Name service switch configuration file. See
555 .Xr nsswitch.conf 4 .
574 mount points must not be hierarchically related.
578 mount point to be created within another
582 Since each direct map entry results in a new
584 mount such maps should be kept short.
586 Entries in both direct and indirect maps can be modified at any time. The new
587 information is used when
589 next uses the map entry to do a mount.
591 New entries added to a master map or direct map will not be useful until the
592 automount command is run to install them as new
594 mount points. New entries added to an indirect map may be used immediately.
596 As of the Solaris 2.6 release, a listing
602 directory associated with an indirect map shows all potential mountable
603 entries. The attributes associated with the potential mountable entries are
604 temporary. The real file system attributes will only be shown once the file
605 system has been mounted.
607 Default mount options can be assigned to an entire map when specified as an
608 optional third field in the master map. These options apply only to map entries
609 that have no mount options. Note that map entities with options override the
610 default options, as at this time, the options do not concatenate. The
611 concatenation feature is planned for a future release.
613 When operating on a map that invokes an NFS mount, the default number of
614 retries for the automounter is 0, that is, a single mount attempt, with no
615 retries. Note that this is significantly different from the default
621 The Network Information Service
623 was formerly known as Sun Yellow Pages
625 The functionality of the two remains the same.
629 service is managed by the service management facility,
631 under the service identifier:
632 .Bd -literal -offset indent
633 svc:/system/filesystem/autofs:default
636 Administrative actions on this service, such as enabling, disabling, or
637 requesting restart, can be performed using
639 The service's status can be queried using the