1 .\" Copyright (c) 2014 The FreeBSD Foundation
2 .\" All rights reserved.
4 .\" This software was developed by Edward Tomasz Napierala under sponsorship
5 .\" from the FreeBSD Foundation.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 .Nd auto_master and map file format
39 configuration file is used by the
42 Map files are read by the
45 .Sh AUTO_MASTER SYNTAX
48 file consists of lines with two or three entries separated by whitespace
49 and terminated by newline character:
50 .Bd -literal -offset indent
51 .Pa mountpoint Pa map_name Op Ar -options
55 is either a fully specified path, or
61 must reference an indirect map.
64 must reference a direct map.
66 .Sx "MAP SYNTAX" below.
74 it specifies a special map.
80 is not a fully specified path
81 .Pq it does not start with Li / ,
83 will search for that name in
85 Otherwise it will use the path as given.
86 If the file indicated by
90 will assume it is an executable map.
94 Otherwise, the file is opened and the contents parsed.
97 is an optional field that starts with
99 and can contain generic filesystem mount options.
101 The following example specifies that the /etc/auto_example indirect map
102 will be mounted on /example.
103 .Bd -literal -offset indent
104 /example auto_example
107 Map files consist of lines with a number of entries separated by whitespace
108 and terminated by newline character:
109 .Bd -literal -offset indent
110 .Pa key Oo Ar -options Oc Oo Ar mountpoint Oo -options Oc Oc Ar location Op ...
113 In most cases, it can be simplified to:
114 .Bd -literal -offset indent
115 .Pa key Oo Ar -options Oc Ar location
119 is the path component used by
121 to find the right map entry to use.
122 It is also used to form the final mountpoint.
126 field, if present, must begin with
128 When mounting the filesystem, options supplied to
130 and options specified in the map entry are concatenated together.
133 is used to specify filesystem type.
134 It is not passed to the mount program as an option.
135 Instead, it is passed as argument to
139 is used to disable creation of top-level directories for special
144 field is used to specify multiple mount points
149 field specifies the filesystem to be mounted.
150 To pass location that begins with
152 prefix it with colon.
156 This example, when used with the
158 example above, specifies that the NFS share
159 .Li 192.168.1.1:/share/example/x
162 when any process attempts to access that mountpoint, with
167 .Bd -literal -offset indent
168 .Li x -intr,nfsv4 192.168.1.1:/share/example/x
171 Automatically mount the CD drive on access:
172 .Bd -literal -offset indent
173 .Li cd -intr,fstype=cd9660 :/dev/cd0
176 Special maps have names beginning with
178 Supported special maps are:
180 .Bl -tag -width "-hosts" -compact
182 This map queries the remote NFS server and maps exported volumes.
183 It is traditionally mounted on
185 It enables access to files on a remote NFS server by accessing
186 .Pa /net/nfs-server-ip/share-name/
187 directory, without the need for any further configuration.
189 This map prevents the
191 from mounting anything on the mountpoint.
194 If the map file specified in
196 has execute bit set, the
198 will execute it and parse the standard output instead of parsing
200 .Sh INDIRECT VERSUS DIRECT MAPS
201 Indirect maps are referred to in
203 by entries with a fully qualified path as a mount point, and must contain only
204 relative paths as keys.
205 Direct maps are referred to in
209 as the mountpoint, and must contain only fully qualified paths as keys.
210 For indirect maps, the final mount point is determined by concatenating the
212 mountpoint with the map entry key and optional map entry mountpoint.
213 For direct maps, the final mount point is determined by concatenating
214 the map entry key with the optional map entry mountpoint.
216 The example above could be rewritten using direct map, by placing this in
218 .Bd -literal -offset indent
223 .Li /etc/auto_example
225 .Bd -literal -offset indent
226 .Li /example/x -intr,nfsv4 192.168.1.1:/share/example/x
227 .Li /example/cd -intr,fstype=cd9660 :/dev/cd0
229 .Sh DIRECTORY SERVICES
232 and maps may contain entries consisting of a plus sign and map name:
233 .Bd -literal -offset indent
239 daemon to retrieve the named map from directory services (like LDAP)
240 and include it where the entry was.
242 If the file containing the map referenced in
244 is not found, the map will be retrieved from directory services instead.
246 To retrieve entries from directory services,
249 .Pa /etc/autofs/include ,
250 which is usually a shell script, with map name as the only command line
252 The script should output entries formatted according to
254 or automounter map syntax to standard output.
255 An example script to use LDAP is included in
256 .Pa /etc/autofs/include_ldap .
257 It can be symlinked to
258 .Pa /etc/autofs/include .
260 .Bl -tag -width ".Pa /etc/auto_master" -compact
261 .It Pa /etc/auto_master
262 The default location of the
274 configuration file functionality was developed by
275 .An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
276 under sponsorship from the FreeBSD Foundation.