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 2017 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)
359 .It Ev ARCH Ta Nm arch Ta architecture name Pq Qq Sy sun4
360 .It Ev CPU Ta Nm uname Fl p Ta processor type Pq Qq Sy sparc
361 .It Ev HOST Ta Nm uname Fl n Ta host name Pq Qq Sy myhost
362 .It Ev KARCH Ta Nm arch Fl k No or Nm uname Fl m Ta kernel architecture name or
363 machine hardware name
365 .It Ev OSNAME Ta Nm uname Fl s Ta OS name Pq Qq Sy SunOS
366 .It Ev OSREL Ta Nm name Fl r Ta OS release name Pq Qq Sy 5.3
367 .It Ev OSVERS Ta Nm uname Fl v Ta OS version Pq Qq Sy beta1.0
368 .It Ev NATISA Ta Nm isainfo Fl n Ta native instruction set architecture for the
371 .It Ev PLATFORM Ta Nm uname Fl i Ta platform name Pq Qq Sy SUNW,Sun-Fire-V240
374 If a reference needs to be protected from affixed characters, you can surround
375 the variable name with curly braces
376 .Pq Qq Sy \(lC Ns Sy \(rC .
378 A multiple mount entry takes the form:
379 .Bd -literal -offset indent
380 .Ar key Oo Fl Ns Ar mount-options Oc Oo Oo Ar mountpoint Oc
381 .Oo Fl Ns Ar mount-options Oc Ar location Ns ... Oc Ns ...
386 is optional for the first mount and mandatory for all subsequent mounts.
389 is taken as a pathname relative to the directory named by
393 is omitted in the first occurrence, a
400 Given an entry in the indirect map for
402 .Bd -literal -offset indent
404 / svr1,svr2:/export/src/beta \e
405 /1.0 svr1,svr2:/export/src/beta/1.0 \e
406 /1.0/man svr1,svr2:/export/src/beta/1.0/man
409 All offsets must exist on the server under
412 will automatically mount
416 .Pa /src/beta/1.0/man ,
417 as needed, from either
421 whichever host is nearest and responds first.
422 .Ss Other File System Types
423 The automounter assumes NFS mounts as a default file system type.
424 Other file system types can be described using the
427 Other mount options specific to this file system type can be combined with the
430 The location field must contain information specific to the file system type.
431 If the location field begins with a slash, a colon character must be prepended,
432 for instance, to mount a CD file system:
433 .Bd -literal -offset indent
434 cdrom -fstype=hsfs,ro :/dev/sr0
440 .Bd -literal -offset indent
441 src -fstype=autofs auto_src
444 Use this procedure only if you are not using Volume Manager.
448 section for information on option inheritance.
450 An indirect map allows you to specify mappings for the subdirectories you wish
453 indicated on the command line.
454 In an indirect map, each
456 consists of a simple name that refers to one or more file systems that are to be
459 Entries in a direct map are associated directly with
464 is the full pathname of an
467 The direct map as a whole is not associated with any single directory.
469 Direct maps are distinguished from indirect maps by the
473 .Bd -literal -offset indent
474 # Master map for automounter
477 /net -hosts -nosuid,nobrowse
478 /home auto_home -nobrowse
482 The contents of another map can be included within a map with an entry of the
484 .Bd -literal -offset indent
490 begins with a slash, it is assumed to be the pathname of a local file.
491 Otherwise, the location of the map is determined by the policy of the name
492 service switch according to the entry for the automounter in
493 .Pa /etc/nsswitch.conf ,
495 .Bd -literal -offset indent
499 If the name service is
501 then the name is assumed to be that of a local file in
503 If the key being searched for is not found in the included map, the search
504 continues with the next entry.
506 There are two special maps available:
514 directory and assumes that the map key is the hostname of an NFS server.
517 daemon dynamically constructs a map entry from the server's list of exported
519 References to a directory under
521 will refer to the corresponding directory relative to
527 map cancels a previous map for the directory indicated.
528 This is most useful in the
530 for cancelling entries that would otherwise be inherited from the
535 entries must be inserted before the included map entry.
537 Local maps that have the execute bit set in their file permissions will be
538 executed by the automounter and provided with a key to be looked up as an
540 The executable map is expected to return the content of an automounter map entry
541 on its stdout or no output if the entry cannot be determined.
542 A direct map cannot be made executable.
543 .Ss Configuration and the auto_master Map
544 When initiated without arguments,
546 consults the master map for a list of
548 mount points and their maps.
551 mounts that are not already mounted, and unmounts
553 mounts that have been removed from the master map or direct map.
555 The master map is assumed to be called
557 and its location is determined by the name service switch policy.
558 Normally the master map is located initially as a local file
559 .Pa /etc/auto_master .
563 daemon supports browsability of indirect maps.
564 This allows all of the potential mount points to be visible, whether or not they
568 option can be added to any indirect
570 map to disable browsing.
572 .Bd -literal -offset indent
573 /net -hosts -nosuid,nobrowse
579 would only be visible in
581 after they are mounted, but all potential mount points would be visible under
585 option enables browsability of
588 This is the default for all indirect maps.
592 option does not work in conjunction with the wildcard key.
593 .Ss Restricting Mount Maps
594 Options specified for a map are used as the default options for all the entries
596 They are ignored when map entries specify their own mount options.
598 In some cases, however, it is desirable to force
599 .Sy nosuid , nodevices , nosetuid ,
602 for a complete mount map and its submounts.
603 This can be done by specifying the additional mount option,
605 .Bd -literal -offset indent
606 /home auto_home -restrict,nosuid,hard
611 option forces the inheritance of all the restrictive options
612 .Sy nosuid , nodevices , nosetuid ,
615 as well as the restrict option itself.
616 In this particular example, the
620 option are inherited but the
625 option also prevents the execution of
627 and is enforced for auto mounts established by programs with fewer than all
628 privileges available in their zone.
631 .It Pa /etc/auto_master
632 Master automount map.
633 .It Pa /etc/auto_home
634 Map to support automounted home directories.
635 .It Pa /etc/nsswitch.conf
636 Name service switch configuration file.
638 .Xr nsswitch.conf 4 .
657 mount points must not be hierarchically related.
661 mount point to be created within another
665 Since each direct map entry results in a new
667 mount such maps should be kept short.
669 Entries in both direct and indirect maps can be modified at any time.
670 The new information is used when
672 next uses the map entry to do a mount.
674 New entries added to a master map or direct map will not be useful until the
675 automount command is run to install them as new
678 New entries added to an indirect map may be used immediately.
680 As of the Solaris 2.6 release, a listing
686 directory associated with an indirect map shows all potential mountable
688 The attributes associated with the potential mountable entries are temporary.
689 The real file system attributes will only be shown once the file system has been
692 Default mount options can be assigned to an entire map when specified as an
693 optional third field in the master map.
694 These options apply only to map entries that have no mount options.
695 Note that map entities with options override the default options, as at this
696 time, the options do not concatenate.
697 The concatenation feature is planned for a future release.
699 When operating on a map that invokes an NFS mount, the default number of
700 retries for the automounter is 0, that is, a single mount attempt, with no
702 Note that this is significantly different from the default
708 The Network Information Service
710 was formerly known as Sun Yellow Pages
712 The functionality of the two remains the same.
716 service is managed by the service management facility,
718 under the service identifier:
719 .Bd -literal -offset indent
720 svc:/system/filesystem/autofs:default
723 Administrative actions on this service, such as enabling, disabling, or
724 requesting restart, can be performed using
726 The service's status can be queried using the