aboutsummaryrefslogtreecommitdiffstats
path: root/man/autofs.5
blob: ecd1c56ecfb7019f1124f50ea44531ae071d1839 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
.\" t
.\" $Id$
.TH AUTOFS 5 "6 Apr 1998"
.SH NAME
autofs \- Format of the automounter maps
.SH "DESCRIPTION"
The automounter maps are files or NIS maps referred to by the master map of
the automounter (see
.BR auto.master (5)).
The automounter maps describe how file systems below the mountpoint of the map
(given in the auto.master file) are to be mounted.  This describes the
.B sun
map format; if another map format is specified (e.g. \fBhesiod\fP),
this documentation does not apply.

Maps can be changed on the fly and the automouter will recognize those
changes on the next operation it performs on that map.  This is not
true for the
.B auto.master
map!
.SH "FORMAT"
This is a description of the text file format.  Other methods of specifying
these files may exist.  All empty lines or lines beginning with # are
ignored. The basic format of one line in such maps is:
.P
.B key [-options] location

.SS key
is the part of the pathname between the mountpoint and the path into the
filesystem mounted.  Usually you can think about the key as a subdirectory
name below the mountpoint.

.SS options
Options are optional.  Options can also be given in the 
.B auto.master
file in which case both values are cumulative (this is a difference
from SunOS).  The options are a list of comma separated options as
customary for the
.BR mount (8)
command. There is a special option
.I -fstype=
used to specify a filesystem type if the filesystem is not of the default
NFS type.  This option is processed by the automounter and not by the mount
command.

.SS location
The location specifies from where the file system is to be mounted.  In the
most cases this will be an NFS volume and the usual notation
.I host:pathname
is used to indicate the remote filesystem and path to be mounted.  If
the filesystem to be mounted begins with a / (such as local
.I /dev
entries or smbfs shares) a : needs to be prefixed (e.g. 
.IR :/dev/sda1 ).
.SH EXAMPLE
.sp
.RS +.2i
.ta 1.0i 3.0i
.nf
kernel	-ro,soft,intr	ftp.kernel.org:/pub/linux
boot	-fstype=ext2	:/dev/hda1
windoze	-fstype=smbfs	://windoze/c
removable	-fstype=ext2	:/dev/hdd
cd	-fstype=iso9660,ro	:/dev/hdc
floppy	-fstype=auto	:/dev/fd0
.fi
.RE
.sp
In the first line we have a NFS remote mount of the kernel directory on
.IR ftp.kernel.org .
This is mounted read-only.  The second line mounts an ext2 volume on a
local ide drive.  The third makes a share exported from a Windows
machine available for automounting.  The rest should be fairly
self-explanatory.
.SH FEATURES
.SS Map Key Substitution
An & character in the
.B location
is expanded to the value of the 
.B key
field that matched the line (which probably only makes sense together with
a wildcard key).
.SS Wildcard Key
A * in the
.B key
field matches all keys.  An example for the usefulness is the following entry:
.sp
.RS +.2i
.ta 1.0i
.nf
*	&:/home/&
.fi
.RE
.sp
This will enable you to access all the home directory of local hosts using
the path
.RI / mountpoint / hostname / local-path .
.SS Variable Substitution
The following special variables will be substituted in the key and location
fields of an automounter map if prefixed with $ as customary from shell
scripts (Curly braces can be used to separate the fieldname):
.sp
.RS +.2i
.ta 1.5i
.nf
ARCH	Architecture (uname -m)
CPU	Processor Type
HOST	Hostname (uname -n)
OSNAME	Operating System (uname -s)
OSREL	Release of OS (uname -r)
OSVERS	Version of OS (uname -v)
.fi
.RE
.sp
Additional entries can be defined with the -Dvariable=Value option to
.BR automount (8).
.SS Executable Maps
A map can be marked as executable.  The init script that parses the
auto.master map will pass this as a
.B program
map to the automounter.  A
.B program
map will be called as a script with the
key as an argument.  The script needs to return one line of a map or no
output at all if the key cannot be matched.
.P
To do this the
.BR automount (8)
daemon has to be started with the program type insted of the file
type.  This is implemented in the initialization script.
.P
A executable map can return an errorcode to indicate the failure in addition
to no output at all.  All output sent to stderr is logged into the system
logs.
.SH UNSUPPORTED
The automounter does not support direct maps or mount trees (more than
one filesystem to be mounted under a specific automount point), and
handles SunOS-style replicated filesystems only to the extent that
.BR mount (8)
does.
.SH "SEE ALSO"
.BR automount (8),
.BR auto.master (5),
.BR autofs (8),
.BR mount (8).
.SH AUTHOR
This manual page was written by Christoph Lameter <chris@waterf.org>,
for the Debian GNU/Linux system.  Edited by H. Peter Anvin
<hpa@transmeta.com>.