2
.TH AUTOFS 5 "6 Apr 1998"
3
.TH AUTOFS 5 "14 Jan 2000"
5
autofs \- Format of the automounter maps
7
The automounter maps are FILE, NIS, NISPLUS or LDAP maps referred to by
8
the master map of the automounter (see
10
These maps describe how file systems below the mount point of the map
11
(given in the master map) are to be mounted. This page describes the
13
map format; if another map format is specified (e.g. \fBhesiod\fP),
14
this documentation does not apply.
16
Indirect maps can be changed on the fly and the automouter will recognize
17
those changes on the next operation it performs on that map. Direct maps
18
require a HUP signal be sent to the daemon to refresh their contents as does
21
This is a description of the text file format. Other methods of specifying
22
these files may exist. All empty lines or lines beginning with # are
23
ignored. The basic format of one line in such maps is:
25
.BI "key [" -options "] location"
28
For indirect mounts this is the part of the path name between the mount point
29
and the path into the filesystem when it is mounted. Usually you can think about the
30
key as a sub-directory name below the autofs managed mount point.
32
For direct mounts this is the full path of each mount point. This map is always
33
associated with the /- mount point in the master map.
36
Zero or more options may be given. Options can also be given in the
38
file in which case both values are cumulative (this is a difference
39
from SunOS). The options are a list of comma separated options as
42
command. There are two special options
44
used to specify a filesystem type if the filesystem is not of the default
45
NFS type. This option is processed by the automounter and not by the mount
48
is used to treat errors when mounting file systems as fatal. This is important when
49
multiple file systems should be mounted (`multi-mounts'). If this option
50
is given, no file system is mounted at all if at least one file system
54
The location specifies from where the file system is to be mounted. In the
55
most cases this will be an NFS volume and the usual notation
57
is used to indicate the remote filesystem and path to be mounted. If
58
the filesystem to be mounted begins with a / (such as local
60
entries or smbfs shares) a : needs to be prefixed (e.g.
68
kernel -ro,soft,intr ftp.kernel.org:/pub/linux
69
boot -fstype=ext2 :/dev/hda1
70
windoze -fstype=smbfs ://windoze/c
71
removable -fstype=ext2 :/dev/hdd
72
cd -fstype=iso9660,ro :/dev/hdc
73
floppy -fstype=auto :/dev/fd0
74
server -rw,hard,intr / -ro myserver.me.org:/ \\
75
/usr myserver.me.org:/usr \\
76
/home myserver.me.org:/home
80
In the first line we have a NFS remote mount of the kernel directory on
82
This is mounted read-only. The second line mounts an ext2 volume from a
83
local ide drive. The third makes a share exported from a Windows
84
machine available for automounting. The rest should be fairly
85
self-explanatory. The last entry (the last three lines) is an example
86
of a multi-map (see below).
88
If you use the automounter for a filesystem without access permissions
89
(like \fBvfat\fP), users usually can't write on such a filesystem
90
because it is mounted as user \fBroot\fP.
91
You can solve this problem by passing the option \fIgid=<gid>\fP,
92
e.g. \fIgid=floppy\fP. The filesystem is then mounted as group
93
\fBfloppy\fP instead of \fBroot\fP. Then you can add the users
94
to this group, and they can write to the filesystem. Here's an
95
example entry for an autofs map:
100
floppy-vfat -fstype=vfat,sync,gid=floppy,umask=002 :/dev/fd0
109
/nfs/apps/mozilla bogus:/usr/local/moxill
110
/nfs/data/budgets tiger:/usr/local/budgets
111
/tst/sbin bogus:/usr/sbin
116
.SS Map Key Substitution
117
An & character in the
119
is expanded to the value of the
121
field that matched the line (which probably only makes sense together with
124
A map key of * denotes a wild-card entry. This entry is consulted
125
if the specified key does not exist in the map. A typical wild-card
126
entry looks like this:
131
* server:/export/home/&
135
The special character '&' will be replaced by the provided key. So,
136
in the example above, a lookup for the key 'foo' would yield a mount
137
of server:/export/home/foo.
138
.SS Variable Substitution
139
The following special variables will be substituted in the key and location
140
fields of an automounter map if prefixed with $ as customary from shell
141
scripts (Curly braces can be used to separate the field name):
146
ARCH Architecture (uname -m)
148
HOST Hostname (uname -n)
149
OSNAME Operating System (uname -s)
150
OSREL Release of OS (uname -r)
151
OSVERS Version of OS (uname -v)
155
autofs provides additional variables that are set based on the
156
user requesting the mount:
161
USER The user login name
162
UID The user login ID
163
GROUP The user group name
164
GID The user group ID
165
HOME The user home directory
166
HOST Hostname (uname -n)
170
Additional entries can be defined with the -Dvariable=Value map-option to
173
A map can be marked as executable. A
175
map will be called with the key as an argument. It may
176
return no lines of output if there's an error, or one or more lines
177
containing a map entry (with \\ quoting line breaks). The map entry
178
corresponds to what would normally follow a map key.
180
An executable map can return an error code to indicate the failure in addition
181
to no output at all. All output sent to stderr is logged into the system
186
can be used to name multiple filesystems to mount. It takes the form:
191
.BI "key [" -options "] [mount-point [" -options "] location...]..."
196
This may extend over multiple lines, quoting the line-breaks with \`\\\'.
197
If present, the per-mountpoint mount-options are appended to the
198
default mount-options.
199
.SS Replicated Server
204
Multiple replicated hosts, same path:
205
<path> host1,host2,hostn:/path/path
207
Multiple hosts, some with same path, some with another
208
<path> host1,host2:/blah host3:/some/other/path
210
Multiple replicated hosts, different (potentially) paths:
211
<path> host1:/path/pathA host2:/path/pathB
213
Mutliple weighted, replicated hosts same path:
214
<path> host1(5),host2(6),host3(1):/path/path
216
Multiple weighted, replicated hosts different (potentially) paths:
217
<path> host1(3):/path/pathA host2(5):/path/pathB
219
Anything else is questionable and unsupported, but these variations will also work:
220
<path> host1(3),host:/blah
225
This version of the automounter supports direct maps stored in FILE, NIS, NISPLUS
232
.BR autofs_ldap_auth.conf (5)
234
This manual page was written by Christoph Lameter <chris@waterf.org>,
235
for the Debian GNU/Linux system. Edited by H. Peter Avian
236
<hpa@transmeta.com>, Jeremy Fitzhardinge <jeremy@goop.org> and
237
Ian Kent <raven@themaw.net>.