Debian Codegraph @

upstream/fedora-rawhide/man8/systemd-fstab-generator.8

raw
1 '\" t
2 .TH "SYSTEMD\-FSTAB\-GENERATOR" "8" "" "systemd 261~rc2" "systemd-fstab-generator"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 systemd-fstab-generator \- Unit generator for /etc/fstab
24 .SH "SYNOPSIS"
25 .PP
26 /usr/lib/systemd/system\-generators/systemd\-fstab\-generator
27 .SH "DESCRIPTION"
28 .PP
29 systemd\-fstab\-generator
30 is a generator that translates
31 /etc/fstab
32 (see
33 \fBfstab\fR(5)
34 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\&.
35 .PP
36 The
37 \fIpassno\fR
38 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\&.
39 .PP
40 See
41 \fBsystemd.mount\fR(5)
42 and
43 \fBsystemd.swap\fR(5)
44 for more information about special
45 /etc/fstab
46 mount options this generator understands\&.
47 .PP
48 One special topic is handling of symbolic links\&. Historical init implementations supported symlinks in
49 /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
50 /etc/fstab
51 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\&.
52 .PP
53 systemd\-fstab\-generator
54 implements
55 \fBsystemd.generator\fR(7)\&.
56 .SH "KERNEL COMMAND LINE"
57 .PP
58 systemd\-fstab\-generator
59 understands the following kernel command line parameters:
60 .PP
61 \fIfstab=\fR, \fIrd\&.fstab=\fR
62 .RS 4
63 Takes a boolean argument\&. Defaults to
64 "yes"\&. If
65 "no", causes the generator to ignore any mounts or swap devices configured in
66 /etc/fstab\&.
67 \fIrd\&.fstab=\fR
68 is honored only in the initrd, while
69 \fIfstab=\fR
70 is honored by both the main system and the initrd\&.
71 .sp
72 Added in version 186\&.
73 .RE
74 .PP
75 \fIroot=\fR
76 .RS 4
77 Configures the operating system\*(Aqs root filesystem to mount when running in the initrd\&. This accepts a device node path (usually
78 /dev/disk/by\-uuid/\&...
79 or
80 /dev/disk/by\-label/\&...
81 or similar), or the special values
82 "gpt\-auto",
83 "gpt\-auto\-force",
84 "dissect",
85 "dissect\-force",
86 "fstab",
87 "tmpfs",
88 "bind:\&...", and
89 "off"\&.
90 .sp
91 Set to
92 "gpt\-auto",
93 "gpt\-auto\-force",
94 "dissect",
95 "dissect\-force"
96 to explicitly request automatic root file system discovery, implemented in
97 \fBsystemd-gpt-auto-generator\fR(8)\&.
98 .sp
99 Use
100 "fstab"
101 to explicitly request automatic root file system discovery via the initrd
102 /etc/fstab
103 rather than via kernel command line\&.
104 .sp
105 Use
106 "tmpfs"
107 in order to mount a
108 \fBtmpfs\fR(5)
109 file system as root file system of the OS\&. This is useful in combination with
110 \fImount\&.usr=\fR
111 (see below) in order to combine a volatile root file system with a separate, immutable
112 /usr/
113 file system\&. Also see
114 \fIsystemd\&.volatile=\fR
115 below\&.
116 .sp
117 Use
118 "bind:\&..."
119 to bind mount another directory as operating system root filesystems (added in v258)\&. Expects an absolute path name referencing an existing directory within the initrd\*(Aqs file hierarchy to boot into\&.
120 .sp
121 Set to
122 "off"
123 to turn off mounting of a root file system\&.
124 .sp
125 Note that further
126 \fIroot=\fR
127 values may be supported, implemented in additional packages\&.
128 .sp
129 Added in version 217\&.
130 .RE
131 .PP
132 \fIrootfstype=\fR
133 .RS 4
134 Takes the root filesystem type that will be passed to the mount command\&.
135 \fIrootfstype=\fR
136 is honored by the initrd\&.
137 .sp
138 Added in version 217\&.
139 .RE
140 .PP
141 \fIrootflags=\fR
142 .RS 4
143 Takes the root filesystem mount options to use\&.
144 \fIrootflags=\fR
145 is honored by the initrd\&.
146 .sp
147 Note that unlike most kernel command line options this setting does not override settings made in configuration files (specifically: the mount option string in
148 /etc/fstab)\&. See
149 \fBsystemd-remount-fs.service\fR(8)\&.
150 .sp
151 Added in version 217\&.
152 .RE
153 .PP
154 \fImount\&.usr=\fR
155 .RS 4
156 Takes the
157 /usr/
158 filesystem to be mounted by the initrd\&. If
159 \fImount\&.usrfstype=\fR
160 or
161 \fImount\&.usrflags=\fR
162 is set, then the mount configured via
163 \fImount\&.usr=\fR
164 will default to the the same value set in
165 \fIroot=\fR\&.
166 .sp
167 Set to
168 "dissect"
169 to explicitly request automatic
170 /usr/
171 file system discovery, implemented in
172 \fBsystemd-gpt-auto-generator\fR(8)\&.
173 .sp
174 Set to
175 "off"
176 to turn off mounting of a separate
177 /usr/
178 file system\&.
179 .sp
180 \fImount\&.usr=\fR
181 is honored by the initrd\&.
182 .sp
183 Added in version 217\&.
184 .RE
185 .PP
186 \fImount\&.usrfstype=\fR
187 .RS 4
188 Takes the
189 /usr/
190 filesystem type that will be passed to the mount command\&. If
191 \fImount\&.usr=\fR
192 or
193 \fImount\&.usrflags=\fR
194 is set, then
195 \fImount\&.usrfstype=\fR
196 will default to the value set in
197 \fIrootfstype=\fR\&.
198 .sp
199 Otherwise, this value will be read from the
200 /usr/
201 entry in
202 /etc/fstab
203 on the root filesystem\&.
204 .sp
205 \fImount\&.usrfstype=\fR
206 is honored by the initrd\&.
207 .sp
208 Added in version 217\&.
209 .RE
210 .PP
211 \fImount\&.usrflags=\fR
212 .RS 4
213 Takes the
214 /usr/
215 filesystem mount options to use\&. If
216 \fImount\&.usr=\fR
217 or
218 \fImount\&.usrfstype=\fR
219 is set, then
220 \fImount\&.usrflags=\fR
221 will default to the value set in
222 \fIrootflags=\fR\&.
223 .sp
224 Otherwise, this value will be read from the
225 /usr/
226 entry in
227 /etc/fstab
228 on the root filesystem\&.
229 .sp
230 \fImount\&.usrflags=\fR
231 is honored by the initrd\&.
232 .sp
233 Added in version 217\&.
234 .RE
235 .PP
236 \fIroothash=\fR, \fIusrhash=\fR
237 .RS 4
238 These options are primarily read by
239 \fBsystemd-veritysetup-generator\fR(8)\&. When set this indicates that the root file system (or
240 /usr/) shall be mounted from Verity volumes with the specified hashes\&. If these kernel command line options are set the root (or
241 /usr/) file system is thus mounted from a device mapper volume
242 /dev/mapper/root
243 (or
244 /dev/mapper/usr)\&.
245 .sp
246 Added in version 251\&.
247 .RE
248 .PP
249 \fIsystemd\&.volatile=\fR
250 .RS 4
251 Controls whether the system shall boot up in volatile mode\&. Takes a boolean argument or the special values
252 "state"
253 and
254 "overlay"\&.
255 .sp
256 If
257 "no"
258 (the default), this generator makes no changes to the mount tree and the system is booted up in normal mode\&.
259 .sp
260 If
261 "yes"
262 the generator ensures
263 \fBsystemd-volatile-root.service\fR(8)
264 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
265 /usr/
266 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
267 /etc/
268 and
269 /var/
270 will be served from the (initially unpopulated) volatile memory file system\&.
271 .sp
272 If set to
273 "state"
274 the generator will leave the root directory mount point unaltered, however will mount a
275 "tmpfs"
276 file system to
277 /var/\&. In this mode the normal system configuration (i\&.e\&. the contents of
278 "/etc/") is in effect (and may be modified during system runtime), however the system state (i\&.e\&. the contents of
279 "/var/") is reset at boot and lost at shutdown\&.
280 .sp
281 If this setting is set to
282 "overlay"
283 the root file system is set up as
284 "overlayfs"
285 mount combining the read\-only root directory with a writable
286 "tmpfs", so that no modifications are made to disk, but the file system may be modified nonetheless with all changes being lost at reboot\&.
287 .sp
288 Note that in none of these modes the root directory,
289 /etc/,
290 /var/
291 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\&.
292 .sp
293 Note that with the exception of
294 "overlay"
295 mode, enabling this setting will only work correctly on operating systems that can boot up with only
296 /usr/
297 mounted, and are able to automatically populate
298 /etc/, and also
299 /var/
300 in case of
301 "systemd\&.volatile=yes"\&.
302 .sp
303 Also see
304 \fIroot=tmpfs\fR
305 above, for a method to combine a
306 "tmpfs"
307 file system with a regular
308 /usr/
309 file system (as configured via
310 \fImount\&.usr=\fR)\&. The main distinction between
311 \fIsystemd\&.volatile=yes\fR, and
312 \fIroot=tmpfs\fR
313 in combination
314 \fImount\&.usr=\fR
315 is that the former operates on top of a regular root file system and temporarily obstructs the files and directories above its
316 /usr/
317 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
318 /usr/
319 file system\&.
320 .sp
321 Added in version 233\&.
322 .RE
323 .PP
324 \fIsystemd\&.swap=\fR
325 .RS 4
326 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
327 /etc/fstab\&. Defaults to enabled\&.
328 .sp
329 Added in version 246\&.
330 .RE
331 .PP
332 \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
333 .RS 4
334 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\&.
335 \fIrd\&.systemd\&.mount\-extra=\fR
336 is honored only in the initrd, while
337 \fIsystemd\&.mount\-extra=\fR
338 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
339 \fIsystemd\&.mount\-extra=\fR
340 is prefixed with
341 /sysroot/\&.
342 .sp
343 Example:
344 .sp
345 .if n \{\
346 .RS 4
347 .\}
348 .nf
349 systemd\&.mount\-extra=/dev/sda1:/mount\-point:ext4:rw,noatime
350 .fi
351 .if n \{\
352 .RE
353 .\}
354 .sp
355 Added in version 254\&.
356 .RE
357 .PP
358 \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
359 .RS 4
360 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\&.
361 \fIrd\&.systemd\&.swap\-extra=\fR
362 is honored only in the initrd, while
363 \fIsystemd\&.swap\-extra=\fR
364 is honored by both the main system and the initrd\&.
365 .sp
366 Example:
367 .sp
368 .if n \{\
369 .RS 4
370 .\}
371 .nf
372 systemd\&.swap\-extra=/dev/sda2:x\-systemd\&.makefs
373 .fi
374 .if n \{\
375 .RE
376 .\}
377 .sp
378 Added in version 254\&.
379 .RE
380 .SH "SYSTEM CREDENTIALS"
381 .PP
382 \fIfstab\&.extra\fR
383 .RS 4
384 This credential may contain addition mounts to establish, in the same format as
385 \fBfstab\fR(5), with one mount per line\&. It is read in addition to
386 /etc/fstab\&.
387 .sp
388 Added in version 254\&.
389 .RE
390 .SH "SEE ALSO"
391 .PP
392 \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
393 .SH "NOTES"
394 .IP " 1." 4
395 Known Environment Variables
396 .RS 4
397 \%https://systemd.io/ENVIRONMENT/
398 .RE