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.
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.
44 file system monitors attempts to access directories within it and notifies the
47 The daemon uses the map to locate a file system, which it then mounts at the
48 point of reference within the
51 A map can be assigned to an
53 mount using an entry in the
57 If the file system is not accessed within an appropriate interval
58 .Pq 10 minutes by default ,
61 daemon unmounts the file system.
65 determines the locations of all
68 By default, this file contains three entries:
69 .Bd -literal -offset indent
70 # Master map for automounter
79 entry is a reference to an external NIS master map.
80 If one exists, then its entries are read as if they occurred in place of the
83 The remaining entries in the master file specify a directory on which an
85 mount will be made followed by the automounter map to be associated with it.
86 Optional mount options may be supplied as an optional third field in the each
88 These options are used for any entries in the map that do not specify mount
92 command is usually run without arguments.
93 It compares the entries
95 with the current list of
99 and adds, removes or updates
104 .Pa /etc/auto_master .
105 At boot time it installs all
107 mounts from the master map.
108 Subsequently, it may be run to install
110 mounts for new entries in the master map or the direct map, or to perform
111 unmounts for entries that have been removed from these maps.
112 .Ss Automount with Solaris Trusted Extensions
113 If a system is configured with Solaris Trusted Extensions, additional
114 processing is performed to facilitate multilevel home directory access.
115 A list of zones whose labels are dominated by the current zone is generated and
118 automount maps are generated if they do not currently exist.
119 These automount maps are named
120 .Sy auto_home_ Ns Ar zonename ,
123 is the name of each zone's lower-level zone.
128 map is then performed, regardless of whether it is explicitly or implicitly
129 listed in the master map.
132 mounting the standard
134 map, the zone uses an
136 file appended with its own zone name.
139 map is uniquely named so that it can be maintained and shared by all zones using
140 a common name server.
142 By default, the home directories of lower-level zones are mounted read-only
144 .Pa /zone/ Ns Ar zonename Ns Pa /export/home
145 when each zone is booted.
147 .Sy auto_home_ Ns Ar zonename
148 automount map specifies that path as the source directory for an
151 .Pa /zone/ Ns Ar zonename Ns Pa /home/ Ns Ar username .
152 For example, the file
153 .Pa auto_home_public ,
154 as generated from a higher level zone would contain:
155 .Bd -literal -offset indent
157 * -fstype=lofs :/zone/public/export/home/&
160 When a home directory is referenced and the name does not match any other keys
163 map, it will match this loopback mount specification.
164 If this loopback match occurs and the name corresponds to a valid user whose
165 home directory does not exist in the public zone, the directory is automatically
166 created on behalf of the user.
168 The following options are supported:
174 mounts, unmounts, or other non-essential information.
178 in seconds, that a file system is to remain mounted when not in use.
188 .Bd -literal -offset indent
189 .Ar key Oo Fl Ns Ar mount-options Oc Ar location Ns ...
194 is the full pathname of the directory to mount when used in a direct map, or the
195 simple name of a subdirectory in an indirect map.
197 is a comma-separated list of
201 specifies a file system from which the directory may be mounted.
202 In the case of a simple NFS mount, the options that can be used are specified in
208 .Dl Ar host Ns : Ns Ar pathname
211 is the name of the host from which to mount the file system, and
213 is the absolute pathname of the directory to mount.
215 Options to other file systems are documented in the other
217 reference manual pages.
218 .Ss Replicated File Systems
221 fields can be specified for replicated NFS file systems, in which case
223 and the kernel will each try to use that information to increase availability.
224 If the read-only flag is set in the map entry,
226 mounts a list of locations that the kernel may use, sorted by several criteria.
227 Only locations available at mount time will be mounted, and thus be available to
229 When a server does not respond, the kernel will switch to an alternate server.
232 is used to determine how the next server is chosen.
233 If the read-only flag is not set,
235 will mount the best single location, chosen by the same sort ordering, and new
236 servers will only be chosen when an unmount has been possible, and a remount is
238 Servers on the same local subnet are given the strongest preference, and servers
239 on the local net are given the second strongest preference.
240 Among servers equally far away, response times will determine the order if no
245 If the list includes server locations using both the NFS Version 2 Protocol and
246 the NFS Version 3 Protocol,
248 will choose only a subset of the server locations on the list, so that all
249 entries will be the same protocol.
250 It will choose servers with the NFS Version 3 Protocol so long as an NFS Version
251 2 Protocol server on a local subnet will not be ignored.
252 See the FIXME for additional details.
256 in the list shares the same
260 may be used with a comma-separated list of hostnames:
261 .Bd -literal -offset indent
262 .Ar hostname Ns , Ns Ar hostname Ns ...: Ns Ar pathname
265 Requests for a server may be weighted, with the weighting factor appended to
266 the server name as an integer in parentheses.
267 Servers without a weighting are assumed to have a value of zero
268 .Pq most likely to be selected .
269 Progressively higher values decrease the chance of being selected.
271 .Bd -literal -offset indent
272 man -ro alpha,bravo,charlie(1),delta(4):/usr/man
279 have the highest priority; host
283 Server proximity takes priority in the selection process.
284 In the example above, if the server
286 is on the same network segment as the client, but the others are on different
287 network segments, then
289 will be selected; the weighting value is ignored.
290 The weighting has effect only when selecting between servers with the same
292 The automounter always selects the localhost over other servers on the same
293 network segment, regardless of weighting.
295 In cases where each server has a different export point, the weighting can
298 .Bd -literal -offset indent
299 man -ro alpha:/usr/man bravo,charlie(1):/usr/share/man \e
303 A mapping can be continued across input lines by escaping the NEWLINE with a
306 Comments begin with a number sign
308 and end at the subsequent NEWLINE.
309 .Ss Map Key Substitution
312 character is expanded to the value of the
314 field for the entry in which it occurs.
316 .Bd -literal -offset indent
317 jane sparcserver:/home/&
327 character, when supplied as the
329 field, is recognized as the catch-all entry.
330 Such an entry will match any key not previously matched.
331 For instance, if the following entry appeared in the indirect map for
333 .Bd -literal -offset indent
337 this would allow automatic mounts in
339 of any remote file system whose location could be specified as:
340 .Bd -literal -offset indent
341 .Ar hostname Ns : Ns Pa /export/config/ Ns Ar hostname
344 Note that the wildcard key does not work in conjunction with the
347 .Ss Variable Substitution
348 Client specific variables can be used within an
353 appeared within a map,
355 would expand it to its current value for the client's host name.
356 Supported variables are:
357 .Bl -column "PLATFORM" "arch -k or uname -m"
358 .It Sy NAME Ta Sy OUTPUT OF Ta Sy DESCRIPTION (EXAMPLE)
361 .Ta architecture name
372 .Ta Nm arch Fl k No or Nm uname Fl m
373 .Ta kernel architecture name or machine hardware name
389 .Ta native instruction set architecture for the system
394 .Pq Qq Sy SUNW,Sun-Fire-V240
397 If a reference needs to be protected from affixed characters, you can surround
398 the variable name with curly braces
399 .Pq Qq Sy \(lC Ns Sy \(rC .
401 A multiple mount entry takes the form:
402 .Bd -literal -offset indent
403 .Ar key Oo Fl Ns Ar mount-options Oc Oo Oo Ar mountpoint Oc
404 .Oo Fl Ns Ar mount-options Oc Ar location Ns ... Oc Ns ...
409 is optional for the first mount and mandatory for all subsequent mounts.
412 is taken as a pathname relative to the directory named by
416 is omitted in the first occurrence, a
423 Given an entry in the indirect map for
425 .Bd -literal -offset indent
427 / svr1,svr2:/export/src/beta \e
428 /1.0 svr1,svr2:/export/src/beta/1.0 \e
429 /1.0/man svr1,svr2:/export/src/beta/1.0/man
432 All offsets must exist on the server under
435 will automatically mount
439 .Pa /src/beta/1.0/man ,
440 as needed, from either
444 whichever host is nearest and responds first.
445 .Ss Other File System Types
446 The automounter assumes NFS mounts as a default file system type.
447 Other file system types can be described using the
450 Other mount options specific to this file system type can be combined with the
453 The location field must contain information specific to the file system type.
454 If the location field begins with a slash, a colon character must be prepended,
455 for instance, to mount a CD file system:
456 .Bd -literal -offset indent
457 cdrom -fstype=hsfs,ro :/dev/sr0
463 .Bd -literal -offset indent
464 src -fstype=autofs auto_src
467 Use this procedure only if you are not using Volume Manager.
471 section for information on option inheritance.
473 An indirect map allows you to specify mappings for the subdirectories you wish
476 indicated on the command line.
477 In an indirect map, each
479 consists of a simple name that refers to one or more file systems that are to be
482 Entries in a direct map are associated directly with
487 is the full pathname of an
490 The direct map as a whole is not associated with any single directory.
492 Direct maps are distinguished from indirect maps by the
496 .Bd -literal -offset indent
497 # Master map for automounter
500 /net -hosts -nosuid,nobrowse
501 /home auto_home -nobrowse
505 The contents of another map can be included within a map with an entry of the
507 .Bd -literal -offset indent
513 begins with a slash, it is assumed to be the pathname of a local file.
514 Otherwise, the location of the map is determined by the policy of the name
515 service switch according to the entry for the automounter in
516 .Pa /etc/nsswitch.conf ,
518 .Bd -literal -offset indent
522 If the name service is
524 then the name is assumed to be that of a local file in
526 If the key being searched for is not found in the included map, the search
527 continues with the next entry.
529 There are two special maps available:
537 directory and assumes that the map key is the hostname of an NFS server.
540 daemon dynamically constructs a map entry from the server's list of exported
542 References to a directory under
544 will refer to the corresponding directory relative to
550 map cancels a previous map for the directory indicated.
551 This is most useful in the
553 for cancelling entries that would otherwise be inherited from the
558 entries must be inserted before the included map entry.
560 Local maps that have the execute bit set in their file permissions will be
561 executed by the automounter and provided with a key to be looked up as an
563 The executable map is expected to return the content of an automounter map entry
564 on its stdout or no output if the entry cannot be determined.
565 A direct map cannot be made executable.
566 .Ss Configuration and the auto_master Map
567 When initiated without arguments,
569 consults the master map for a list of
571 mount points and their maps.
574 mounts that are not already mounted, and unmounts
576 mounts that have been removed from the master map or direct map.
578 The master map is assumed to be called
580 and its location is determined by the name service switch policy.
581 Normally the master map is located initially as a local file
582 .Pa /etc/auto_master .
586 daemon supports browsability of indirect maps.
587 This allows all of the potential mount points to be visible, whether or not they
591 option can be added to any indirect
593 map to disable browsing.
595 .Bd -literal -offset indent
596 /net -hosts -nosuid,nobrowse
602 would only be visible in
604 after they are mounted, but all potential mount points would be visible under
608 option enables browsability of
611 This is the default for all indirect maps.
615 option does not work in conjunction with the wildcard key.
616 .Ss Restricting Mount Maps
617 Options specified for a map are used as the default options for all the entries
619 They are ignored when map entries specify their own mount options.
621 In some cases, however, it is desirable to force
622 .Sy nosuid , nodevices , nosetuid ,
625 for a complete mount map and its submounts.
626 This can be done by specifying the additional mount option,
628 .Bd -literal -offset indent
629 /home auto_home -restrict,nosuid,hard
634 option forces the inheritance of all the restrictive options
635 .Sy nosuid , nodevices , nosetuid ,
638 as well as the restrict option itself.
639 In this particular example, the
643 option are inherited but the
648 option also prevents the execution of
650 and is enforced for auto mounts established by programs with fewer than all
651 privileges available in their zone.
654 .It Pa /etc/auto_master
655 Master automount map.
656 .It Pa /etc/auto_home
657 Map to support automounted home directories.
658 .It Pa /etc/nsswitch.conf
659 Name service switch configuration file.
661 .Xr nsswitch.conf 4 .
680 mount points must not be hierarchically related.
684 mount point to be created within another
688 Since each direct map entry results in a new
690 mount such maps should be kept short.
692 Entries in both direct and indirect maps can be modified at any time.
693 The new information is used when
695 next uses the map entry to do a mount.
697 New entries added to a master map or direct map will not be useful until the
698 automount command is run to install them as new
701 New entries added to an indirect map may be used immediately.
703 As of the Solaris 2.6 release, a listing
709 directory associated with an indirect map shows all potential mountable
711 The attributes associated with the potential mountable entries are temporary.
712 The real file system attributes will only be shown once the file system has been
715 Default mount options can be assigned to an entire map when specified as an
716 optional third field in the master map.
717 These options apply only to map entries that have no mount options.
718 Note that map entities with options override the default options, as at this
719 time, the options do not concatenate.
720 The concatenation feature is planned for a future release.
722 When operating on a map that invokes an NFS mount, the default number of
723 retries for the automounter is 0, that is, a single mount attempt, with no
725 Note that this is significantly different from the default
731 The Network Information Service
733 was formerly known as Sun Yellow Pages
735 The functionality of the two remains the same.
739 service is managed by the service management facility,
741 under the service identifier:
742 .Bd -literal -offset indent
743 svc:/system/filesystem/autofs:default
746 Administrative actions on this service, such as enabling, disabling, or
747 requesting restart, can be performed using
749 The service's status can be queried using the