Print this page
6198 Let's EOL cachefs
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man1m/automount.1m.man.txt
+++ new/usr/src/man/man1m/automount.1m.man.txt
1 1 AUTOMOUNT(1M) Maintenance Commands AUTOMOUNT(1M)
2 2
3 3
4 4
5 5 NAME
6 6 automount - install automatic mount points
7 7
8 8 SYNOPSIS
9 9 /usr/sbin/automount [-t duration] [-v]
10 10
11 11
12 12 DESCRIPTION
13 13 The automount utility installs autofs mount points and associates an
14 14 automount map with each mount point. It starts the automountd(1M)
15 15 daemon if it finds any non-trivial entries in either local or
16 16 distributed automount maps and if the daemon is not already running.
17 17 The autofs file system monitors attempts to access directories within
18 18 it and notifies the automountd(1M) daemon. The daemon uses the map to
19 19 locate a file system, which it then mounts at the point of reference
20 20 within the autofs file system. A map can be assigned to an autofs mount
21 21 using an entry in the /etc/auto_master map or a direct map.
22 22
23 23
24 24 If the file system is not accessed within an appropriate interval (10
25 25 minutes by default), the automountd daemon unmounts the file system.
26 26
27 27
28 28 The file /etc/auto_master determines the locations of all autofs mount
29 29 points. By default, this file contains three entries:
30 30
31 31 # Master map for automounter
32 32 #
33 33 +auto_master
34 34 /net -hosts -nosuid
35 35 /home auto_home
36 36
37 37
38 38
39 39
40 40 The +auto_master entry is a reference to an external NIS or NIS+ master
41 41 map. If one exists, then its entries are read as if they occurred in
42 42 place of the +auto_master entry. The remaining entries in the master
43 43 file specify a directory on which an autofs mount will be made followed
44 44 by the automounter map to be associated with it. Optional mount options
45 45 may be supplied as an optional third field in the each entry. These
46 46 options are used for any entries in the map that do not specify mount
47 47 options explicitly. The automount command is usually run without
48 48 arguments. It compares the entries /etc/auto_master with the current
49 49 list of autofs mounts in /etc/mnttab and adds, removes or updates
50 50 autofs mounts to bring the /etc/mnttab up to date with the
51 51 /etc/auto_master. At boot time it installs all autofs mounts from the
52 52 master map. Subsequently, it may be run to install autofs mounts for
53 53 new entries in the master map or the direct map, or to perform unmounts
54 54 for entries that have been removed from these maps.
55 55
56 56 Automount with Solaris Trusted Extensions
57 57 If a system is configured with Solaris Trusted Extensions, additional
58 58 processing is performed to facilitate multilevel home directory access.
59 59 A list of zones whose labels are dominated by the current zone is
60 60 generated and default auto_home automount maps are generated if they do
61 61 not currently exist. These automount maps are named
62 62 auto_home_<zonename>, where <zonename> is the name of each zone's
63 63 lower-level zone. An autofs mount of each such auto_home map is then
64 64 performed, regardless of whether it is explicitly or implicitly listed
65 65 in the master map. Instead of autofs mounting the standard auto_home
66 66 map, the zone uses an auto_home file appended with its own zone name.
67 67 Each zone's auto_home map is uniquely named so that it can be
68 68 maintained and shared by all zones using a common name server.
69 69
70 70
71 71 By default, the home directories of lower-level zones are mounted read-
72 72 only under /zone/<zonename>/export/home when each zone is booted. The
73 73 default auto_home_<zonename> automount map specifies that path as the
74 74 source directory for an lofs remount onto
75 75 /zone/<zonename>/home/<username>. For example, the file
76 76 auto_home_public, as generated from a higher level zone would contain:
77 77
78 78
79 79 +auto_home_public
80 80
81 81
82 82 * -fstype=lofs :/zone/public/export/home/&
83 83
84 84
85 85 When a home directory is referenced and the name does not match any
86 86 other keys in the auto_home_public map, it will match this loopback
87 87 mount specification. If this loopback match occurs and the name
88 88 corresponds to a valid user whose home directory does not exist in the
89 89 public zone, the directory is automatically created on behalf of the
90 90 user.
91 91
92 92 OPTIONS
93 93 The following options are supported:
94 94
95 95 -t duration
96 96 Specifies a duration, in seconds, that a file system is
97 97 to remain mounted when not in use. The default is 10
98 98 minutes.
99 99
100 100
101 101 -v
102 102 Verbose mode. Notifies of autofs mounts, unmounts, or
103 103 other non-essential information.
104 104
105 105
106 106 USAGE
107 107 Map Entry Format
108 108 A simple map entry (mapping) takes the form:
↓ open down ↓ |
108 lines elided |
↑ open up ↑ |
109 109
110 110 key [ -mount-options ] location ...
111 111
112 112
113 113
114 114
115 115 where key is the full pathname of the directory to mount when used in a
116 116 direct map, or the simple name of a subdirectory in an indirect map.
117 117 mount-options is a comma-separated list of mount options, and location
118 118 specifies a file system from which the directory may be mounted. In
119 - the case of a simple NFS mount, the options that can be used are as
119 + the case of a simple NFS mount, the options that can be used are
120 120 specified in mount_nfs(1M), and location takes the form:
121 121
122 122 host:pathname
123 123
124 124
125 125
126 126
127 127 host is the name of the host from which to mount the file system, and
128 128 pathname is the absolute pathname of the directory to mount.
129 129
130 130
131 - Options to other file systems are documented on the other mount_*
132 - reference manual pages, for example, mount_cachefs(1M).
131 + Options to other file systems are documented in the other mount_*
132 + reference manual pages.
133 133
134 134 Replicated File Systems
135 135 Multiple location fields can be specified for replicated NFS file
136 136 systems, in which case automount and the kernel will each try to use
137 137 that information to increase availability. If the read-only flag is set
138 138 in the map entry, automountd mounts a list of locations that the kernel
139 139 may use, sorted by several criteria. Only locations available at mount
140 140 time will be mounted, and thus be available to the kernel. When a
141 141 server does not respond, the kernel will switch to an alternate server.
142 142 The sort ordering of automount is used to determine how the next server
143 143 is chosen. If the read-only flag is not set, automount will mount the
144 144 best single location, chosen by the same sort ordering, and new servers
145 145 will only be chosen when an unmount has been possible, and a remount is
146 146 done. Servers on the same local subnet are given the strongest
147 147 preference, and servers on the local net are given the second strongest
148 148 preference. Among servers equally far away, response times will
149 149 determine the order if no weighting factors (see below) are used.
150 150
151 151
152 152 If the list includes server locations using both the NFS Version 2
153 153 Protocol and the NFS Version 3 Protocol, automount will choose only a
154 154 subset of the server locations on the list, so that all entries will be
155 155 the same protocol. It will choose servers with the NFS Version 3
156 156 Protocol so long as an NFS Version 2 Protocol server on a local subnet
157 157 will not be ignored. See the for additional details.
158 158
159 159
160 160 If each location in the list shares the same pathname then a single
161 161 location may be used with a comma-separated list of hostnames:
162 162
163 163 hostname,hostname...:pathname
164 164
165 165
166 166
167 167
168 168 Requests for a server may be weighted, with the weighting factor
169 169 appended to the server name as an integer in parentheses. Servers
170 170 without a weighting are assumed to have a value of zero (most likely to
171 171 be selected). Progressively higher values decrease the chance of being
172 172 selected. In the example,
173 173
174 174 man -ro alpha,bravo,charlie(1),delta(4):/usr/man
175 175
176 176
177 177
178 178
179 179 hosts alpha and bravo have the highest priority; host delta has the
180 180 lowest.
181 181
182 182
183 183 Server proximity takes priority in the selection process. In the
184 184 example above, if the server delta is on the same network segment as
185 185 the client, but the others are on different network segments, then
186 186 delta will be selected; the weighting value is ignored. The weighting
187 187 has effect only when selecting between servers with the same network
188 188 proximity. The automounter always selects the localhost over other
189 189 servers on the same network segment, regardless of weighting.
190 190
191 191
192 192 In cases where each server has a different export point, the weighting
193 193 can still be applied. For example:
194 194
195 195 man -ro alpha:/usr/man bravo,charlie(1):/usr/share/man
196 196 delta(3):/export/man
197 197
198 198
199 199
200 200
201 201 A mapping can be continued across input lines by escaping the NEWLINE
202 202 with a backslash (\) Comments begin with a number sign (#) and end at
203 203 the subsequent NEWLINE.
204 204
205 205 Map Key Substitution
206 206 The ampersand (&) character is expanded to the value of the key field
207 207 for the entry in which it occurs. In this case:
208 208
209 209 jane sparcserver:/home/&
210 210
211 211
212 212
213 213
214 214 the & expands to jane.
215 215
216 216 Wildcard Key
217 217 The asterisk (*) character, when supplied as the key field, is
218 218 recognized as the catch-all entry. Such an entry will match any key not
219 219 previously matched. For instance, if the following entry appeared in
220 220 the indirect map for /config:
221 221
222 222 * &:/export/config/&
223 223
224 224
225 225
226 226
227 227 this would allow automatic mounts in /config of any remote file system
228 228 whose location could be specified as:
229 229
230 230 hostname:/export/config/hostname
231 231
232 232
233 233
234 234
235 235 Note that the wildcard key does not work in conjunction with the -browse
236 236 option.
237 237
238 238 Variable Substitution
239 239 Client specific variables can be used within an automount map. For
240 240 instance, if $HOST appeared within a map, automount would expand it to
241 241 its current value for the client's host name. Supported variables are:
242 242
243 243
244 244
245 245
246 246 ARCH The output of arch The architecture name. For example, sun4 on a sun4u machine.
247 247 CPU The output of uname -p The processor type.
248 248 For example, "sparc"
249 249 HOST The output of uname -n The host name.
250 250 For example, myhost.
251 251 KARCH The output of arch -k or uname -m The kernel architecture name or machine hardware name. For example, sun4u.
252 252
253 253 OSNAME The output of uname -s The OS name.
254 254 For example, "SunOS"
255 255 OSREL The output of uname -r The OS release name.
256 256 For example "5.3"
257 257 OSVERS The output of uname -v The OS version.
258 258 For example, "beta1.0"
259 259 NATISA The output of isainfo -n The native instruction set architecture for the system.
260 260 For example, "sparcv9"
261 261 PLATFORM The output of uname -i The platform name. For example, SUNW,Sun-Fire-V240.
262 262
263 263
264 264
265 265
266 266 If a reference needs to be protected from affixed characters, you can
267 267 surround the variable name with curly braces ({}).
268 268
269 269 Multiple Mounts
270 270 A multiple mount entry takes the form:
271 271
272 272 key [-mount-options] [[mountpoint] [-mount-options] location...]...
273 273
274 274
275 275
276 276
277 277 The initial /[mountpoint] is optional for the first mount and mandatory
278 278 for all subsequent mounts. The optional mountpoint is taken as a
279 279 pathname relative to the directory named by key. If mountpoint is
280 280 omitted in the first occurrence, a mountpoint of / (root) is implied.
281 281
282 282
283 283 Given an entry in the indirect map for /src
284 284
285 285 beta -ro\
286 286 / svr1,svr2:/export/src/beta \
287 287 /1.0 svr1,svr2:/export/src/beta/1.0 \
288 288 /1.0/man svr1,svr2:/export/src/beta/1.0/man
289 289
290 290
291 291
292 292
293 293 All offsets must exist on the server under beta. automount will
294 294 automatically mount /src/beta, /src/beta/1.0, and /src/beta/1.0/man, as
295 295 needed, from either svr1 or svr2, whichever host is nearest and
296 296 responds first.
297 297
298 298 Other File System Types
299 299 The automounter assumes NFS mounts as a default file system type. Other
300 300 file system types can be described using the fstype mount option. Other
301 301 mount options specific to this file system type can be combined with
302 302 the fstype option. The location field must contain information specific
303 303 to the file system type. If the location field begins with a slash, a
304 304 colon character must be prepended, for instance, to mount a CD file
305 305 system:
306 306
307 307 cdrom -fstype=hsfs,ro :/dev/sr0
308 308
309 309
310 310
311 311
↓ open down ↓ |
169 lines elided |
↑ open up ↑ |
312 312 or to perform an autofs mount:
313 313
314 314 src -fstype=autofs auto_src
315 315
316 316
317 317
318 318
319 319 Use this procedure only if you are not using Volume Manager.
320 320
321 321
322 - Mounts using CacheFS are most useful when applied to an entire map as
323 - map defaults. The following entry in the master map describes cached
324 - home directory mounts. It assumes the default location of the cache
325 - directory, /cache.
326 -
327 - /home auto_home -fstype =cachefs,backfstype=nfs
328 -
329 -
330 -
331 -
332 322 See the NOTES section for information on option inheritance.
333 323
334 324 Indirect Maps
335 325 An indirect map allows you to specify mappings for the subdirectories
336 326 you wish to mount under the directory indicated on the command line. In
337 327 an indirect map, each key consists of a simple name that refers to one
338 328 or more file systems that are to be mounted as needed.
339 329
340 330 Direct Maps
341 331 Entries in a direct map are associated directly with autofs mount
342 332 points. Each key is the full pathname of an autofs mount point. The
343 333 direct map as a whole is not associated with any single directory.
344 334
345 335
346 336 Direct maps are distinguished from indirect maps by the /- key. For
347 337 example:
348 338
349 339 # Master map for automounter
350 340 #
351 341 +auto_master
352 342 /net -hosts -nosuid,nobrowse
353 343 /home auto_home -nobrowse
354 344 /- auto_direct
355 345
356 346
357 347
358 348 Included Maps
359 349 The contents of another map can be included within a map with an entry
360 350 of the form
361 351
362 352 +mapname
363 353
364 354
365 355
366 356
367 357 If mapname begins with a slash, it is assumed to be the pathname of a
368 358 local file. Otherwise, the location of the map is determined by the
369 359 policy of the name service switch according to the entry for the
370 360 automounter in /etc/nsswitch.conf, such as
371 361
372 362 automount: files nis
373 363
374 364
375 365
376 366
377 367 If the name service is files, then the name is assumed to be that of a
378 368 local file in /etc. If the key being searched for is not found in the
379 369 included map, the search continues with the next entry.
380 370
381 371 Special Maps
382 372 There are two special maps available: -hosts and -null. The -hosts map is
383 373 used with the /net directory and assumes that the map key is the
384 374 hostname of an NFS server. The automountd daemon dynamically constructs
385 375 a map entry from the server's list of exported file systems. References
386 376 to a directory under /net/hermes will refer to the corresponding
387 377 directory relative to hermes root.
388 378
389 379
390 380 The -null map cancels a previous map for the directory indicated. This
391 381 is most useful in the /etc/auto_master for cancelling entries that
392 382 would otherwise be inherited from the +auto_master include entry. To be
393 383 effective, the -null entries must be inserted before the included map
394 384 entry.
395 385
396 386 Executable Maps
397 387 Local maps that have the execute bit set in their file permissions will
398 388 be executed by the automounter and provided with a key to be looked up
399 389 as an argument. The executable map is expected to return the content of
400 390 an automounter map entry on its stdout or no output if the entry cannot
401 391 be determined. A direct map cannot be made executable.
402 392
403 393 Configuration and the auto_master Map
404 394 When initiated without arguments, automount consults the master map for
405 395 a list of autofs mount points and their maps. It mounts any autofs
406 396 mounts that are not already mounted, and unmounts autofs mounts that
407 397 have been removed from the master map or direct map.
408 398
409 399
410 400 The master map is assumed to be called auto_master and its location is
411 401 determined by the name service switch policy. Normally the master map
412 402 is located initially as a local file /etc/auto_master.
413 403
414 404 Browsing
415 405 The automount daemon supports browsability of indirect maps. This
416 406 allows all of the potential mount points to be visible, whether or not
417 407 they are mounted. The -nobrowse option can be added to any indirect
418 408 autofs map to disable browsing. For example:
419 409
420 410 /net -hosts -nosuid,nobrowse
421 411 /home auto_home
422 412
423 413
424 414
425 415
426 416 In this case, any hostnames would only be visible in /net after they
427 417 are mounted, but all potential mount points would be visible under
428 418 /home. The -browse option enables browsability of autofs file systems.
429 419 This is the default for all indirect maps.
430 420
431 421
432 422 The -browse option does not work in conjunction with the wildcard key.
433 423
434 424 Restricting Mount Maps
435 425 Options specified for a map are used as the default options for all the
436 426 entries in that map. They are ignored when map entries specify their
437 427 own mount options.
438 428
439 429
440 430 In some cases, however, it is desirable to force nosuid, nodevices,
441 431 nosetuid, or noexec for a complete mount map and its submounts. This
442 432 can be done by specifying the additional mount option, -restrict.
443 433
444 434 /home auto_home -restrict,nosuid,hard
445 435
446 436
447 437
448 438
449 439 The -restrict option forces the inheritance of all the restrictive
450 440 options nosuid, nodevices, nosetuid, and noexec as well as the restrict
451 441 option itself. In this particular example, the nosuid and restrict
452 442 option are inherited but the hard option is not. The restrict option
453 443 also prevents the execution of "executable maps" and is enforced for
454 444 auto mounts established by programs with fewer than all privileges
455 445 available in their zone.
456 446
457 447 EXIT STATUS
458 448 The following exit values are returned:
459 449
460 450 0
461 451 Successful completion.
462 452
463 453
464 454 1
465 455 An error occurred.
466 456
467 457
468 458 FILES
469 459 /etc/auto_master
470 460 Master automount map.
471 461
472 462
473 463 /etc/auto_home
474 464 Map to support automounted home directories.
475 465
476 466
477 467 /etc/default/autofs
478 468 Supplies default values for parameters for
↓ open down ↓ |
137 lines elided |
↑ open up ↑ |
479 469 automount and automountd. See autofs(4).
480 470
481 471
482 472 /etc/nsswitch.conf
483 473 Name service switch configuration file. See
484 474 nsswitch.conf(4).
485 475
486 476
487 477 SEE ALSO
488 478 isainfo(1), ls(1), svcs(1), uname(1), automountd(1M), mount(1M),
489 - mount_cachefs( 1M), mount_nfs(1M), svcadm(1M), autofs(4),
490 - attributes(5), nfssec(5), smf(5)
479 + mount_nfs(1M), svcadm(1M), autofs(4), attributes(5), nfssec(5), smf(5)
491 480
492 481
493 482
494 483 NOTES
495 484 autofs mount points must not be hierarchically related. automount does
496 485 not allow an autofs mount point to be created within another autofs
497 486 mount.
498 487
499 488
500 489 Since each direct map entry results in a new autofs mount such maps
501 490 should be kept short.
502 491
503 492
504 493 Entries in both direct and indirect maps can be modified at any time.
505 494 The new information is used when automountd next uses the map entry to
506 495 do a mount.
507 496
508 497
509 498 New entries added to a master map or direct map will not be useful
510 499 until the automount command is run to install them as new autofs mount
511 500 points. New entries added to an indirect map may be used immediately.
512 501
513 502
514 503 As of the Solaris 2.6 release, a listing (see ls(1)) of the autofs
515 504 directory associated with an indirect map shows all potential mountable
516 505 entries. The attributes associated with the potential mountable entries
517 506 are temporary. The real file system attributes will only be shown once
518 507 the file system has been mounted.
519 508
520 509
521 510 Default mount options can be assigned to an entire map when specified
522 511 as an optional third field in the master map. These options apply only
523 512 to map entries that have no mount options. Note that map entities with
524 513 options override the default options, as at this time, the options do
525 514 not concatenate. The concatenation feature is planned for a future
526 515 release.
527 516
528 517
529 518 When operating on a map that invokes an NFS mount, the default number
530 519 of retries for the automounter is 0, that is, a single mount attempt,
531 520 with no retries. Note that this is significantly different from the
532 521 default (10000) for the mount_nfs(1M) utility.
533 522
534 523
535 524 The Network Information Service (NIS) was formerly known as Sun Yellow
536 525 Pages (YP). The functionality of the two remains the same.
537 526
538 527
539 528 The automount service is managed by the service management facility,
540 529 smf(5), under the service identifier:
541 530
542 531 svc:/system/filesystem/autofs:default
↓ open down ↓ |
42 lines elided |
↑ open up ↑ |
543 532
544 533
545 534
546 535
547 536 Administrative actions on this service, such as enabling, disabling, or
548 537 requesting restart, can be performed using svcadm(1M). The service's
549 538 status can be queried using the svcs(1) command.
550 539
551 540
552 541
553 - March 28, 2008 AUTOMOUNT(1M)
542 + September 8, 2015 AUTOMOUNT(1M)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX