1SYSTEMD-FSTAB-GENERATOR(8)  systemd-fstab-generator SYSTEMD-FSTAB-GENERATOR(8)
2
3
4

NAME

6       systemd-fstab-generator - Unit generator for /etc/fstab
7

SYNOPSIS

9       /usr/lib/systemd/system-generators/systemd-fstab-generator
10

DESCRIPTION

12       systemd-fstab-generator is a generator that translates /etc/fstab (see
13       fstab(5) for details) into native systemd units early at boot and when
14       configuration of the system manager is reloaded. This will instantiate
15       mount and swap units as necessary.
16
17       The passno field is treated like a simple boolean, and the ordering
18       information is discarded. However, if the root file system is checked,
19       it is checked before all the other file systems.
20
21       See systemd.mount(5) and systemd.swap(5) for more information about
22       special /etc/fstab mount options this generator understands.
23
24       One special topic is handling of symbolic links. Historical init
25       implementations supported symlinks in /etc/fstab. Because mount units
26       will refuse mounts where the target is a symbolic link, this generator
27       will resolve any symlinks as far as possible when processing /etc/fstab
28       in order to enhance backwards compatibility. If a symlink target does
29       not exist at the time that this generator runs, it is assumed that the
30       symlink target is the final target of the mount.
31
32       systemd-fstab-generator implements systemd.generator(7).
33

KERNEL COMMAND LINE

35       systemd-fstab-generator understands the following kernel command line
36       parameters:
37
38       fstab=, rd.fstab=
39           Takes a boolean argument. Defaults to "yes". If "no", causes the
40           generator to ignore any mounts or swap devices configured in
41           /etc/fstab.  rd.fstab= is honored only in the initrd, while fstab=
42           is honored by both the main system and the initrd.
43
44       root=
45           Configures the operating system's root filesystem to mount when
46           running in the initrd. This accepts a device node path (usually
47           /dev/disk/by-uuid/...  or /dev/disk/by-label/...  or similar), or
48           the special values "gpt-auto", "fstab", and "tmpfs".
49
50           Use "gpt-auto" to explicitly request automatic root file system
51           discovery via systemd-gpt-auto-generator(8).
52
53           Use "fstab" to explicitly request automatic root file system
54           discovery via the initrd /etc/fstab rather than via kernel command
55           line.
56
57           Use "tmpfs" in order to mount a tmpfs(5) file system as root file
58           system of the OS. This is useful in combination with mount.usr=
59           (see below) in order to combine a volatile root file system with a
60           separate, immutable /usr/ file system. Also see systemd.volatile=
61           below.
62
63       rootfstype=
64           Takes the root filesystem type that will be passed to the mount
65           command.  rootfstype= is honored by the initrd.
66
67       rootflags=
68           Takes the root filesystem mount options to use.  rootflags= is
69           honored by the initrd.
70
71           Note that unlike most kernel command line options this setting does
72           not override settings made in configuration files (specifically:
73           the mount option string in /etc/fstab). See systemd-remount-
74           fs.service(8).
75
76       mount.usr=
77           Takes the /usr/ filesystem to be mounted by the initrd. If
78           mount.usrfstype= or mount.usrflags= is set, then mount.usr= will
79           default to the value set in root=.
80
81           Otherwise, this parameter defaults to the /usr/ entry found in
82           /etc/fstab on the root filesystem.
83
84           mount.usr= is honored by the initrd.
85
86       mount.usrfstype=
87           Takes the /usr/ filesystem type that will be passed to the mount
88           command. If mount.usr= or mount.usrflags= is set, then
89           mount.usrfstype= will default to the value set in rootfstype=.
90
91           Otherwise, this value will be read from the /usr/ entry in
92           /etc/fstab on the root filesystem.
93
94           mount.usrfstype= is honored by the initrd.
95
96       mount.usrflags=
97           Takes the /usr/ filesystem mount options to use. If mount.usr= or
98           mount.usrfstype= is set, then mount.usrflags= will default to the
99           value set in rootflags=.
100
101           Otherwise, this value will be read from the /usr/ entry in
102           /etc/fstab on the root filesystem.
103
104           mount.usrflags= is honored by the initrd.
105
106       roothash=, usrhash=
107           These options are primarily read by systemd-veritysetup-
108           generator(8). When set this indicates that the root file system (or
109           /usr/) shall be mounted from Verity volumes with the specified
110           hashes. If these kernel command line options are set the root (or
111           /usr/) file system is thus mounted from a device mapper volume
112           /dev/mapper/root (or /dev/mapper/usr).
113
114       systemd.volatile=
115           Controls whether the system shall boot up in volatile mode. Takes a
116           boolean argument or the special value state.
117
118           If false (the default), this generator makes no changes to the
119           mount tree and the system is booted up in normal mode.
120
121           If true the generator ensures systemd-volatile-root.service(8) is
122           run in the initrd. This service changes the mount table before
123           transitioning to the host system, so that a volatile memory file
124           system ("tmpfs") is used as root directory, with only /usr/ mounted
125           into it from the configured root file system, in read-only mode.
126           This way the system operates in fully stateless mode, with all
127           configuration and state reset at boot and lost at shutdown, as
128           /etc/ and /var/ will be served from the (initially unpopulated)
129           volatile memory file system.
130
131           If set to state the generator will leave the root directory mount
132           point unaltered, however will mount a "tmpfs" file system to /var/.
133           In this mode the normal system configuration (i.e. the contents of
134           "/etc/") is in effect (and may be modified during system runtime),
135           however the system state (i.e. the contents of "/var/") is reset at
136           boot and lost at shutdown.
137
138           If this setting is set to "overlay" the root file system is set up
139           as "overlayfs" mount combining the read-only root directory with a
140           writable "tmpfs", so that no modifications are made to disk, but
141           the file system may be modified nonetheless with all changes being
142           lost at reboot.
143
144           Note that in none of these modes the root directory, /etc/, /var/
145           or any other resources stored in the root file system are
146           physically removed. It's thus safe to boot a system that is
147           normally operated in non-volatile mode temporarily into volatile
148           mode, without losing data.
149
150           Note that with the exception of "overlay" mode, enabling this
151           setting will only work correctly on operating systems that can boot
152           up with only /usr/ mounted, and are able to automatically populate
153           /etc/, and also /var/ in case of "systemd.volatile=yes".
154
155           Also see root=tmpfs above, for a method to combine a "tmpfs" file
156           system with a regular /usr/ file system (as configured via
157           mount.usr=). The main distinction between systemd.volatile=yes, and
158           root=tmpfs in combination mount.usr= is that the former operates on
159           top of a regular root file system and temporarily obstructs the
160           files and directories above its /usr/ subdirectory, while the
161           latter does not hide any files, but simply mounts a unpopulated
162           tmpfs as root file system and combines it with a user picked /usr/
163           file system.
164
165       systemd.swap=
166           Takes a boolean argument or enables the option if specified without
167           an argument. If disabled, causes the generator to ignore any swap
168           devices configured in /etc/fstab. Defaults to enabled.
169
170       systemd.mount-extra=WHAT:WHERE[:FSTYPE[:OPTIONS]],
171       rd.systemd.mount-extra=WHAT:WHERE[:FSTYPE[:OPTIONS]]
172           Specifies the mount unit. Takes at least two and at most four
173           fields separated with a colon (":"). Each field is handled as the
174           corresponding fstab field. This option can be specified multiple
175           times.  rd.systemd.mount-extra= is honored only in the initrd,
176           while systemd.mount-extra= is honored by both the main system and
177           the initrd. In the initrd, the mount point (and also source path if
178           the mount is bind mount) specified in systemd.mount-extra= is
179           prefixed with /sysroot/.
180
181           Example:
182
183               systemd.mount-extra=/dev/sda1:/mount-point:ext4:rw,noatime
184
185
186       systemd.swap-extra=WHAT[:OPTIONS], rd.systemd.swap-extra=WHAT[:OPTIONS]
187           Specifies the swap unit. Takes the block device to be used as a
188           swap device, and optionally takes mount options followed by a colon
189           (":"). This option can be specified multiple times.
190           rd.systemd.swap-extra= is honored only in the initrd, while
191           systemd.swap-extra= is honored by both the main system and the
192           initrd.
193
194           Example:
195
196               systemd.swap-extra=/dev/sda2:x-systemd.makefs
197
198

SYSTEM CREDENTIALS

200       fstab.extra
201           This credential may contain addition mounts to establish, in the
202           same format as fstab(5), with one mount per line. It is read in
203           addition to /etc/fstab.
204

SEE ALSO

206       systemd(1), fstab(5), systemd.mount(5), systemd.swap(5), systemd-
207       cryptsetup-generator(8), systemd-gpt-auto-generator(8), kernel-command-
208       line(7), Known Environment Variables[1]
209

NOTES

211        1. Known Environment Variables
212           https://systemd.io/ENVIRONMENT/
213
214
215
216systemd 254                                         SYSTEMD-FSTAB-GENERATOR(8)
Impressum