xref: /illumos-gate/usr/src/man/man8/automount.8 (revision bbf21555)
1d002581cSYuri Pankov.\"
2d002581cSYuri Pankov.\" The contents of this file are subject to the terms of the
3d002581cSYuri Pankov.\" Common Development and Distribution License (the "License").
4d002581cSYuri Pankov.\" You may not use this file except in compliance with the License.
5d002581cSYuri Pankov.\"
6d002581cSYuri Pankov.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7d002581cSYuri Pankov.\" or http://www.opensolaris.org/os/licensing.
8d002581cSYuri Pankov.\" See the License for the specific language governing permissions
9d002581cSYuri Pankov.\" and limitations under the License.
10d002581cSYuri Pankov.\"
11d002581cSYuri Pankov.\" When distributing Covered Code, include this CDDL HEADER in each
12d002581cSYuri Pankov.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
13d002581cSYuri Pankov.\" If applicable, add the following below this CDDL HEADER, with the
14d002581cSYuri Pankov.\" fields enclosed by brackets "[]" replaced with your own identifying
15d002581cSYuri Pankov.\" information: Portions Copyright [yyyy] [name of copyright owner]
16d002581cSYuri Pankov.\"
17d002581cSYuri Pankov.\"
18ed22c710SYuri Pankov.\" Copyright 1989 AT&T
19c10c16deSRichard Lowe.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
20c66b8046SYuri Pankov.\" Copyright 2017 Nexenta Systems, Inc.
21d002581cSYuri Pankov.\"
22ff31d5bfSPeter Tribble.Dd February 25, 2017
23*bbf21555SRichard Lowe.Dt AUTOMOUNT 8
24d002581cSYuri Pankov.Os
25d002581cSYuri Pankov.Sh NAME
26d002581cSYuri Pankov.Nm automount
27d002581cSYuri Pankov.Nd install automatic mount points
28d002581cSYuri Pankov.Sh SYNOPSIS
29d002581cSYuri Pankov.Nm
30d002581cSYuri Pankov.Op Fl v
31d002581cSYuri Pankov.Op Fl t Ar duration
32d002581cSYuri Pankov.Sh DESCRIPTION
33d002581cSYuri PankovThe
34d002581cSYuri Pankov.Nm
35d002581cSYuri Pankovutility installs
36d002581cSYuri Pankov.Nm autofs
3772d3dbb9SYuri Pankovmount points and associates an automount map with each mount point.
3872d3dbb9SYuri PankovIt starts the
39*bbf21555SRichard Lowe.Xr automountd 8
40c10c16deSRichard Lowedaemon if it finds any non-trivial entries in either local or distributed
4172d3dbb9SYuri Pankovautomount maps and if the daemon is not already running.
4272d3dbb9SYuri PankovThe
43d002581cSYuri Pankov.Nm autofs
44d002581cSYuri Pankovfile system monitors attempts to access directories within it and notifies the
45*bbf21555SRichard Lowe.Xr automountd 8
4672d3dbb9SYuri Pankovdaemon.
4772d3dbb9SYuri PankovThe daemon uses the map to locate a file system, which it then mounts at the
4872d3dbb9SYuri Pankovpoint of reference within the
49d002581cSYuri Pankov.Nm autofs
5072d3dbb9SYuri Pankovfile system.
5172d3dbb9SYuri PankovA map can be assigned to an
52d002581cSYuri Pankov.Nm autofs
53d002581cSYuri Pankovmount using an entry in the
54d002581cSYuri Pankov.Pa /etc/auto_master
55d002581cSYuri Pankovmap or a direct map.
56d002581cSYuri Pankov.Pp
57d002581cSYuri PankovIf the file system is not accessed within an appropriate interval
58d002581cSYuri Pankov.Pq 10 minutes by default ,
59d002581cSYuri Pankovthe
60d002581cSYuri Pankov.Nm automountd
61d002581cSYuri Pankovdaemon unmounts the file system.
62d002581cSYuri Pankov.Pp
63d002581cSYuri PankovThe file
64d002581cSYuri Pankov.Pa /etc/auto_master
65d002581cSYuri Pankovdetermines the locations of all
66d002581cSYuri Pankov.Nm autofs
6772d3dbb9SYuri Pankovmount points.
6872d3dbb9SYuri PankovBy default, this file contains three entries:
69d002581cSYuri Pankov.Bd -literal -offset indent
70c10c16deSRichard Lowe# Master map for automounter
71c10c16deSRichard Lowe#
72c10c16deSRichard Lowe+auto_master
73d002581cSYuri Pankov/net	-hosts -nosuid
74d002581cSYuri Pankov/home	auto_home
75d002581cSYuri Pankov.Ed
76d002581cSYuri Pankov.Pp
77d002581cSYuri PankovThe
78d002581cSYuri Pankov.Sy +auto_master
7972d3dbb9SYuri Pankoventry is a reference to an external NIS master map.
8072d3dbb9SYuri PankovIf one exists, then its entries are read as if they occurred in place of the
81d002581cSYuri Pankov.Sy +auto_master
8272d3dbb9SYuri Pankoventry.
8372d3dbb9SYuri PankovThe remaining entries in the master file specify a directory on which an
84d002581cSYuri Pankov.Nm autofs
85d002581cSYuri Pankovmount will be made followed by the automounter map to be associated with it.
86d002581cSYuri PankovOptional mount options may be supplied as an optional third field in the each
8772d3dbb9SYuri Pankoventry.
8872d3dbb9SYuri PankovThese options are used for any entries in the map that do not specify mount
8972d3dbb9SYuri Pankovoptions explicitly.
9072d3dbb9SYuri PankovThe
91d002581cSYuri Pankov.Nm
9272d3dbb9SYuri Pankovcommand is usually run without arguments.
9372d3dbb9SYuri PankovIt compares the entries
94d002581cSYuri Pankov.Pa /etc/auto_master
95d002581cSYuri Pankovwith the current list of
96d002581cSYuri Pankov.Nm autofs
97d002581cSYuri Pankovmounts in
98d002581cSYuri Pankov.Pa /etc/mnttab
99d002581cSYuri Pankovand adds, removes or updates
100d002581cSYuri Pankov.Nm autofs
101d002581cSYuri Pankovmounts to bring the
102d002581cSYuri Pankov.Pa /etc/mnttab
103d002581cSYuri Pankovup to date with the
104d002581cSYuri Pankov.Pa /etc/auto_master .
105d002581cSYuri PankovAt boot time it installs all
106d002581cSYuri Pankov.Nm autofs
10772d3dbb9SYuri Pankovmounts from the master map.
10872d3dbb9SYuri PankovSubsequently, it may be run to install
109d002581cSYuri Pankov.Nm autofs
110d002581cSYuri Pankovmounts for new entries in the master map or the direct map, or to perform
111d002581cSYuri Pankovunmounts for entries that have been removed from these maps.
112d002581cSYuri Pankov.Ss Automount with Solaris Trusted Extensions
113c10c16deSRichard LoweIf a system is configured with Solaris Trusted Extensions, additional
11472d3dbb9SYuri Pankovprocessing is performed to facilitate multilevel home directory access.
11572d3dbb9SYuri PankovA list of zones whose labels are dominated by the current zone is generated and
116d002581cSYuri Pankovdefault
117d002581cSYuri Pankov.Sy auto_home
11872d3dbb9SYuri Pankovautomount maps are generated if they do not currently exist.
11972d3dbb9SYuri PankovThese automount maps are named
120d002581cSYuri Pankov.Sy auto_home_ Ns Ar zonename ,
121d002581cSYuri Pankovwhere
122d002581cSYuri Pankov.Ar zonename
12372d3dbb9SYuri Pankovis the name of each zone's lower-level zone.
12472d3dbb9SYuri PankovAn
125d002581cSYuri Pankov.Nm autofs
126d002581cSYuri Pankovmount of each such
127d002581cSYuri Pankov.Sy auto_home
128d002581cSYuri Pankovmap is then performed, regardless of whether it is explicitly or implicitly
12972d3dbb9SYuri Pankovlisted in the master map.
13072d3dbb9SYuri PankovInstead of
131d002581cSYuri Pankov.Nm autofs
132d002581cSYuri Pankovmounting the standard
133d002581cSYuri Pankov.Sy auto_home
134d002581cSYuri Pankovmap, the zone uses an
135d002581cSYuri Pankov.Pa auto_home
13672d3dbb9SYuri Pankovfile appended with its own zone name.
13772d3dbb9SYuri PankovEach zone's
138d002581cSYuri Pankov.Sy auto_home
139d002581cSYuri Pankovmap is uniquely named so that it can be maintained and shared by all zones using
140d002581cSYuri Pankova common name server.
141d002581cSYuri Pankov.Pp
142c10c16deSRichard LoweBy default, the home directories of lower-level zones are mounted read-only
143d002581cSYuri Pankovunder
144d002581cSYuri Pankov.Pa /zone/ Ns Ar zonename Ns Pa /export/home
14572d3dbb9SYuri Pankovwhen each zone is booted.
14672d3dbb9SYuri PankovThe default
147d002581cSYuri Pankov.Sy auto_home_ Ns Ar zonename
148d002581cSYuri Pankovautomount map specifies that path as the source directory for an
149d002581cSYuri Pankov.Nm lofs
150d002581cSYuri Pankovremount onto
151d002581cSYuri Pankov.Pa /zone/ Ns Ar zonename Ns Pa /home/ Ns Ar username .
152d002581cSYuri PankovFor example, the file
153d002581cSYuri Pankov.Pa auto_home_public ,
154d002581cSYuri Pankovas generated from a higher level zone would contain:
155d002581cSYuri Pankov.Bd -literal -offset indent
156c10c16deSRichard Lowe+auto_home_public
157d002581cSYuri Pankov*	-fstype=lofs	:/zone/public/export/home/&
158d002581cSYuri Pankov.Ed
159d002581cSYuri Pankov.Pp
160c10c16deSRichard LoweWhen a home directory is referenced and the name does not match any other keys
161d002581cSYuri Pankovin the
162d002581cSYuri Pankov.Sy auto_home_public
16372d3dbb9SYuri Pankovmap, it will match this loopback mount specification.
16472d3dbb9SYuri PankovIf this loopback match occurs and the name corresponds to a valid user whose
16572d3dbb9SYuri Pankovhome directory does not exist in the public zone, the directory is automatically
16672d3dbb9SYuri Pankovcreated on behalf of the user.
167d002581cSYuri Pankov.Sh OPTIONS
168c10c16deSRichard LoweThe following options are supported:
169d002581cSYuri Pankov.Bl -tag -width Ds
170d002581cSYuri Pankov.It Fl v
17172d3dbb9SYuri PankovVerbose mode.
17272d3dbb9SYuri PankovNotifies of
173d002581cSYuri Pankov.Nm autofs
174d002581cSYuri Pankovmounts, unmounts, or other non-essential information.
175d002581cSYuri Pankov.It Fl t Ar duration
176d002581cSYuri PankovSpecifies a
177d002581cSYuri Pankov.Ar duration ,
17872d3dbb9SYuri Pankovin seconds, that a file system is to remain mounted when not in use.
17972d3dbb9SYuri PankovThe default is
180d002581cSYuri Pankov.Sy 10
181d002581cSYuri Pankovminutes.
182d002581cSYuri Pankov.El
183d002581cSYuri Pankov.Sh USAGE
184d002581cSYuri Pankov.Ss Map Entry Format
185d002581cSYuri PankovA simple map entry
186d002581cSYuri Pankov.Pq mapping
187d002581cSYuri Pankovtakes the form:
188d002581cSYuri Pankov.Bd -literal -offset indent
189d002581cSYuri Pankov.Ar key Oo Fl Ns Ar mount-options Oc Ar location Ns ...
190d002581cSYuri Pankov.Ed
191d002581cSYuri Pankov.Pp
192d002581cSYuri Pankovwhere
193d002581cSYuri Pankov.Ar key
194d002581cSYuri Pankovis the full pathname of the directory to mount when used in a direct map, or the
195d002581cSYuri Pankovsimple name of a subdirectory in an indirect map.
196d002581cSYuri Pankov.Ar mount-options
197d002581cSYuri Pankovis a comma-separated list of
198d002581cSYuri Pankov.Nm mount
199d002581cSYuri Pankovoptions, and
200d002581cSYuri Pankov.Ar location
20172d3dbb9SYuri Pankovspecifies a file system from which the directory may be mounted.
20272d3dbb9SYuri PankovIn the case of a simple NFS mount, the options that can be used are specified in
203*bbf21555SRichard Lowe.Xr mount_nfs 8 ,
204d002581cSYuri Pankovand
205d002581cSYuri Pankov.Ar location
206d002581cSYuri Pankovtakes the form:
207d002581cSYuri Pankov.Pp
208c66b8046SYuri Pankov.Dl Ar host Ns \&: Ns Ar pathname
209d002581cSYuri Pankov.Pp
210d002581cSYuri Pankov.Ar host
211d002581cSYuri Pankovis the name of the host from which to mount the file system, and
212d002581cSYuri Pankov.Ar pathname
213d002581cSYuri Pankovis the absolute pathname of the directory to mount.
214d002581cSYuri Pankov.Pp
215d002581cSYuri PankovOptions to other file systems are documented in the other
216d002581cSYuri Pankov.Nm mount_*
217bd93c05dSAlexander Ereminreference manual pages.
218d002581cSYuri Pankov.Ss Replicated File Systems
219d002581cSYuri PankovMultiple
220d002581cSYuri Pankov.Ar location
221d002581cSYuri Pankovfields can be specified for replicated NFS file systems, in which case
222d002581cSYuri Pankov.Nm
223d002581cSYuri Pankovand the kernel will each try to use that information to increase availability.
224d002581cSYuri PankovIf the read-only flag is set in the map entry,
225d002581cSYuri Pankov.Nm automountd
226d002581cSYuri Pankovmounts a list of locations that the kernel may use, sorted by several criteria.
227d002581cSYuri PankovOnly locations available at mount time will be mounted, and thus be available to
22872d3dbb9SYuri Pankovthe kernel.
22972d3dbb9SYuri PankovWhen a server does not respond, the kernel will switch to an alternate server.
23072d3dbb9SYuri PankovThe sort ordering of
231d002581cSYuri Pankov.Nm
23272d3dbb9SYuri Pankovis used to determine how the next server is chosen.
23372d3dbb9SYuri PankovIf the read-only flag is not set,
234d002581cSYuri Pankov.Nm
235d002581cSYuri Pankovwill mount the best single location, chosen by the same sort ordering, and new
236d002581cSYuri Pankovservers will only be chosen when an unmount has been possible, and a remount is
23772d3dbb9SYuri Pankovdone.
23872d3dbb9SYuri PankovServers on the same local subnet are given the strongest preference, and servers
23972d3dbb9SYuri Pankovon the local net are given the second strongest preference.
24072d3dbb9SYuri PankovAmong servers equally far away, response times will determine the order if no
241d002581cSYuri Pankovweighting factors
242d002581cSYuri Pankov.Pq see below
243d002581cSYuri Pankovare used.
244d002581cSYuri Pankov.Pp
245d002581cSYuri PankovIf the list includes server locations using both the NFS Version 2 Protocol and
246d002581cSYuri Pankovthe NFS Version 3 Protocol,
247d002581cSYuri Pankov.Nm
248d002581cSYuri Pankovwill choose only a subset of the server locations on the list, so that all
24972d3dbb9SYuri Pankoventries will be the same protocol.
25072d3dbb9SYuri PankovIt will choose servers with the NFS Version 3 Protocol so long as an NFS Version
25172d3dbb9SYuri Pankov2 Protocol server on a local subnet will not be ignored.
25272d3dbb9SYuri PankovSee the FIXME for additional details.
253d002581cSYuri Pankov.Pp
254d002581cSYuri PankovIf each
255d002581cSYuri Pankov.Ar location
256d002581cSYuri Pankovin the list shares the same
257d002581cSYuri Pankov.Ar pathname
258d002581cSYuri Pankovthen a single
259d002581cSYuri Pankov.Ar location
260d002581cSYuri Pankovmay be used with a comma-separated list of hostnames:
261d002581cSYuri Pankov.Bd -literal -offset indent
262c66b8046SYuri Pankov.Ar hostname Ns \&, Ns Ar hostname Ns ...: Ns Ar pathname
263d002581cSYuri Pankov.Ed
264d002581cSYuri Pankov.Pp
265c10c16deSRichard LoweRequests for a server may be weighted, with the weighting factor appended to
26672d3dbb9SYuri Pankovthe server name as an integer in parentheses.
26772d3dbb9SYuri PankovServers without a weighting are assumed to have a value of zero
268d002581cSYuri Pankov.Pq most likely to be selected .
26972d3dbb9SYuri PankovProgressively higher values decrease the chance of being selected.
27072d3dbb9SYuri PankovIn the example,
271d002581cSYuri Pankov.Bd -literal -offset indent
272d002581cSYuri Pankovman -ro	alpha,bravo,charlie(1),delta(4):/usr/man
273d002581cSYuri Pankov.Ed
274d002581cSYuri Pankov.Pp
275d002581cSYuri Pankovhosts
276d002581cSYuri Pankov.Sy alpha
277d002581cSYuri Pankovand
278d002581cSYuri Pankov.Sy bravo
279d002581cSYuri Pankovhave the highest priority; host
280d002581cSYuri Pankov.Sy delta
281c10c16deSRichard Lowehas the lowest.
282d002581cSYuri Pankov.Pp
28372d3dbb9SYuri PankovServer proximity takes priority in the selection process.
28472d3dbb9SYuri PankovIn the example above, if the server
285d002581cSYuri Pankov.Sy delta
286d002581cSYuri Pankovis on the same network segment as the client, but the others are on different
287d002581cSYuri Pankovnetwork segments, then
288d002581cSYuri Pankov.Sy delta
28972d3dbb9SYuri Pankovwill be selected; the weighting value is ignored.
29072d3dbb9SYuri PankovThe weighting has effect only when selecting between servers with the same
29172d3dbb9SYuri Pankovnetwork proximity.
29272d3dbb9SYuri PankovThe automounter always selects the localhost over other servers on the same
29372d3dbb9SYuri Pankovnetwork segment, regardless of weighting.
294d002581cSYuri Pankov.Pp
295c10c16deSRichard LoweIn cases where each server has a different export point, the weighting can
29672d3dbb9SYuri Pankovstill be applied.
29772d3dbb9SYuri PankovFor example:
298d002581cSYuri Pankov.Bd -literal -offset indent
299d002581cSYuri Pankovman	-ro	alpha:/usr/man bravo,charlie(1):/usr/share/man \e
300d002581cSYuri Pankov		delta(3):/export/man
301d002581cSYuri Pankov.Ed
302d002581cSYuri Pankov.Pp
303d002581cSYuri PankovA mapping can be continued across input lines by escaping the NEWLINE with a
304d002581cSYuri Pankovbackslash
305d002581cSYuri Pankov.Pq Qq Sy \e .
306d002581cSYuri PankovComments begin with a number sign
307d002581cSYuri Pankov.Pq Qq Sy #
308d002581cSYuri Pankovand end at the subsequent NEWLINE.
309d002581cSYuri Pankov.Ss Map Key Substitution
310d002581cSYuri PankovThe ampersand
311d002581cSYuri Pankov.Pq Qq Sy \*(Am
312d002581cSYuri Pankovcharacter is expanded to the value of the
313d002581cSYuri Pankov.Ar key
31472d3dbb9SYuri Pankovfield for the entry in which it occurs.
31572d3dbb9SYuri PankovIn this case:
316d002581cSYuri Pankov.Bd -literal -offset indent
317d002581cSYuri Pankovjane	sparcserver:/home/&
318d002581cSYuri Pankov.Ed
319d002581cSYuri Pankov.Pp
320d002581cSYuri Pankovthe
321d002581cSYuri Pankov.Sy \*(Am
322d002581cSYuri Pankovexpands to
323d002581cSYuri Pankov.Sy jane .
324d002581cSYuri Pankov.Ss Wildcard Key
325d002581cSYuri PankovThe asterisk
326d002581cSYuri Pankov.Pq Qq Sy *
327d002581cSYuri Pankovcharacter, when supplied as the
328d002581cSYuri Pankov.Ar key
32972d3dbb9SYuri Pankovfield, is recognized as the catch-all entry.
33072d3dbb9SYuri PankovSuch an entry will match any key not previously matched.
33172d3dbb9SYuri PankovFor instance, if the following entry appeared in the indirect map for
332d002581cSYuri Pankov.Pa /config :
333d002581cSYuri Pankov.Bd -literal -offset indent
334d002581cSYuri Pankov*	&:/export/config/&
335d002581cSYuri Pankov.Ed
336d002581cSYuri Pankov.Pp
337d002581cSYuri Pankovthis would allow automatic mounts in
338d002581cSYuri Pankov.Pa /config
339d002581cSYuri Pankovof any remote file system whose location could be specified as:
340d002581cSYuri Pankov.Bd -literal -offset indent
341c66b8046SYuri Pankov.Ar hostname Ns \&: Ns Pa /export/config/ Ns Ar hostname
342d002581cSYuri Pankov.Ed
343d002581cSYuri Pankov.Pp
344d002581cSYuri PankovNote that the wildcard key does not work in conjunction with the
345d002581cSYuri Pankov.Fl browse
346c10c16deSRichard Loweoption.
347d002581cSYuri Pankov.Ss Variable Substitution
348d002581cSYuri PankovClient specific variables can be used within an
349d002581cSYuri Pankov.Nm
35072d3dbb9SYuri Pankovmap.
35172d3dbb9SYuri PankovFor instance, if
352d002581cSYuri Pankov.Sy $HOST
353d002581cSYuri Pankovappeared within a map,
354d002581cSYuri Pankov.Nm
35572d3dbb9SYuri Pankovwould expand it to its current value for the client's host name.
35672d3dbb9SYuri PankovSupported variables are:
357d002581cSYuri Pankov.Bl -column "PLATFORM" "arch -k or uname -m"
358d002581cSYuri Pankov.It Sy NAME Ta Sy OUTPUT OF Ta Sy DESCRIPTION (EXAMPLE)
359c66b8046SYuri Pankov.It Ev ARCH Ta Nm arch Ta architecture name Pq Qq Sy sun4
360c66b8046SYuri Pankov.It Ev CPU Ta Nm uname Fl p Ta processor type Pq Qq Sy sparc
361c66b8046SYuri Pankov.It Ev HOST Ta Nm uname Fl n Ta host name Pq Qq Sy myhost
362c66b8046SYuri Pankov.It Ev KARCH Ta Nm arch Fl k No or Nm uname Fl m Ta kernel architecture name or
363c66b8046SYuri Pankovmachine hardware name
364d002581cSYuri Pankov.Pq Qq Sy sun4u
365c66b8046SYuri Pankov.It Ev OSNAME Ta Nm uname Fl s Ta OS name Pq Qq Sy SunOS
366c66b8046SYuri Pankov.It Ev OSREL Ta Nm name Fl r Ta OS release name Pq Qq Sy 5.3
367c66b8046SYuri Pankov.It Ev OSVERS Ta Nm uname Fl v Ta OS version Pq Qq Sy beta1.0
368c66b8046SYuri Pankov.It Ev NATISA Ta Nm isainfo Fl n Ta native instruction set architecture for the
369c66b8046SYuri Pankovsystem
370d002581cSYuri Pankov.Pq Qq Sy sparcv9
371c66b8046SYuri Pankov.It Ev PLATFORM Ta Nm uname Fl i Ta platform name Pq Qq Sy SUNW,Sun-Fire-V240
372d002581cSYuri Pankov.El
373d002581cSYuri Pankov.Pp
374c10c16deSRichard LoweIf a reference needs to be protected from affixed characters, you can surround
375d002581cSYuri Pankovthe variable name with curly braces
376d002581cSYuri Pankov.Pq Qq Sy \(lC Ns Sy \(rC .
377d002581cSYuri Pankov.Ss Multiple Mounts
378c10c16deSRichard LoweA multiple mount entry takes the form:
379d002581cSYuri Pankov.Bd -literal -offset indent
380d002581cSYuri Pankov.Ar key Oo Fl Ns Ar mount-options Oc Oo Oo Ar mountpoint Oc
381d002581cSYuri Pankov.Oo Fl Ns Ar mount-options Oc  Ar location Ns ... Oc Ns ...
382d002581cSYuri Pankov.Ed
383d002581cSYuri Pankov.Pp
384d002581cSYuri PankovThe initial
385d002581cSYuri Pankov.Ar mountpoint
38672d3dbb9SYuri Pankovis optional for the first mount and mandatory for all subsequent mounts.
38772d3dbb9SYuri PankovThe optional
388d002581cSYuri Pankov.Ar mountpoint
389d002581cSYuri Pankovis taken as a pathname relative to the directory named by
390d002581cSYuri Pankov.Ar key .
391d002581cSYuri PankovIf
392d002581cSYuri Pankov.Ar mountpoint
393d002581cSYuri Pankovis omitted in the first occurrence, a
394d002581cSYuri Pankov.Ar mountpoint
395d002581cSYuri Pankovof
396d002581cSYuri Pankov.Pa /
397d002581cSYuri Pankov.Pq root
398d002581cSYuri Pankovis implied.
399d002581cSYuri Pankov.Pp
400d002581cSYuri PankovGiven an entry in the indirect map for
401d002581cSYuri Pankov.Pa /src :
402d002581cSYuri Pankov.Bd -literal -offset indent
403d002581cSYuri Pankovbeta	-ro \e
404d002581cSYuri Pankov	/		svr1,svr2:/export/src/beta  \e
405d002581cSYuri Pankov	/1.0		svr1,svr2:/export/src/beta/1.0 \e
406d002581cSYuri Pankov	/1.0/man	svr1,svr2:/export/src/beta/1.0/man
407d002581cSYuri Pankov.Ed
408d002581cSYuri Pankov.Pp
409d002581cSYuri PankovAll offsets must exist on the server under
410d002581cSYuri Pankov.Sy beta .
411d002581cSYuri Pankov.Nm
412d002581cSYuri Pankovwill automatically mount
413d002581cSYuri Pankov.Pa /src/beta ,
414d002581cSYuri Pankov.Pa /src/beta/1.0 ,
415d002581cSYuri Pankovand
416d002581cSYuri Pankov.Pa /src/beta/1.0/man ,
417d002581cSYuri Pankovas needed, from either
418d002581cSYuri Pankov.Sy svr1
419d002581cSYuri Pankovor
420d002581cSYuri Pankov.Sy svr2 ,
421c10c16deSRichard Lowewhichever host is nearest and responds first.
422d002581cSYuri Pankov.Ss Other File System Types
42372d3dbb9SYuri PankovThe automounter assumes NFS mounts as a default file system type.
42472d3dbb9SYuri PankovOther file system types can be described using the
425d002581cSYuri Pankov.Sy fstype
42672d3dbb9SYuri Pankovmount option.
42772d3dbb9SYuri PankovOther mount options specific to this file system type can be combined with the
428d002581cSYuri Pankov.Sy fstype
42972d3dbb9SYuri Pankovoption.
43072d3dbb9SYuri PankovThe location field must contain information specific to the file system type.
43172d3dbb9SYuri PankovIf the location field begins with a slash, a colon character must be prepended,
43272d3dbb9SYuri Pankovfor instance, to mount a CD file system:
433d002581cSYuri Pankov.Bd -literal -offset indent
434d002581cSYuri Pankovcdrom	-fstype=hsfs,ro	:/dev/sr0
435d002581cSYuri Pankov.Ed
436d002581cSYuri Pankov.Pp
437d002581cSYuri Pankovor to perform an
438d002581cSYuri Pankov.Nm autofs
439d002581cSYuri Pankovmount:
440d002581cSYuri Pankov.Bd -literal -offset indent
441d002581cSYuri Pankovsrc	-fstype=autofs	auto_src
442d002581cSYuri Pankov.Ed
443d002581cSYuri Pankov.Pp
444c10c16deSRichard LoweUse this procedure only if you are not using Volume Manager.
445d002581cSYuri Pankov.Pp
446d002581cSYuri PankovSee the
447d002581cSYuri Pankov.Sx NOTES
448d002581cSYuri Pankovsection for information on option inheritance.
449d002581cSYuri Pankov.Ss Indirect Maps
450c10c16deSRichard LoweAn indirect map allows you to specify mappings for the subdirectories you wish
451d002581cSYuri Pankovto mount under the
452d002581cSYuri Pankov.Ar directory
45372d3dbb9SYuri Pankovindicated on the command line.
45472d3dbb9SYuri PankovIn an indirect map, each
455d002581cSYuri Pankov.Ar key
456d002581cSYuri Pankovconsists of a simple name that refers to one or more file systems that are to be
457d002581cSYuri Pankovmounted as needed.
458d002581cSYuri Pankov.Ss Direct Maps
459d002581cSYuri PankovEntries in a direct map are associated directly with
460d002581cSYuri Pankov.Nm autofs
46172d3dbb9SYuri Pankovmount points.
46272d3dbb9SYuri PankovEach
463d002581cSYuri Pankov.Ar key
464d002581cSYuri Pankovis the full pathname of an
465d002581cSYuri Pankov.Nm autofs
46672d3dbb9SYuri Pankovmount point.
46772d3dbb9SYuri PankovThe direct map as a whole is not associated with any single directory.
468d002581cSYuri Pankov.Pp
469d002581cSYuri PankovDirect maps are distinguished from indirect maps by the
470d002581cSYuri Pankov.Sy \-
47172d3dbb9SYuri Pankovkey.
47272d3dbb9SYuri PankovFor example:
473d002581cSYuri Pankov.Bd -literal -offset indent
474c10c16deSRichard Lowe# Master map for automounter
475c10c16deSRichard Lowe#
476c10c16deSRichard Lowe+auto_master
477d002581cSYuri Pankov/net	-hosts		-nosuid,nobrowse
478d002581cSYuri Pankov/home	auto_home	-nobrowse
479d002581cSYuri Pankov/-	auto_direct
480d002581cSYuri Pankov.Ed
481d002581cSYuri Pankov.Ss Included Maps
482c10c16deSRichard LoweThe contents of another map can be included within a map with an entry of the
483c10c16deSRichard Loweform
484d002581cSYuri Pankov.Bd -literal -offset indent
485d002581cSYuri Pankov.No + Ns Ar mapname
486d002581cSYuri Pankov.Ed
487d002581cSYuri Pankov.Pp
488d002581cSYuri PankovIf
489d002581cSYuri Pankov.Ar mapname
490d002581cSYuri Pankovbegins with a slash, it is assumed to be the pathname of a local file.
491d002581cSYuri PankovOtherwise, the location of the map is determined by the policy of the name
492d002581cSYuri Pankovservice switch according to the entry for the automounter in
493d002581cSYuri Pankov.Pa /etc/nsswitch.conf ,
494d002581cSYuri Pankovsuch as
495d002581cSYuri Pankov.Bd -literal -offset indent
496c10c16deSRichard Loweautomount: files nis
497d002581cSYuri Pankov.Ed
498d002581cSYuri Pankov.Pp
499d002581cSYuri PankovIf the name service is
500d002581cSYuri Pankov.Sy files ,
501d002581cSYuri Pankovthen the name is assumed to be that of a local file in
502d002581cSYuri Pankov.Pa /etc .
503d002581cSYuri PankovIf the key being searched for is not found in the included map, the search
504d002581cSYuri Pankovcontinues with the next entry.
505d002581cSYuri Pankov.Ss Special Maps
506d002581cSYuri PankovThere are two special maps available:
507d002581cSYuri Pankov.Sy -hosts
508d002581cSYuri Pankovand
509d002581cSYuri Pankov.Sy -null .
510d002581cSYuri PankovThe
511d002581cSYuri Pankov.Sy -hosts
512d002581cSYuri Pankovmap is used with the
513d002581cSYuri Pankov.Pa /net
51472d3dbb9SYuri Pankovdirectory and assumes that the map key is the hostname of an NFS server.
51572d3dbb9SYuri PankovThe
516d002581cSYuri Pankov.Nm automountd
517d002581cSYuri Pankovdaemon dynamically constructs a map entry from the server's list of exported
51872d3dbb9SYuri Pankovfile systems.
51972d3dbb9SYuri PankovReferences to a directory under
520d002581cSYuri Pankov.Pa /net/hermes
521d002581cSYuri Pankovwill refer to the corresponding directory relative to
522d002581cSYuri Pankov.Sy hermes
523d002581cSYuri Pankovroot.
524d002581cSYuri Pankov.Pp
525d002581cSYuri PankovThe
526d002581cSYuri Pankov.Sy -null
52772d3dbb9SYuri Pankovmap cancels a previous map for the directory indicated.
52872d3dbb9SYuri PankovThis is most useful in the
529d002581cSYuri Pankov.Pa /etc/auto_master
530d002581cSYuri Pankovfor cancelling entries that would otherwise be inherited from the
531d002581cSYuri Pankov.Sy +auto_master
53272d3dbb9SYuri Pankovinclude entry.
53372d3dbb9SYuri PankovTo be effective, the
534d002581cSYuri Pankov.Sy -null
535d002581cSYuri Pankoventries must be inserted before the included map entry.
536d002581cSYuri Pankov.Ss Executable Maps
537c10c16deSRichard LoweLocal maps that have the execute bit set in their file permissions will be
538c10c16deSRichard Loweexecuted by the automounter and provided with a key to be looked up as an
53972d3dbb9SYuri Pankovargument.
54072d3dbb9SYuri PankovThe executable map is expected to return the content of an automounter map entry
54172d3dbb9SYuri Pankovon its stdout or no output if the entry cannot be determined.
54272d3dbb9SYuri PankovA direct map cannot be made executable.
543d002581cSYuri Pankov.Ss Configuration and the auto_master Map
544d002581cSYuri PankovWhen initiated without arguments,
545d002581cSYuri Pankov.Nm
546d002581cSYuri Pankovconsults the master map for a list of
547d002581cSYuri Pankov.Nm autofs
54872d3dbb9SYuri Pankovmount points and their maps.
54972d3dbb9SYuri PankovIt mounts any
550d002581cSYuri Pankov.Nm autofs
551d002581cSYuri Pankovmounts that are not already mounted, and unmounts
552d002581cSYuri Pankov.Nm autofs
553d002581cSYuri Pankovmounts that have been removed from the master map or direct map.
554d002581cSYuri Pankov.Pp
555d002581cSYuri PankovThe master map is assumed to be called
556d002581cSYuri Pankov.Sy auto_master
55772d3dbb9SYuri Pankovand its location is determined by the name service switch policy.
55872d3dbb9SYuri PankovNormally the master map is located initially as a local file
559d002581cSYuri Pankov.Pa /etc/auto_master .
560d002581cSYuri Pankov.Ss Browsing
561d002581cSYuri PankovThe
562d002581cSYuri Pankov.Nm automountd
56372d3dbb9SYuri Pankovdaemon supports browsability of indirect maps.
56472d3dbb9SYuri PankovThis allows all of the potential mount points to be visible, whether or not they
56572d3dbb9SYuri Pankovare mounted.
56672d3dbb9SYuri PankovThe
567d002581cSYuri Pankov.Sy -nobrowse
568d002581cSYuri Pankovoption can be added to any indirect
569d002581cSYuri Pankov.Nm autofs
57072d3dbb9SYuri Pankovmap to disable browsing.
57172d3dbb9SYuri PankovFor example:
572d002581cSYuri Pankov.Bd -literal -offset indent
573d002581cSYuri Pankov/net	-hosts		-nosuid,nobrowse
574d002581cSYuri Pankov/home	auto_home
575d002581cSYuri Pankov.Ed
576d002581cSYuri Pankov.Pp
577d002581cSYuri PankovIn this case, any
578d002581cSYuri Pankov.Ar hostname Ns s
579d002581cSYuri Pankovwould only be visible in
580d002581cSYuri Pankov.Pa /net
581d002581cSYuri Pankovafter they are mounted, but all potential mount points would be visible under
582d002581cSYuri Pankov.Pa /home .
583d002581cSYuri PankovThe
584d002581cSYuri Pankov.Sy -browse
585d002581cSYuri Pankovoption enables browsability of
586d002581cSYuri Pankov.Nm autofs
58772d3dbb9SYuri Pankovfile systems.
58872d3dbb9SYuri PankovThis is the default for all indirect maps.
589d002581cSYuri Pankov.Pp
590d002581cSYuri PankovThe
591d002581cSYuri Pankov.Sy -browse
592d002581cSYuri Pankovoption does not work in conjunction with the wildcard key.
593d002581cSYuri Pankov.Ss Restricting Mount Maps
594c10c16deSRichard LoweOptions specified for a map are used as the default options for all the entries
59572d3dbb9SYuri Pankovin that map.
59672d3dbb9SYuri PankovThey are ignored when map entries specify their own mount options.
597d002581cSYuri Pankov.Pp
598d002581cSYuri PankovIn some cases, however, it is desirable to force
599d002581cSYuri Pankov.Sy nosuid , nodevices , nosetuid ,
600d002581cSYuri Pankovor
601d002581cSYuri Pankov.Sy noexec
60272d3dbb9SYuri Pankovfor a complete mount map and its submounts.
60372d3dbb9SYuri PankovThis can be done by specifying the additional mount option,
604d002581cSYuri Pankov.Sy -restrict .
605d002581cSYuri Pankov.Bd -literal -offset indent
606d002581cSYuri Pankov/home	auto_home	-restrict,nosuid,hard
607d002581cSYuri Pankov.Ed
608d002581cSYuri Pankov.Pp
609d002581cSYuri PankovThe
610d002581cSYuri Pankov.Sy -restrict
611d002581cSYuri Pankovoption forces the inheritance of all the restrictive options
612d002581cSYuri Pankov.Sy nosuid , nodevices , nosetuid ,
613d002581cSYuri Pankovand
614d002581cSYuri Pankov.Sy noexec
61572d3dbb9SYuri Pankovas well as the restrict option itself.
61672d3dbb9SYuri PankovIn this particular example, the
617d002581cSYuri Pankov.Sy nosuid
618d002581cSYuri Pankovand
619d002581cSYuri Pankov.Sy restrict
620d002581cSYuri Pankovoption are inherited but the
621d002581cSYuri Pankov.Sy hard
62272d3dbb9SYuri Pankovoption is not.
62372d3dbb9SYuri PankovThe
624d002581cSYuri Pankov.Sy restrict
625d002581cSYuri Pankovoption also prevents the execution of
626d002581cSYuri Pankov.Qq executable maps
627d002581cSYuri Pankovand is enforced for auto mounts established by programs with fewer than all
628d002581cSYuri Pankovprivileges available in their zone.
629d002581cSYuri Pankov.Sh FILES
630d002581cSYuri Pankov.Bl -tag -width Ds
631d002581cSYuri Pankov.It Pa /etc/auto_master
632c10c16deSRichard LoweMaster automount map.
633d002581cSYuri Pankov.It Pa /etc/auto_home
634c10c16deSRichard LoweMap to support automounted home directories.
635d002581cSYuri Pankov.It Pa /etc/nsswitch.conf
63672d3dbb9SYuri PankovName service switch configuration file.
63772d3dbb9SYuri PankovSee
638*bbf21555SRichard Lowe.Xr nsswitch.conf 5 .
639d002581cSYuri Pankov.El
640d002581cSYuri Pankov.Sh EXIT STATUS
641d002581cSYuri Pankov.Ex -std
642d002581cSYuri Pankov.Sh SEE ALSO
643d002581cSYuri Pankov.Xr isainfo 1 ,
644d002581cSYuri Pankov.Xr ls 1 ,
645d002581cSYuri Pankov.Xr svcs 1 ,
646d002581cSYuri Pankov.Xr uname 1 ,
647*bbf21555SRichard Lowe.Xr autofs 5 ,
648*bbf21555SRichard Lowe.Xr attributes 7 ,
649*bbf21555SRichard Lowe.Xr nfssec 7 ,
650*bbf21555SRichard Lowe.Xr smf 7 ,
651*bbf21555SRichard Lowe.Xr automountd 8 ,
652*bbf21555SRichard Lowe.Xr mount 8 ,
653*bbf21555SRichard Lowe.Xr mount_nfs 8 ,
654*bbf21555SRichard Lowe.Xr svcadm 8
655d002581cSYuri Pankov.Sh NOTES
656d002581cSYuri Pankov.Nm autofs
657d002581cSYuri Pankovmount points must not be hierarchically related.
658d002581cSYuri Pankov.Nm
659d002581cSYuri Pankovdoes not allow an
660d002581cSYuri Pankov.Nm autofs
661d002581cSYuri Pankovmount point to be created within another
662d002581cSYuri Pankov.Nm autofs
663c10c16deSRichard Lowemount.
664d002581cSYuri Pankov.Pp
665d002581cSYuri PankovSince each direct map entry results in a new
666d002581cSYuri Pankov.Nm autofs
667d002581cSYuri Pankovmount such maps should be kept short.
668d002581cSYuri Pankov.Pp
66972d3dbb9SYuri PankovEntries in both direct and indirect maps can be modified at any time.
67072d3dbb9SYuri PankovThe new information is used when
671d002581cSYuri Pankov.Nm automountd
672d002581cSYuri Pankovnext uses the map entry to do a mount.
673d002581cSYuri Pankov.Pp
674c10c16deSRichard LoweNew entries added to a master map or direct map will not be useful until the
675d002581cSYuri Pankovautomount command is run to install them as new
676d002581cSYuri Pankov.Nm autofs
67772d3dbb9SYuri Pankovmount points.
67872d3dbb9SYuri PankovNew entries added to an indirect map may be used immediately.
679d002581cSYuri Pankov.Pp
680d002581cSYuri PankovAs of the Solaris 2.6 release, a listing
681d002581cSYuri Pankov.Po see
682d002581cSYuri Pankov.Xr ls 1
683d002581cSYuri Pankov.Pc
684d002581cSYuri Pankovof the
685d002581cSYuri Pankov.Nm autofs
686c10c16deSRichard Lowedirectory associated with an indirect map shows all potential mountable
68772d3dbb9SYuri Pankoventries.
68872d3dbb9SYuri PankovThe attributes associated with the potential mountable entries are temporary.
68972d3dbb9SYuri PankovThe real file system attributes will only be shown once the file system has been
69072d3dbb9SYuri Pankovmounted.
691d002581cSYuri Pankov.Pp
692c10c16deSRichard LoweDefault mount options can be assigned to an entire map when specified as an
69372d3dbb9SYuri Pankovoptional third field in the master map.
69472d3dbb9SYuri PankovThese options apply only to map entries that have no mount options.
69572d3dbb9SYuri PankovNote that map entities with options override the default options, as at this
69672d3dbb9SYuri Pankovtime, the options do not concatenate.
69772d3dbb9SYuri PankovThe concatenation feature is planned for a future release.
698d002581cSYuri Pankov.Pp
699c10c16deSRichard LoweWhen operating on a map that invokes an NFS mount, the default number of
700c10c16deSRichard Loweretries for the automounter is 0, that is, a single mount attempt, with no
70172d3dbb9SYuri Pankovretries.
70272d3dbb9SYuri PankovNote that this is significantly different from the default
703d002581cSYuri Pankov.Pq 10000
704d002581cSYuri Pankovfor the
705*bbf21555SRichard Lowe.Xr mount_nfs 8
706d002581cSYuri Pankovutility.
707d002581cSYuri Pankov.Pp
708d002581cSYuri PankovThe Network Information Service
709d002581cSYuri Pankov.Pq NIS
710d002581cSYuri Pankovwas formerly known as Sun Yellow Pages
711d002581cSYuri Pankov.Pq YP .
712d002581cSYuri PankovThe functionality of the two remains the same.
713d002581cSYuri Pankov.Pp
714d002581cSYuri PankovThe
715d002581cSYuri Pankov.Nm
716d002581cSYuri Pankovservice is managed by the service management facility,
717*bbf21555SRichard Lowe.Xr smf 7 ,
718d002581cSYuri Pankovunder the service identifier:
719d002581cSYuri Pankov.Bd -literal -offset indent
720c10c16deSRichard Lowesvc:/system/filesystem/autofs:default
721d002581cSYuri Pankov.Ed
722d002581cSYuri Pankov.Pp
723c10c16deSRichard LoweAdministrative actions on this service, such as enabling, disabling, or
724d002581cSYuri Pankovrequesting restart, can be performed using
725*bbf21555SRichard Lowe.Xr svcadm 8 .
726d002581cSYuri PankovThe service's status can be queried using the
727d002581cSYuri Pankov.Xr svcs 1
728d002581cSYuri Pankovcommand.
729