1*d002581cSYuri Pankov.\" 2*d002581cSYuri Pankov.\" The contents of this file are subject to the terms of the 3*d002581cSYuri Pankov.\" Common Development and Distribution License (the "License"). 4*d002581cSYuri Pankov.\" You may not use this file except in compliance with the License. 5*d002581cSYuri Pankov.\" 6*d002581cSYuri Pankov.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 7*d002581cSYuri Pankov.\" or http://www.opensolaris.org/os/licensing. 8*d002581cSYuri Pankov.\" See the License for the specific language governing permissions 9*d002581cSYuri Pankov.\" and limitations under the License. 10*d002581cSYuri Pankov.\" 11*d002581cSYuri Pankov.\" When distributing Covered Code, include this CDDL HEADER in each 12*d002581cSYuri Pankov.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. 13*d002581cSYuri Pankov.\" If applicable, add the following below this CDDL HEADER, with the 14*d002581cSYuri Pankov.\" fields enclosed by brackets "[]" replaced with your own identifying 15*d002581cSYuri Pankov.\" information: Portions Copyright [yyyy] [name of copyright owner] 16*d002581cSYuri Pankov.\" 17*d002581cSYuri Pankov.\" 18c10c16deSRichard Lowe.\" Copyright 1989 AT&T 19c10c16deSRichard Lowe.\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved 20*d002581cSYuri Pankov.\" Copyright 2016 Nexenta Systems, Inc. 21*d002581cSYuri Pankov.\" 22*d002581cSYuri Pankov.Dd March 1, 2016 23*d002581cSYuri Pankov.Dt AUTOMOUNT 1M 24*d002581cSYuri Pankov.Os 25*d002581cSYuri Pankov.Sh NAME 26*d002581cSYuri Pankov.Nm automount 27*d002581cSYuri Pankov.Nd install automatic mount points 28*d002581cSYuri Pankov.Sh SYNOPSIS 29*d002581cSYuri Pankov.Nm 30*d002581cSYuri Pankov.Op Fl v 31*d002581cSYuri Pankov.Op Fl t Ar duration 32*d002581cSYuri Pankov.Sh DESCRIPTION 33*d002581cSYuri PankovThe 34*d002581cSYuri Pankov.Nm 35*d002581cSYuri Pankovutility installs 36*d002581cSYuri Pankov.Nm autofs 37*d002581cSYuri Pankovmount points and associates an automount map with each mount point. It starts 38*d002581cSYuri Pankovthe 39*d002581cSYuri Pankov.Xr automountd 1M 40c10c16deSRichard Lowedaemon if it finds any non-trivial entries in either local or distributed 41*d002581cSYuri Pankovautomount maps and if the daemon is not already running. The 42*d002581cSYuri Pankov.Nm autofs 43*d002581cSYuri Pankovfile system monitors attempts to access directories within it and notifies the 44*d002581cSYuri Pankov.Xr automountd 1M 45*d002581cSYuri Pankovdaemon. The daemon uses the map to locate a file system, which it then mounts at 46*d002581cSYuri Pankovthe point of reference within the 47*d002581cSYuri Pankov.Nm autofs 48*d002581cSYuri Pankovfile system. A map can be assigned to an 49*d002581cSYuri Pankov.Nm autofs 50*d002581cSYuri Pankovmount using an entry in the 51*d002581cSYuri Pankov.Pa /etc/auto_master 52*d002581cSYuri Pankovmap or a direct map. 53*d002581cSYuri Pankov.Pp 54*d002581cSYuri PankovIf the file system is not accessed within an appropriate interval 55*d002581cSYuri Pankov.Pq 10 minutes by default , 56*d002581cSYuri Pankovthe 57*d002581cSYuri Pankov.Nm automountd 58*d002581cSYuri Pankovdaemon unmounts the file system. 59*d002581cSYuri Pankov.Pp 60*d002581cSYuri PankovThe file 61*d002581cSYuri Pankov.Pa /etc/auto_master 62*d002581cSYuri Pankovdetermines the locations of all 63*d002581cSYuri Pankov.Nm autofs 64c10c16deSRichard Lowemount points. By default, this file contains three entries: 65*d002581cSYuri Pankov.Bd -literal -offset indent 66c10c16deSRichard Lowe# Master map for automounter 67c10c16deSRichard Lowe# 68c10c16deSRichard Lowe+auto_master 69c10c16deSRichard Lowe/net -hosts -nosuid 70c10c16deSRichard Lowe/home auto_home 71*d002581cSYuri Pankov.Ed 72*d002581cSYuri Pankov.Pp 73*d002581cSYuri PankovThe 74*d002581cSYuri Pankov.Sy +auto_master 75*d002581cSYuri Pankoventry is a reference to an external NIS or NIS+ master map. If one exists, then 76*d002581cSYuri Pankovits entries are read as if they occurred in place of the 77*d002581cSYuri Pankov.Sy +auto_master 78*d002581cSYuri Pankoventry. The remaining entries in the master file specify a directory on which an 79*d002581cSYuri Pankov.Nm autofs 80*d002581cSYuri Pankovmount will be made followed by the automounter map to be associated with it. 81*d002581cSYuri PankovOptional mount options may be supplied as an optional third field in the each 82*d002581cSYuri Pankoventry. These options are used for any entries in the map that do not specify 83*d002581cSYuri Pankovmount options explicitly. The 84*d002581cSYuri Pankov.Nm 85*d002581cSYuri Pankovcommand is usually run without arguments. It compares the entries 86*d002581cSYuri Pankov.Pa /etc/auto_master 87*d002581cSYuri Pankovwith the current list of 88*d002581cSYuri Pankov.Nm autofs 89*d002581cSYuri Pankovmounts in 90*d002581cSYuri Pankov.Pa /etc/mnttab 91*d002581cSYuri Pankovand adds, removes or updates 92*d002581cSYuri Pankov.Nm autofs 93*d002581cSYuri Pankovmounts to bring the 94*d002581cSYuri Pankov.Pa /etc/mnttab 95*d002581cSYuri Pankovup to date with the 96*d002581cSYuri Pankov.Pa /etc/auto_master . 97*d002581cSYuri PankovAt boot time it installs all 98*d002581cSYuri Pankov.Nm autofs 99*d002581cSYuri Pankovmounts from the master map. Subsequently, it may be run to install 100*d002581cSYuri Pankov.Nm autofs 101*d002581cSYuri Pankovmounts for new entries in the master map or the direct map, or to perform 102*d002581cSYuri Pankovunmounts for entries that have been removed from these maps. 103*d002581cSYuri Pankov.Ss Automount with Solaris Trusted Extensions 104c10c16deSRichard LoweIf a system is configured with Solaris Trusted Extensions, additional 105c10c16deSRichard Loweprocessing is performed to facilitate multilevel home directory access. A list 106c10c16deSRichard Loweof zones whose labels are dominated by the current zone is generated and 107*d002581cSYuri Pankovdefault 108*d002581cSYuri Pankov.Sy auto_home 109*d002581cSYuri Pankovautomount maps are generated if they do not currently exist. These automount 110*d002581cSYuri Pankovmaps are named 111*d002581cSYuri Pankov.Sy auto_home_ Ns Ar zonename , 112*d002581cSYuri Pankovwhere 113*d002581cSYuri Pankov.Ar zonename 114*d002581cSYuri Pankovis the name of each zone's lower-level zone. An 115*d002581cSYuri Pankov.Nm autofs 116*d002581cSYuri Pankovmount of each such 117*d002581cSYuri Pankov.Sy auto_home 118*d002581cSYuri Pankovmap is then performed, regardless of whether it is explicitly or implicitly 119*d002581cSYuri Pankovlisted in the master map. Instead of 120*d002581cSYuri Pankov.Nm autofs 121*d002581cSYuri Pankovmounting the standard 122*d002581cSYuri Pankov.Sy auto_home 123*d002581cSYuri Pankovmap, the zone uses an 124*d002581cSYuri Pankov.Pa auto_home 125*d002581cSYuri Pankovfile appended with its own zone name. Each zone's 126*d002581cSYuri Pankov.Sy auto_home 127*d002581cSYuri Pankovmap is uniquely named so that it can be maintained and shared by all zones using 128*d002581cSYuri Pankova common name server. 129*d002581cSYuri Pankov.Pp 130c10c16deSRichard LoweBy default, the home directories of lower-level zones are mounted read-only 131*d002581cSYuri Pankovunder 132*d002581cSYuri Pankov.Pa /zone/ Ns Ar zonename Ns Pa /export/home 133*d002581cSYuri Pankovwhen each zone is booted. The default 134*d002581cSYuri Pankov.Sy auto_home_ Ns Ar zonename 135*d002581cSYuri Pankovautomount map specifies that path as the source directory for an 136*d002581cSYuri Pankov.Nm lofs 137*d002581cSYuri Pankovremount onto 138*d002581cSYuri Pankov.Pa /zone/ Ns Ar zonename Ns Pa /home/ Ns Ar username . 139*d002581cSYuri PankovFor example, the file 140*d002581cSYuri Pankov.Pa auto_home_public , 141*d002581cSYuri Pankovas generated from a higher level zone would contain: 142*d002581cSYuri Pankov.Bd -literal -offset indent 143c10c16deSRichard Lowe+auto_home_public 144c10c16deSRichard Lowe* -fstype=lofs :/zone/public/export/home/& 145*d002581cSYuri Pankov.Ed 146*d002581cSYuri Pankov.Pp 147c10c16deSRichard LoweWhen a home directory is referenced and the name does not match any other keys 148*d002581cSYuri Pankovin the 149*d002581cSYuri Pankov.Sy auto_home_public 150*d002581cSYuri Pankovmap, it will match this loopback mount specification. If this loopback match 151*d002581cSYuri Pankovoccurs and the name corresponds to a valid user whose home directory does not 152*d002581cSYuri Pankovexist in the public zone, the directory is automatically created on behalf of 153*d002581cSYuri Pankovthe user. 154*d002581cSYuri Pankov.Sh OPTIONS 155c10c16deSRichard LoweThe following options are supported: 156*d002581cSYuri Pankov.Bl -tag -width Ds 157*d002581cSYuri Pankov.It Fl v 158*d002581cSYuri PankovVerbose mode. Notifies of 159*d002581cSYuri Pankov.Nm autofs 160*d002581cSYuri Pankovmounts, unmounts, or other non-essential information. 161*d002581cSYuri Pankov.It Fl t Ar duration 162*d002581cSYuri PankovSpecifies a 163*d002581cSYuri Pankov.Ar duration , 164*d002581cSYuri Pankovin seconds, that a file system is to remain mounted when not in use. The default 165*d002581cSYuri Pankovis 166*d002581cSYuri Pankov.Sy 10 167*d002581cSYuri Pankovminutes. 168*d002581cSYuri Pankov.El 169*d002581cSYuri Pankov.Sh USAGE 170*d002581cSYuri Pankov.Ss Map Entry Format 171*d002581cSYuri PankovA simple map entry 172*d002581cSYuri Pankov.Pq mapping 173*d002581cSYuri Pankovtakes the form: 174*d002581cSYuri Pankov.Bd -literal -offset indent 175*d002581cSYuri Pankov.Ar key Oo Fl Ns Ar mount-options Oc Ar location Ns ... 176*d002581cSYuri Pankov.Ed 177*d002581cSYuri Pankov.Pp 178*d002581cSYuri Pankovwhere 179*d002581cSYuri Pankov.Ar key 180*d002581cSYuri Pankovis the full pathname of the directory to mount when used in a direct map, or the 181*d002581cSYuri Pankovsimple name of a subdirectory in an indirect map. 182*d002581cSYuri Pankov.Ar mount-options 183*d002581cSYuri Pankovis a comma-separated list of 184*d002581cSYuri Pankov.Nm mount 185*d002581cSYuri Pankovoptions, and 186*d002581cSYuri Pankov.Ar location 187*d002581cSYuri Pankovspecifies a file system from which the directory may be mounted. In the case of 188*d002581cSYuri Pankova simple NFS mount, the options that can be used are specified in 189*d002581cSYuri Pankov.Xr mount_nfs 1M , 190*d002581cSYuri Pankovand 191*d002581cSYuri Pankov.Ar location 192*d002581cSYuri Pankovtakes the form: 193*d002581cSYuri Pankov.Pp 194*d002581cSYuri Pankov.Dl Ar host Ns : Ns Ar pathname 195*d002581cSYuri Pankov.Pp 196*d002581cSYuri Pankov.Ar host 197*d002581cSYuri Pankovis the name of the host from which to mount the file system, and 198*d002581cSYuri Pankov.Ar pathname 199*d002581cSYuri Pankovis the absolute pathname of the directory to mount. 200*d002581cSYuri Pankov.Pp 201*d002581cSYuri PankovOptions to other file systems are documented in the other 202*d002581cSYuri Pankov.Nm mount_* 203bd93c05dSAlexander Ereminreference manual pages. 204*d002581cSYuri Pankov.Ss Replicated File Systems 205*d002581cSYuri PankovMultiple 206*d002581cSYuri Pankov.Ar location 207*d002581cSYuri Pankovfields can be specified for replicated NFS file systems, in which case 208*d002581cSYuri Pankov.Nm 209*d002581cSYuri Pankovand the kernel will each try to use that information to increase availability. 210*d002581cSYuri PankovIf the read-only flag is set in the map entry, 211*d002581cSYuri Pankov.Nm automountd 212*d002581cSYuri Pankovmounts a list of locations that the kernel may use, sorted by several criteria. 213*d002581cSYuri PankovOnly locations available at mount time will be mounted, and thus be available to 214*d002581cSYuri Pankovthe kernel. When a server does not respond, the kernel will switch to an 215*d002581cSYuri Pankovalternate server. The sort ordering of 216*d002581cSYuri Pankov.Nm 217*d002581cSYuri Pankovis used to determine how the next server is chosen. If the read-only flag is not 218*d002581cSYuri Pankovset, 219*d002581cSYuri Pankov.Nm 220*d002581cSYuri Pankovwill mount the best single location, chosen by the same sort ordering, and new 221*d002581cSYuri Pankovservers will only be chosen when an unmount has been possible, and a remount is 222*d002581cSYuri Pankovdone. Servers on the same local subnet are given the strongest preference, and 223*d002581cSYuri Pankovservers on the local net are given the second strongest preference. Among 224*d002581cSYuri Pankovservers equally far away, response times will determine the order if no 225*d002581cSYuri Pankovweighting factors 226*d002581cSYuri Pankov.Pq see below 227*d002581cSYuri Pankovare used. 228*d002581cSYuri Pankov.Pp 229*d002581cSYuri PankovIf the list includes server locations using both the NFS Version 2 Protocol and 230*d002581cSYuri Pankovthe NFS Version 3 Protocol, 231*d002581cSYuri Pankov.Nm 232*d002581cSYuri Pankovwill choose only a subset of the server locations on the list, so that all 233*d002581cSYuri Pankoventries will be the same protocol. It will choose servers with the NFS Version 3 234*d002581cSYuri PankovProtocol so long as an NFS Version 2 Protocol server on a local subnet will not 235*d002581cSYuri Pankovbe ignored. See the FIXME for additional details. 236*d002581cSYuri Pankov.Pp 237*d002581cSYuri PankovIf each 238*d002581cSYuri Pankov.Ar location 239*d002581cSYuri Pankovin the list shares the same 240*d002581cSYuri Pankov.Ar pathname 241*d002581cSYuri Pankovthen a single 242*d002581cSYuri Pankov.Ar location 243*d002581cSYuri Pankovmay be used with a comma-separated list of hostnames: 244*d002581cSYuri Pankov.Bd -literal -offset indent 245*d002581cSYuri Pankov.Ar hostname Ns , Ns Ar hostname Ns ...: Ns Ar pathname 246*d002581cSYuri Pankov.Ed 247*d002581cSYuri Pankov.Pp 248c10c16deSRichard LoweRequests for a server may be weighted, with the weighting factor appended to 249c10c16deSRichard Lowethe server name as an integer in parentheses. Servers without a weighting are 250*d002581cSYuri Pankovassumed to have a value of zero 251*d002581cSYuri Pankov.Pq most likely to be selected . 252*d002581cSYuri PankovProgressively higher values decrease the chance of being selected. In the 253*d002581cSYuri Pankovexample, 254*d002581cSYuri Pankov.Bd -literal -offset indent 255*d002581cSYuri Pankovman -ro alpha,bravo,charlie(1),delta(4):/usr/man 256*d002581cSYuri Pankov.Ed 257*d002581cSYuri Pankov.Pp 258*d002581cSYuri Pankovhosts 259*d002581cSYuri Pankov.Sy alpha 260*d002581cSYuri Pankovand 261*d002581cSYuri Pankov.Sy bravo 262*d002581cSYuri Pankovhave the highest priority; host 263*d002581cSYuri Pankov.Sy delta 264c10c16deSRichard Lowehas the lowest. 265*d002581cSYuri Pankov.Pp 266c10c16deSRichard LoweServer proximity takes priority in the selection process. In the example above, 267*d002581cSYuri Pankovif the server 268*d002581cSYuri Pankov.Sy delta 269*d002581cSYuri Pankovis on the same network segment as the client, but the others are on different 270*d002581cSYuri Pankovnetwork segments, then 271*d002581cSYuri Pankov.Sy delta 272*d002581cSYuri Pankovwill be selected; the weighting value is ignored. The weighting has effect only 273*d002581cSYuri Pankovwhen selecting between servers with the same network proximity. The automounter 274*d002581cSYuri Pankovalways selects the localhost over other servers on the same network segment, 275*d002581cSYuri Pankovregardless of weighting. 276*d002581cSYuri Pankov.Pp 277c10c16deSRichard LoweIn cases where each server has a different export point, the weighting can 278c10c16deSRichard Lowestill be applied. For example: 279*d002581cSYuri Pankov.Bd -literal -offset indent 280*d002581cSYuri Pankovman -ro alpha:/usr/man bravo,charlie(1):/usr/share/man \e 281c10c16deSRichard Lowe delta(3):/export/man 282*d002581cSYuri Pankov.Ed 283*d002581cSYuri Pankov.Pp 284*d002581cSYuri PankovA mapping can be continued across input lines by escaping the NEWLINE with a 285*d002581cSYuri Pankovbackslash 286*d002581cSYuri Pankov.Pq Qq Sy \e . 287*d002581cSYuri PankovComments begin with a number sign 288*d002581cSYuri Pankov.Pq Qq Sy # 289*d002581cSYuri Pankovand end at the subsequent NEWLINE. 290*d002581cSYuri Pankov.Ss Map Key Substitution 291*d002581cSYuri PankovThe ampersand 292*d002581cSYuri Pankov.Pq Qq Sy \*(Am 293*d002581cSYuri Pankovcharacter is expanded to the value of the 294*d002581cSYuri Pankov.Ar key 295c10c16deSRichard Lowefield for the entry in which it occurs. In this case: 296*d002581cSYuri Pankov.Bd -literal -offset indent 297*d002581cSYuri Pankovjane sparcserver:/home/& 298*d002581cSYuri Pankov.Ed 299*d002581cSYuri Pankov.Pp 300*d002581cSYuri Pankovthe 301*d002581cSYuri Pankov.Sy \*(Am 302*d002581cSYuri Pankovexpands to 303*d002581cSYuri Pankov.Sy jane . 304*d002581cSYuri Pankov.Ss Wildcard Key 305*d002581cSYuri PankovThe asterisk 306*d002581cSYuri Pankov.Pq Qq Sy * 307*d002581cSYuri Pankovcharacter, when supplied as the 308*d002581cSYuri Pankov.Ar key 309*d002581cSYuri Pankovfield, is recognized as the catch-all entry. Such an entry will match any key 310*d002581cSYuri Pankovnot previously matched. For instance, if the following entry appeared in the 311*d002581cSYuri Pankovindirect map for 312*d002581cSYuri Pankov.Pa /config : 313*d002581cSYuri Pankov.Bd -literal -offset indent 314*d002581cSYuri Pankov* &:/export/config/& 315*d002581cSYuri Pankov.Ed 316*d002581cSYuri Pankov.Pp 317*d002581cSYuri Pankovthis would allow automatic mounts in 318*d002581cSYuri Pankov.Pa /config 319*d002581cSYuri Pankovof any remote file system whose location could be specified as: 320*d002581cSYuri Pankov.Bd -literal -offset indent 321*d002581cSYuri Pankov.Ar hostname Ns : Ns Pa /export/config/ Ns Ar hostname 322*d002581cSYuri Pankov.Ed 323*d002581cSYuri Pankov.Pp 324*d002581cSYuri PankovNote that the wildcard key does not work in conjunction with the 325*d002581cSYuri Pankov.Fl browse 326c10c16deSRichard Loweoption. 327*d002581cSYuri Pankov.Ss Variable Substitution 328*d002581cSYuri PankovClient specific variables can be used within an 329*d002581cSYuri Pankov.Nm 330*d002581cSYuri Pankovmap. For instance, if 331*d002581cSYuri Pankov.Sy $HOST 332*d002581cSYuri Pankovappeared within a map, 333*d002581cSYuri Pankov.Nm 334*d002581cSYuri Pankovwould expand it to its current value for the client's host name. Supported 335*d002581cSYuri Pankovvariables are: 336*d002581cSYuri Pankov.Bl -column "PLATFORM" "arch -k or uname -m" 337*d002581cSYuri Pankov.It Sy NAME Ta Sy OUTPUT OF Ta Sy DESCRIPTION (EXAMPLE) 338*d002581cSYuri Pankov.It Ev ARCH 339*d002581cSYuri Pankov.Ta Nm arch 340*d002581cSYuri Pankov.Ta architecture name 341*d002581cSYuri Pankov.Pq Qq Sy sun4 342*d002581cSYuri Pankov.It Ev CPU 343*d002581cSYuri Pankov.Ta Nm uname Fl p 344*d002581cSYuri Pankov.Ta processor type 345*d002581cSYuri Pankov.Pq Qq Sy sparc 346*d002581cSYuri Pankov.It Ev HOST 347*d002581cSYuri Pankov.Ta Nm uname Fl n 348*d002581cSYuri Pankov.Ta host name 349*d002581cSYuri Pankov.Pq Qq Sy myhost 350*d002581cSYuri Pankov.It Ev KARCH 351*d002581cSYuri Pankov.Ta Nm arch Fl k No or Nm uname Fl m 352*d002581cSYuri Pankov.Ta kernel architecture name or machine hardware name 353*d002581cSYuri Pankov.Pq Qq Sy sun4u 354*d002581cSYuri Pankov.It Ev OSNAME 355*d002581cSYuri Pankov.Ta Nm uname Fl s 356*d002581cSYuri Pankov.Ta OS name 357*d002581cSYuri Pankov.Pq Qq Sy SunOS 358*d002581cSYuri Pankov.It Ev OSREL 359*d002581cSYuri Pankov.Ta Nm name Fl r 360*d002581cSYuri Pankov.Ta OS release name 361*d002581cSYuri Pankov.Pq Qq Sy 5.3 362*d002581cSYuri Pankov.It Ev OSVERS 363*d002581cSYuri Pankov.Ta Nm uname Fl v 364*d002581cSYuri Pankov.Ta OS version 365*d002581cSYuri Pankov.Pq Qq Sy beta1.0 366*d002581cSYuri Pankov.It Ev NATISA 367*d002581cSYuri Pankov.Ta Nm isainfo Fl n 368*d002581cSYuri Pankov.Ta native instruction set architecture for the system 369*d002581cSYuri Pankov.Pq Qq Sy sparcv9 370*d002581cSYuri Pankov.It Ev PLATFORM 371*d002581cSYuri Pankov.Ta Nm uname Fl i 372*d002581cSYuri Pankov.Ta platform name 373*d002581cSYuri Pankov.Pq Qq Sy SUNW,Sun-Fire-V240 374*d002581cSYuri Pankov.El 375*d002581cSYuri Pankov.Pp 376c10c16deSRichard LoweIf a reference needs to be protected from affixed characters, you can surround 377*d002581cSYuri Pankovthe variable name with curly braces 378*d002581cSYuri Pankov.Pq Qq Sy \(lC Ns Sy \(rC . 379*d002581cSYuri Pankov.Ss Multiple Mounts 380c10c16deSRichard LoweA multiple mount entry takes the form: 381*d002581cSYuri Pankov.Bd -literal -offset indent 382*d002581cSYuri Pankov.Ar key Oo Fl Ns Ar mount-options Oc Oo Oo Ar mountpoint Oc 383*d002581cSYuri Pankov.Oo Fl Ns Ar mount-options Oc Ar location Ns ... Oc Ns ... 384*d002581cSYuri Pankov.Ed 385*d002581cSYuri Pankov.Pp 386*d002581cSYuri PankovThe initial 387*d002581cSYuri Pankov.Ar mountpoint 388*d002581cSYuri Pankovis optional for the first mount and mandatory for all subsequent mounts. The 389*d002581cSYuri Pankovoptional 390*d002581cSYuri Pankov.Ar mountpoint 391*d002581cSYuri Pankovis taken as a pathname relative to the directory named by 392*d002581cSYuri Pankov.Ar key . 393*d002581cSYuri PankovIf 394*d002581cSYuri Pankov.Ar mountpoint 395*d002581cSYuri Pankovis omitted in the first occurrence, a 396*d002581cSYuri Pankov.Ar mountpoint 397*d002581cSYuri Pankovof 398*d002581cSYuri Pankov.Pa / 399*d002581cSYuri Pankov.Pq root 400*d002581cSYuri Pankovis implied. 401*d002581cSYuri Pankov.Pp 402*d002581cSYuri PankovGiven an entry in the indirect map for 403*d002581cSYuri Pankov.Pa /src : 404*d002581cSYuri Pankov.Bd -literal -offset indent 405c10c16deSRichard Lowebeta -ro \e 406c10c16deSRichard Lowe / svr1,svr2:/export/src/beta \e 407c10c16deSRichard Lowe /1.0 svr1,svr2:/export/src/beta/1.0 \e 408c10c16deSRichard Lowe /1.0/man svr1,svr2:/export/src/beta/1.0/man 409*d002581cSYuri Pankov.Ed 410*d002581cSYuri Pankov.Pp 411*d002581cSYuri PankovAll offsets must exist on the server under 412*d002581cSYuri Pankov.Sy beta . 413*d002581cSYuri Pankov.Nm 414*d002581cSYuri Pankovwill automatically mount 415*d002581cSYuri Pankov.Pa /src/beta , 416*d002581cSYuri Pankov.Pa /src/beta/1.0 , 417*d002581cSYuri Pankovand 418*d002581cSYuri Pankov.Pa /src/beta/1.0/man , 419*d002581cSYuri Pankovas needed, from either 420*d002581cSYuri Pankov.Sy svr1 421*d002581cSYuri Pankovor 422*d002581cSYuri Pankov.Sy svr2 , 423c10c16deSRichard Lowewhichever host is nearest and responds first. 424*d002581cSYuri Pankov.Ss Other File System Types 425*d002581cSYuri PankovThe automounter assumes NFS mounts as a default file system type. Other file 426*d002581cSYuri Pankovsystem types can be described using the 427*d002581cSYuri Pankov.Sy fstype 428*d002581cSYuri Pankovmount option. Other mount options specific to this file system type can be 429*d002581cSYuri Pankovcombined with the 430*d002581cSYuri Pankov.Sy fstype 431*d002581cSYuri Pankovoption. The location field must contain information specific to the file system 432*d002581cSYuri Pankovtype. If the location field begins with a slash, a colon character must be 433*d002581cSYuri Pankovprepended, for instance, to mount a CD file system: 434*d002581cSYuri Pankov.Bd -literal -offset indent 435*d002581cSYuri Pankovcdrom -fstype=hsfs,ro :/dev/sr0 436*d002581cSYuri Pankov.Ed 437*d002581cSYuri Pankov.Pp 438*d002581cSYuri Pankovor to perform an 439*d002581cSYuri Pankov.Nm autofs 440*d002581cSYuri Pankovmount: 441*d002581cSYuri Pankov.Bd -literal -offset indent 442*d002581cSYuri Pankovsrc -fstype=autofs auto_src 443*d002581cSYuri Pankov.Ed 444*d002581cSYuri Pankov.Pp 445c10c16deSRichard LoweUse this procedure only if you are not using Volume Manager. 446*d002581cSYuri Pankov.Pp 447*d002581cSYuri PankovSee the 448*d002581cSYuri Pankov.Sx NOTES 449*d002581cSYuri Pankovsection for information on option inheritance. 450*d002581cSYuri Pankov.Ss Indirect Maps 451c10c16deSRichard LoweAn indirect map allows you to specify mappings for the subdirectories you wish 452*d002581cSYuri Pankovto mount under the 453*d002581cSYuri Pankov.Ar directory 454*d002581cSYuri Pankovindicated on the command line. In an indirect map, each 455*d002581cSYuri Pankov.Ar key 456*d002581cSYuri Pankovconsists of a simple name that refers to one or more file systems that are to be 457*d002581cSYuri Pankovmounted as needed. 458*d002581cSYuri Pankov.Ss Direct Maps 459*d002581cSYuri PankovEntries in a direct map are associated directly with 460*d002581cSYuri Pankov.Nm autofs 461*d002581cSYuri Pankovmount points. Each 462*d002581cSYuri Pankov.Ar key 463*d002581cSYuri Pankovis the full pathname of an 464*d002581cSYuri Pankov.Nm autofs 465*d002581cSYuri Pankovmount point. The direct map as a whole is not associated with any single 466*d002581cSYuri Pankovdirectory. 467*d002581cSYuri Pankov.Pp 468*d002581cSYuri PankovDirect maps are distinguished from indirect maps by the 469*d002581cSYuri Pankov.Sy \- 470*d002581cSYuri Pankovkey. For example: 471*d002581cSYuri Pankov.Bd -literal -offset indent 472c10c16deSRichard Lowe# Master map for automounter 473c10c16deSRichard Lowe# 474c10c16deSRichard Lowe+auto_master 475c10c16deSRichard Lowe/net -hosts -nosuid,nobrowse 476c10c16deSRichard Lowe/home auto_home -nobrowse 477c10c16deSRichard Lowe/- auto_direct 478*d002581cSYuri Pankov.Ed 479*d002581cSYuri Pankov.Ss Included Maps 480c10c16deSRichard LoweThe contents of another map can be included within a map with an entry of the 481c10c16deSRichard Loweform 482*d002581cSYuri Pankov.Bd -literal -offset indent 483*d002581cSYuri Pankov.No + Ns Ar mapname 484*d002581cSYuri Pankov.Ed 485*d002581cSYuri Pankov.Pp 486*d002581cSYuri PankovIf 487*d002581cSYuri Pankov.Ar mapname 488*d002581cSYuri Pankovbegins with a slash, it is assumed to be the pathname of a local file. 489*d002581cSYuri PankovOtherwise, the location of the map is determined by the policy of the name 490*d002581cSYuri Pankovservice switch according to the entry for the automounter in 491*d002581cSYuri Pankov.Pa /etc/nsswitch.conf , 492*d002581cSYuri Pankovsuch as 493*d002581cSYuri Pankov.Bd -literal -offset indent 494c10c16deSRichard Loweautomount: files nis 495*d002581cSYuri Pankov.Ed 496*d002581cSYuri Pankov.Pp 497*d002581cSYuri PankovIf the name service is 498*d002581cSYuri Pankov.Sy files , 499*d002581cSYuri Pankovthen the name is assumed to be that of a local file in 500*d002581cSYuri Pankov.Pa /etc . 501*d002581cSYuri PankovIf the key being searched for is not found in the included map, the search 502*d002581cSYuri Pankovcontinues with the next entry. 503*d002581cSYuri Pankov.Ss Special Maps 504*d002581cSYuri PankovThere are two special maps available: 505*d002581cSYuri Pankov.Sy -hosts 506*d002581cSYuri Pankovand 507*d002581cSYuri Pankov.Sy -null . 508*d002581cSYuri PankovThe 509*d002581cSYuri Pankov.Sy -hosts 510*d002581cSYuri Pankovmap is used with the 511*d002581cSYuri Pankov.Pa /net 512*d002581cSYuri Pankovdirectory and assumes that the map key is the hostname of an NFS server. The 513*d002581cSYuri Pankov.Nm automountd 514*d002581cSYuri Pankovdaemon dynamically constructs a map entry from the server's list of exported 515*d002581cSYuri Pankovfile systems. References to a directory under 516*d002581cSYuri Pankov.Pa /net/hermes 517*d002581cSYuri Pankovwill refer to the corresponding directory relative to 518*d002581cSYuri Pankov.Sy hermes 519*d002581cSYuri Pankovroot. 520*d002581cSYuri Pankov.Pp 521*d002581cSYuri PankovThe 522*d002581cSYuri Pankov.Sy -null 523*d002581cSYuri Pankovmap cancels a previous map for the directory indicated. This is most useful in 524*d002581cSYuri Pankovthe 525*d002581cSYuri Pankov.Pa /etc/auto_master 526*d002581cSYuri Pankovfor cancelling entries that would otherwise be inherited from the 527*d002581cSYuri Pankov.Sy +auto_master 528*d002581cSYuri Pankovinclude entry. To be effective, the 529*d002581cSYuri Pankov.Sy -null 530*d002581cSYuri Pankoventries must be inserted before the included map entry. 531*d002581cSYuri Pankov.Ss Executable Maps 532c10c16deSRichard LoweLocal maps that have the execute bit set in their file permissions will be 533c10c16deSRichard Loweexecuted by the automounter and provided with a key to be looked up as an 534c10c16deSRichard Loweargument. The executable map is expected to return the content of an 535c10c16deSRichard Loweautomounter map entry on its stdout or no output if the entry cannot be 536c10c16deSRichard Lowedetermined. A direct map cannot be made executable. 537*d002581cSYuri Pankov.Ss Configuration and the auto_master Map 538*d002581cSYuri PankovWhen initiated without arguments, 539*d002581cSYuri Pankov.Nm 540*d002581cSYuri Pankovconsults the master map for a list of 541*d002581cSYuri Pankov.Nm autofs 542*d002581cSYuri Pankovmount points and their maps. It mounts any 543*d002581cSYuri Pankov.Nm autofs 544*d002581cSYuri Pankovmounts that are not already mounted, and unmounts 545*d002581cSYuri Pankov.Nm autofs 546*d002581cSYuri Pankovmounts that have been removed from the master map or direct map. 547*d002581cSYuri Pankov.Pp 548*d002581cSYuri PankovThe master map is assumed to be called 549*d002581cSYuri Pankov.Sy auto_master 550*d002581cSYuri Pankovand its location is determined by the name service switch policy. Normally the 551*d002581cSYuri Pankovmaster map is located initially as a local file 552*d002581cSYuri Pankov.Pa /etc/auto_master . 553*d002581cSYuri Pankov.Ss Browsing 554*d002581cSYuri PankovThe 555*d002581cSYuri Pankov.Nm automountd 556*d002581cSYuri Pankovdaemon supports browsability of indirect maps. This allows all of the potential 557*d002581cSYuri Pankovmount points to be visible, whether or not they are mounted. The 558*d002581cSYuri Pankov.Sy -nobrowse 559*d002581cSYuri Pankovoption can be added to any indirect 560*d002581cSYuri Pankov.Nm autofs 561c10c16deSRichard Lowemap to disable browsing. For example: 562*d002581cSYuri Pankov.Bd -literal -offset indent 563c10c16deSRichard Lowe/net -hosts -nosuid,nobrowse 564c10c16deSRichard Lowe/home auto_home 565*d002581cSYuri Pankov.Ed 566*d002581cSYuri Pankov.Pp 567*d002581cSYuri PankovIn this case, any 568*d002581cSYuri Pankov.Ar hostname Ns s 569*d002581cSYuri Pankovwould only be visible in 570*d002581cSYuri Pankov.Pa /net 571*d002581cSYuri Pankovafter they are mounted, but all potential mount points would be visible under 572*d002581cSYuri Pankov.Pa /home . 573*d002581cSYuri PankovThe 574*d002581cSYuri Pankov.Sy -browse 575*d002581cSYuri Pankovoption enables browsability of 576*d002581cSYuri Pankov.Nm autofs 577*d002581cSYuri Pankovfile systems. This is the default for all indirect maps. 578*d002581cSYuri Pankov.Pp 579*d002581cSYuri PankovThe 580*d002581cSYuri Pankov.Sy -browse 581*d002581cSYuri Pankovoption does not work in conjunction with the wildcard key. 582*d002581cSYuri Pankov.Ss Restricting Mount Maps 583c10c16deSRichard LoweOptions specified for a map are used as the default options for all the entries 584c10c16deSRichard Lowein that map. They are ignored when map entries specify their own mount options. 585*d002581cSYuri Pankov.Pp 586*d002581cSYuri PankovIn some cases, however, it is desirable to force 587*d002581cSYuri Pankov.Sy nosuid , nodevices , nosetuid , 588*d002581cSYuri Pankovor 589*d002581cSYuri Pankov.Sy noexec 590*d002581cSYuri Pankovfor a complete mount map and its submounts. This can be done by specifying the 591*d002581cSYuri Pankovadditional mount option, 592*d002581cSYuri Pankov.Sy -restrict . 593*d002581cSYuri Pankov.Bd -literal -offset indent 594c10c16deSRichard Lowe/home auto_home -restrict,nosuid,hard 595*d002581cSYuri Pankov.Ed 596*d002581cSYuri Pankov.Pp 597*d002581cSYuri PankovThe 598*d002581cSYuri Pankov.Sy -restrict 599*d002581cSYuri Pankovoption forces the inheritance of all the restrictive options 600*d002581cSYuri Pankov.Sy nosuid , nodevices , nosetuid , 601*d002581cSYuri Pankovand 602*d002581cSYuri Pankov.Sy noexec 603*d002581cSYuri Pankovas well as the restrict option itself. In this particular example, the 604*d002581cSYuri Pankov.Sy nosuid 605*d002581cSYuri Pankovand 606*d002581cSYuri Pankov.Sy restrict 607*d002581cSYuri Pankovoption are inherited but the 608*d002581cSYuri Pankov.Sy hard 609*d002581cSYuri Pankovoption is not. The 610*d002581cSYuri Pankov.Sy restrict 611*d002581cSYuri Pankovoption also prevents the execution of 612*d002581cSYuri Pankov.Qq executable maps 613*d002581cSYuri Pankovand is enforced for auto mounts established by programs with fewer than all 614*d002581cSYuri Pankovprivileges available in their zone. 615*d002581cSYuri Pankov.Sh FILES 616*d002581cSYuri Pankov.Bl -tag -width Ds 617*d002581cSYuri Pankov.It Pa /etc/auto_master 618c10c16deSRichard LoweMaster automount map. 619*d002581cSYuri Pankov.It Pa /etc/auto_home 620c10c16deSRichard LoweMap to support automounted home directories. 621*d002581cSYuri Pankov.It Pa /etc/nsswitch.conf 622*d002581cSYuri PankovName service switch configuration file. See 623*d002581cSYuri Pankov.Xr nsswitch.conf 4 . 624*d002581cSYuri Pankov.El 625*d002581cSYuri Pankov.Sh EXIT STATUS 626*d002581cSYuri Pankov.Ex -std 627*d002581cSYuri Pankov.Sh SEE ALSO 628*d002581cSYuri Pankov.Xr isainfo 1 , 629*d002581cSYuri Pankov.Xr ls 1 , 630*d002581cSYuri Pankov.Xr svcs 1 , 631*d002581cSYuri Pankov.Xr uname 1 , 632*d002581cSYuri Pankov.Xr automountd 1M , 633*d002581cSYuri Pankov.Xr mount 1M , 634*d002581cSYuri Pankov.Xr mount_nfs 1M , 635*d002581cSYuri Pankov.Xr svcadm 1M , 636*d002581cSYuri Pankov.Xr autofs 4 , 637*d002581cSYuri Pankov.Xr attributes 5 , 638*d002581cSYuri Pankov.Xr nfssec 5 , 639*d002581cSYuri Pankov.Xr smf 5 640*d002581cSYuri Pankov.Sh NOTES 641*d002581cSYuri Pankov.Nm autofs 642*d002581cSYuri Pankovmount points must not be hierarchically related. 643*d002581cSYuri Pankov.Nm 644*d002581cSYuri Pankovdoes not allow an 645*d002581cSYuri Pankov.Nm autofs 646*d002581cSYuri Pankovmount point to be created within another 647*d002581cSYuri Pankov.Nm autofs 648c10c16deSRichard Lowemount. 649*d002581cSYuri Pankov.Pp 650*d002581cSYuri PankovSince each direct map entry results in a new 651*d002581cSYuri Pankov.Nm autofs 652*d002581cSYuri Pankovmount such maps should be kept short. 653*d002581cSYuri Pankov.Pp 654*d002581cSYuri PankovEntries in both direct and indirect maps can be modified at any time. The new 655*d002581cSYuri Pankovinformation is used when 656*d002581cSYuri Pankov.Nm automountd 657*d002581cSYuri Pankovnext uses the map entry to do a mount. 658*d002581cSYuri Pankov.Pp 659c10c16deSRichard LoweNew entries added to a master map or direct map will not be useful until the 660*d002581cSYuri Pankovautomount command is run to install them as new 661*d002581cSYuri Pankov.Nm autofs 662*d002581cSYuri Pankovmount points. New entries added to an indirect map may be used immediately. 663*d002581cSYuri Pankov.Pp 664*d002581cSYuri PankovAs of the Solaris 2.6 release, a listing 665*d002581cSYuri Pankov.Po see 666*d002581cSYuri Pankov.Xr ls 1 667*d002581cSYuri Pankov.Pc 668*d002581cSYuri Pankovof the 669*d002581cSYuri Pankov.Nm autofs 670c10c16deSRichard Lowedirectory associated with an indirect map shows all potential mountable 671c10c16deSRichard Loweentries. The attributes associated with the potential mountable entries are 672c10c16deSRichard Lowetemporary. The real file system attributes will only be shown once the file 673c10c16deSRichard Lowesystem has been mounted. 674*d002581cSYuri Pankov.Pp 675c10c16deSRichard LoweDefault mount options can be assigned to an entire map when specified as an 676c10c16deSRichard Loweoptional third field in the master map. These options apply only to map entries 677c10c16deSRichard Lowethat have no mount options. Note that map entities with options override the 678c10c16deSRichard Lowedefault options, as at this time, the options do not concatenate. The 679c10c16deSRichard Loweconcatenation feature is planned for a future release. 680*d002581cSYuri Pankov.Pp 681c10c16deSRichard LoweWhen operating on a map that invokes an NFS mount, the default number of 682c10c16deSRichard Loweretries for the automounter is 0, that is, a single mount attempt, with no 683*d002581cSYuri Pankovretries. Note that this is significantly different from the default 684*d002581cSYuri Pankov.Pq 10000 685*d002581cSYuri Pankovfor the 686*d002581cSYuri Pankov.Xr mount_nfs 1M 687*d002581cSYuri Pankovutility. 688*d002581cSYuri Pankov.Pp 689*d002581cSYuri PankovThe Network Information Service 690*d002581cSYuri Pankov.Pq NIS 691*d002581cSYuri Pankovwas formerly known as Sun Yellow Pages 692*d002581cSYuri Pankov.Pq YP . 693*d002581cSYuri PankovThe functionality of the two remains the same. 694*d002581cSYuri Pankov.Pp 695*d002581cSYuri PankovThe 696*d002581cSYuri Pankov.Nm 697*d002581cSYuri Pankovservice is managed by the service management facility, 698*d002581cSYuri Pankov.Xr smf 5 , 699*d002581cSYuri Pankovunder the service identifier: 700*d002581cSYuri Pankov.Bd -literal -offset indent 701c10c16deSRichard Lowesvc:/system/filesystem/autofs:default 702*d002581cSYuri Pankov.Ed 703*d002581cSYuri Pankov.Pp 704c10c16deSRichard LoweAdministrative actions on this service, such as enabling, disabling, or 705*d002581cSYuri Pankovrequesting restart, can be performed using 706*d002581cSYuri Pankov.Xr svcadm 1M . 707*d002581cSYuri PankovThe service's status can be queried using the 708*d002581cSYuri Pankov.Xr svcs 1 709*d002581cSYuri Pankovcommand. 710