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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
|
'\" t
.TH "SYSTEMD\-FSTAB\-GENERATOR" "8" "" "systemd 255" "systemd-fstab-generator"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
systemd-fstab-generator \- Unit generator for /etc/fstab
.SH "SYNOPSIS"
.PP
/usr/lib/systemd/system\-generators/systemd\-fstab\-generator
.SH "DESCRIPTION"
.PP
systemd\-fstab\-generator
is a generator that translates
/etc/fstab
(see
\fBfstab\fR(5)
for details) into native systemd units early at boot and when configuration of the system manager is reloaded\&. This will instantiate mount and swap units as necessary\&.
.PP
The
\fIpassno\fR
field is treated like a simple boolean, and the ordering information is discarded\&. However, if the root file system is checked, it is checked before all the other file systems\&.
.PP
See
\fBsystemd.mount\fR(5)
and
\fBsystemd.swap\fR(5)
for more information about special
/etc/fstab
mount options this generator understands\&.
.PP
One special topic is handling of symbolic links\&. Historical init implementations supported symlinks in
/etc/fstab\&. Because mount units will refuse mounts where the target is a symbolic link, this generator will resolve any symlinks as far as possible when processing
/etc/fstab
in order to enhance backwards compatibility\&. If a symlink target does not exist at the time that this generator runs, it is assumed that the symlink target is the final target of the mount\&.
.PP
systemd\-fstab\-generator
implements
\fBsystemd.generator\fR(7)\&.
.SH "KERNEL COMMAND LINE"
.PP
systemd\-fstab\-generator
understands the following kernel command line parameters:
.PP
\fIfstab=\fR, \fIrd\&.fstab=\fR
.RS 4
Takes a boolean argument\&. Defaults to
"yes"\&. If
"no", causes the generator to ignore any mounts or swap devices configured in
/etc/fstab\&.
\fIrd\&.fstab=\fR
is honored only in the initrd, while
\fIfstab=\fR
is honored by both the main system and the initrd\&.
.sp
Added in version 186\&.
.RE
.PP
\fIroot=\fR
.RS 4
Configures the operating system\*(Aqs root filesystem to mount when running in the initrd\&. This accepts a device node path (usually
/dev/disk/by\-uuid/\&...
or
/dev/disk/by\-label/\&...
or similar), or the special values
"gpt\-auto",
"fstab", and
"tmpfs"\&.
.sp
Use
"gpt\-auto"
to explicitly request automatic root file system discovery via
\fBsystemd-gpt-auto-generator\fR(8)\&.
.sp
Use
"fstab"
to explicitly request automatic root file system discovery via the initrd
/etc/fstab
rather than via kernel command line\&.
.sp
Use
"tmpfs"
in order to mount a
\fBtmpfs\fR(5)
file system as root file system of the OS\&. This is useful in combination with
\fImount\&.usr=\fR
(see below) in order to combine a volatile root file system with a separate, immutable
/usr/
file system\&. Also see
\fIsystemd\&.volatile=\fR
below\&.
.sp
Added in version 217\&.
.RE
.PP
\fIrootfstype=\fR
.RS 4
Takes the root filesystem type that will be passed to the mount command\&.
\fIrootfstype=\fR
is honored by the initrd\&.
.sp
Added in version 217\&.
.RE
.PP
\fIrootflags=\fR
.RS 4
Takes the root filesystem mount options to use\&.
\fIrootflags=\fR
is honored by the initrd\&.
.sp
Note that unlike most kernel command line options this setting does not override settings made in configuration files (specifically: the mount option string in
/etc/fstab)\&. See
\fBsystemd-remount-fs.service\fR(8)\&.
.sp
Added in version 217\&.
.RE
.PP
\fImount\&.usr=\fR
.RS 4
Takes the
/usr/
filesystem to be mounted by the initrd\&. If
\fImount\&.usrfstype=\fR
or
\fImount\&.usrflags=\fR
is set, then
\fImount\&.usr=\fR
will default to the value set in
\fIroot=\fR\&.
.sp
Otherwise, this parameter defaults to the
/usr/
entry found in
/etc/fstab
on the root filesystem\&.
.sp
\fImount\&.usr=\fR
is honored by the initrd\&.
.sp
Added in version 217\&.
.RE
.PP
\fImount\&.usrfstype=\fR
.RS 4
Takes the
/usr/
filesystem type that will be passed to the mount command\&. If
\fImount\&.usr=\fR
or
\fImount\&.usrflags=\fR
is set, then
\fImount\&.usrfstype=\fR
will default to the value set in
\fIrootfstype=\fR\&.
.sp
Otherwise, this value will be read from the
/usr/
entry in
/etc/fstab
on the root filesystem\&.
.sp
\fImount\&.usrfstype=\fR
is honored by the initrd\&.
.sp
Added in version 217\&.
.RE
.PP
\fImount\&.usrflags=\fR
.RS 4
Takes the
/usr/
filesystem mount options to use\&. If
\fImount\&.usr=\fR
or
\fImount\&.usrfstype=\fR
is set, then
\fImount\&.usrflags=\fR
will default to the value set in
\fIrootflags=\fR\&.
.sp
Otherwise, this value will be read from the
/usr/
entry in
/etc/fstab
on the root filesystem\&.
.sp
\fImount\&.usrflags=\fR
is honored by the initrd\&.
.sp
Added in version 217\&.
.RE
.PP
\fIroothash=\fR, \fIusrhash=\fR
.RS 4
These options are primarily read by
\fBsystemd-veritysetup-generator\fR(8)\&. When set this indicates that the root file system (or
/usr/) shall be mounted from Verity volumes with the specified hashes\&. If these kernel command line options are set the root (or
/usr/) file system is thus mounted from a device mapper volume
/dev/mapper/root
(or
/dev/mapper/usr)\&.
.sp
Added in version 251\&.
.RE
.PP
\fIsystemd\&.volatile=\fR
.RS 4
Controls whether the system shall boot up in volatile mode\&. Takes a boolean argument or the special value
\fBstate\fR\&.
.sp
If false (the default), this generator makes no changes to the mount tree and the system is booted up in normal mode\&.
.sp
If true the generator ensures
\fBsystemd-volatile-root.service\fR(8)
is run in the initrd\&. This service changes the mount table before transitioning to the host system, so that a volatile memory file system ("tmpfs") is used as root directory, with only
/usr/
mounted into it from the configured root file system, in read\-only mode\&. This way the system operates in fully stateless mode, with all configuration and state reset at boot and lost at shutdown, as
/etc/
and
/var/
will be served from the (initially unpopulated) volatile memory file system\&.
.sp
If set to
\fBstate\fR
the generator will leave the root directory mount point unaltered, however will mount a
"tmpfs"
file system to
/var/\&. In this mode the normal system configuration (i\&.e\&. the contents of
"/etc/") is in effect (and may be modified during system runtime), however the system state (i\&.e\&. the contents of
"/var/") is reset at boot and lost at shutdown\&.
.sp
If this setting is set to
"overlay"
the root file system is set up as
"overlayfs"
mount combining the read\-only root directory with a writable
"tmpfs", so that no modifications are made to disk, but the file system may be modified nonetheless with all changes being lost at reboot\&.
.sp
Note that in none of these modes the root directory,
/etc/,
/var/
or any other resources stored in the root file system are physically removed\&. It\*(Aqs thus safe to boot a system that is normally operated in non\-volatile mode temporarily into volatile mode, without losing data\&.
.sp
Note that with the exception of
"overlay"
mode, enabling this setting will only work correctly on operating systems that can boot up with only
/usr/
mounted, and are able to automatically populate
/etc/, and also
/var/
in case of
"systemd\&.volatile=yes"\&.
.sp
Also see
\fIroot=tmpfs\fR
above, for a method to combine a
"tmpfs"
file system with a regular
/usr/
file system (as configured via
\fImount\&.usr=\fR)\&. The main distinction between
\fIsystemd\&.volatile=yes\fR, and
\fIroot=tmpfs\fR
in combination
\fImount\&.usr=\fR
is that the former operates on top of a regular root file system and temporarily obstructs the files and directories above its
/usr/
subdirectory, while the latter does not hide any files, but simply mounts a unpopulated tmpfs as root file system and combines it with a user picked
/usr/
file system\&.
.sp
Added in version 233\&.
.RE
.PP
\fIsystemd\&.swap=\fR
.RS 4
Takes a boolean argument or enables the option if specified without an argument\&. If disabled, causes the generator to ignore any swap devices configured in
/etc/fstab\&. Defaults to enabled\&.
.sp
Added in version 246\&.
.RE
.PP
\fIsystemd\&.mount\-extra=\fR\fI\fIWHAT\fR\fR\fI:\fR\fI\fIWHERE\fR\fR\fI[:\fR\fI\fIFSTYPE\fR\fR\fI[:\fR\fI\fIOPTIONS\fR\fR\fI]]\fR, \fIrd\&.systemd\&.mount\-extra=\fR\fI\fIWHAT\fR\fR\fI:\fR\fI\fIWHERE\fR\fR\fI[:\fR\fI\fIFSTYPE\fR\fR\fI[:\fR\fI\fIOPTIONS\fR\fR\fI]]\fR
.RS 4
Specifies the mount unit\&. Takes at least two and at most four fields separated with a colon (":")\&. Each field is handled as the corresponding fstab field\&. This option can be specified multiple times\&.
\fIrd\&.systemd\&.mount\-extra=\fR
is honored only in the initrd, while
\fIsystemd\&.mount\-extra=\fR
is honored by both the main system and the initrd\&. In the initrd, the mount point (and also source path if the mount is bind mount) specified in
\fIsystemd\&.mount\-extra=\fR
is prefixed with
/sysroot/\&.
.sp
Example:
.sp
.if n \{\
.RS 4
.\}
.nf
systemd\&.mount\-extra=/dev/sda1:/mount\-point:ext4:rw,noatime
.fi
.if n \{\
.RE
.\}
.sp
Added in version 254\&.
.RE
.PP
\fIsystemd\&.swap\-extra=\fR\fI\fIWHAT\fR\fR\fI[:\fR\fI\fIOPTIONS\fR\fR\fI]\fR, \fIrd\&.systemd\&.swap\-extra=\fR\fI\fIWHAT\fR\fR\fI[:\fR\fI\fIOPTIONS\fR\fR\fI]\fR
.RS 4
Specifies the swap unit\&. Takes the block device to be used as a swap device, and optionally takes mount options followed by a colon (":")\&. This option can be specified multiple times\&.
\fIrd\&.systemd\&.swap\-extra=\fR
is honored only in the initrd, while
\fIsystemd\&.swap\-extra=\fR
is honored by both the main system and the initrd\&.
.sp
Example:
.sp
.if n \{\
.RS 4
.\}
.nf
systemd\&.swap\-extra=/dev/sda2:x\-systemd\&.makefs
.fi
.if n \{\
.RE
.\}
.sp
Added in version 254\&.
.RE
.SH "SYSTEM CREDENTIALS"
.PP
\fIfstab\&.extra\fR
.RS 4
This credential may contain addition mounts to establish, in the same format as
\fBfstab\fR(5), with one mount per line\&. It is read in addition to
/etc/fstab\&.
.sp
Added in version 254\&.
.RE
.SH "SEE ALSO"
.PP
\fBsystemd\fR(1),
\fBfstab\fR(5),
\fBsystemd.mount\fR(5),
\fBsystemd.swap\fR(5),
\fBsystemd-cryptsetup-generator\fR(8),
\fBsystemd-gpt-auto-generator\fR(8),
\fBkernel-command-line\fR(7),
\m[blue]\fBKnown Environment Variables\fR\m[]\&\s-2\u[1]\d\s+2
.SH "NOTES"
.IP " 1." 4
Known Environment Variables
.RS 4
\%https://systemd.io/ENVIRONMENT/
.RE
|