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
140 field is used to specify multiple mount points
145 field specifies the filesystem to be mounted.
146 To pass location that begins with
148 prefix it with colon.
152 This example, when used with the
154 example above, specifies that the NFS share
155 .Li 192.168.1.1:/share/example/x
158 when any process attempts to access that mountpoint, with
163 .Bd -literal -offset indent
164 .Li x -intr,nfsv4 192.168.1.1:/share/example/x
167 Automatically mount the CD drive on access:
168 .Bd -literal -offset indent
169 .Li cd -intr,fstype=cd9660 :/dev/cd0
172 Special maps have names beginning with
174 Supported special maps are:
176 .Bl -tag -width "-hosts" -compact
178 This map queries the remote NFS server and maps exported volumes.
179 It is traditionally mounted on
181 It enables access to files on a remote NFS server by accessing
182 .Pa /net/nfs-server-ip/share-name/
183 directory, without the need for any further configuration.
185 This map prevents the
187 from mounting anything on the mountpoint.
190 If the map file specified in
192 has execute bit set, the
194 will execute it and parse the standard output instead of parsing
196 .Sh INDIRECT VERSUS DIRECT MAPS
197 Indirect maps are referred to in
199 by entries with a fully qualified path as a mount point, and must contain only
200 relative paths as keys.
201 Direct maps are referred to in
205 as the mountpoint, and must contain only fully qualified paths as keys.
206 For indirect maps, the final mount point is determined by concatenating the
208 mountpoint with the map entry key and optional map entry mountpoint.
209 For direct maps, the final mount point is determined by concatenating
210 the map entry key with the optional map entry mountpoint.
212 The example above could be rewritten using direct map, by placing this in
214 .Bd -literal -offset indent
219 .Li /etc/auto_example
221 .Bd -literal -offset indent
222 .Li /example/x -intr,nfsv4 192.168.1.1:/share/example/x
223 .Li /example/cd -intr,fstype=cd9660 :/dev/cd0
225 .Sh DIRECTORY SERVICES
228 and maps may contain entries consisting of a plus sign and map name:
229 .Bd -literal -offset indent
235 daemon to retrieve the named map from directory services (like LDAP)
236 and include it where the entry was.
238 If the file containing the map referenced in
240 is not found, the map will be retrieved from directory services instead.
242 To retrieve entries from directory services,
245 .Pa /etc/autofs/include ,
246 which is usually a shell script, with map name as the only command line
248 The script should output entries formatted according to
250 or automounter map syntax to standard output.
251 An example script to use LDAP is included in
252 .Pa /etc/autofs/include_ldap .
253 It can be symlinked to
254 .Pa /etc/autofs/include .
256 .Bl -tag -width ".Pa /etc/auto_master" -compact
257 .It Pa /etc/auto_master
258 The default location of the
270 configuration file functionality was developed by
271 .An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
272 under sponsorship from the FreeBSD Foundation.