]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd-fstab-generator.xml
tree-wide: remove Lennart's copyright lines
[thirdparty/systemd.git] / man / systemd-fstab-generator.xml
1 <?xml version="1.0"?>
2 <!--*-nxml-*-->
3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4 <!--
5 SPDX-License-Identifier: LGPL-2.1+
6 -->
7 <refentry id="systemd-fstab-generator">
8
9 <refentryinfo>
10 <title>systemd-fstab-generator</title>
11 <productname>systemd</productname>
12
13 <authorgroup>
14 <author>
15 <contrib>Developer</contrib>
16 <firstname>Lennart</firstname>
17 <surname>Poettering</surname>
18 <email>lennart@poettering.net</email>
19 </author>
20 </authorgroup>
21 </refentryinfo>
22
23 <refmeta>
24 <refentrytitle>systemd-fstab-generator</refentrytitle>
25 <manvolnum>8</manvolnum>
26 </refmeta>
27
28 <refnamediv>
29 <refname>systemd-fstab-generator</refname>
30 <refpurpose>Unit generator for /etc/fstab</refpurpose>
31 </refnamediv>
32
33 <refsynopsisdiv>
34 <para><filename>/usr/lib/systemd/system-generators/systemd-fstab-generator</filename></para>
35 </refsynopsisdiv>
36
37 <refsect1>
38 <title>Description</title>
39
40 <para><filename>systemd-fstab-generator</filename> is a generator
41 that translates <filename>/etc/fstab</filename> (see
42 <citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>
43 for details) into native systemd units early at boot and when
44 configuration of the system manager is reloaded. This will
45 instantiate mount and swap units as necessary.</para>
46
47 <para>The <varname>passno</varname> field is treated like a simple
48 boolean, and the ordering information is discarded. However, if
49 the root file system is checked, it is checked before all the
50 other file systems.</para>
51
52 <para>See
53 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
54 and
55 <citerefentry><refentrytitle>systemd.swap</refentrytitle><manvolnum>5</manvolnum></citerefentry>
56 for more information about special <filename>/etc/fstab</filename>
57 mount options this generator understands.</para>
58
59 <para>One special topic is handling of symbolic links. Historical init
60 implementations supported symlinks in <filename>/etc/fstab</filename>.
61 Because mount units will refuse mounts where the target is a symbolic link,
62 this generator will resolve any symlinks as far as possible when processing
63 <filename>/etc/fstab</filename> in order to enhance backwards compatibility.
64 If a symlink target does not exist at the time that this generator runs, it
65 is assumed that the symlink target is the final target of the mount.</para>
66
67 <para><filename>systemd-fstab-generator</filename> implements
68 <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
69 </refsect1>
70
71 <refsect1>
72 <title>Kernel Command Line</title>
73
74 <para><filename>systemd-fstab-generator</filename> understands the
75 following kernel command line parameters:</para>
76
77 <variablelist class='kernel-commandline-options'>
78
79 <varlistentry>
80 <term><varname>fstab=</varname></term>
81 <term><varname>rd.fstab=</varname></term>
82
83 <listitem><para>Takes a boolean argument. Defaults to
84 <literal>yes</literal>. If <literal>no</literal>, causes the
85 generator to ignore any mounts or swap devices configured in
86 <filename>/etc/fstab</filename>. <varname>rd.fstab=</varname>
87 is honored only by the initial RAM disk (initrd) while
88 <varname>fstab=</varname> is honored by both the main system
89 and the initrd.</para></listitem>
90 </varlistentry>
91
92 <varlistentry>
93 <term><varname>root=</varname></term>
94
95 <listitem><para>Takes the root filesystem to mount in the
96 initrd. <varname>root=</varname> is honored by the
97 initrd.</para></listitem>
98 </varlistentry>
99
100 <varlistentry>
101 <term><varname>rootfstype=</varname></term>
102
103 <listitem><para>Takes the root filesystem type that will be
104 passed to the mount command. <varname>rootfstype=</varname> is
105 honored by the initrd.</para></listitem>
106 </varlistentry>
107
108 <varlistentry>
109 <term><varname>rootflags=</varname></term>
110
111 <listitem><para>Takes the root filesystem mount options to
112 use. <varname>rootflags=</varname> is honored by the
113 initrd.</para></listitem>
114 </varlistentry>
115
116 <varlistentry>
117 <term><varname>mount.usr=</varname></term>
118
119 <listitem><para>Takes the <filename>/usr</filename> filesystem
120 to be mounted by the initrd. If
121 <varname>mount.usrfstype=</varname> or
122 <varname>mount.usrflags=</varname> is set, then
123 <varname>mount.usr=</varname> will default to the value set in
124 <varname>root=</varname>.</para>
125
126 <para>Otherwise, this parameter defaults to the
127 <filename>/usr</filename> entry found in
128 <filename>/etc/fstab</filename> on the root filesystem.</para>
129
130 <para><varname>mount.usr=</varname> is honored by the initrd.
131 </para></listitem>
132 </varlistentry>
133
134 <varlistentry>
135 <term><varname>mount.usrfstype=</varname></term>
136
137 <listitem><para>Takes the <filename>/usr</filename> filesystem
138 type that will be passed to the mount command. If
139 <varname>mount.usr=</varname> or
140 <varname>mount.usrflags=</varname> is set, then
141 <varname>mount.usrfstype=</varname> will default to the value
142 set in <varname>rootfstype=</varname>.</para>
143
144 <para>Otherwise, this value will be read from the
145 <filename>/usr</filename> entry in
146 <filename>/etc/fstab</filename> on the root filesystem.</para>
147
148 <para><varname>mount.usrfstype=</varname> is honored by the
149 initrd.</para></listitem>
150 </varlistentry>
151
152 <varlistentry>
153 <term><varname>mount.usrflags=</varname></term>
154
155 <listitem><para>Takes the <filename>/usr</filename> filesystem
156 mount options to use. If <varname>mount.usr=</varname> or
157 <varname>mount.usrfstype=</varname> is set, then
158 <varname>mount.usrflags=</varname> will default to the value
159 set in <varname>rootflags=</varname>.</para>
160
161 <para>Otherwise, this value will be read from the
162 <filename>/usr</filename> entry in
163 <filename>/etc/fstab</filename> on the root filesystem.</para>
164
165 <para><varname>mount.usrflags=</varname> is honored by the
166 initrd.</para></listitem>
167 </varlistentry>
168
169 <varlistentry>
170 <term><varname>systemd.volatile=</varname></term>
171
172 <listitem><para>Controls whether the system shall boot up in volatile mode. Takes a boolean argument or the
173 special value <option>state</option>.</para>
174
175 <para>If false (the default), this generator makes no changes to the mount tree and the system is booted up in
176 normal mode.</para>
177
178 <para>If true the generator ensures
179 <citerefentry><refentrytitle>systemd-volatile-root.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
180 is run as part of the initial RAM disk ("initrd"). This service changes the mount table before transitioning to
181 the host system, so that a volatile memory file system (<literal>tmpfs</literal>) is used as root directory,
182 with only <filename>/usr</filename> mounted into it from the configured root file system, in read-only
183 mode. This way the system operates in fully stateless mode, with all configuration and state reset at boot and
184 lost at shutdown, as <filename>/etc</filename> and <filename>/var</filename> will be served from the (initially
185 unpopulated) volatile memory file system.</para>
186
187 <para>If set to <option>state</option> the generator will leave the root
188 directory mount point unaltered, however will mount a <literal>tmpfs</literal> file system to
189 <filename>/var</filename>. In this mode the normal system configuration (i.e. the contents of
190 <literal>/etc</literal>) is in effect (and may be modified during system runtime), however the system state
191 (i.e. the contents of <literal>/var</literal>) is reset at boot and lost at shutdown.</para>
192
193 <para>Note that in none of these modes the root directory, <filename>/etc</filename>, <filename>/var</filename>
194 or any other resources stored in the root file system are physically removed. It's thus safe to boot a system
195 that is normally operated in non-volatile mode temporarily into volatile mode, without losing data.</para>
196
197 <para>Note that enabling this setting will only work correctly on operating systems that can boot up with only
198 <filename>/usr</filename> mounted, and are able to automatically populate <filename>/etc</filename>, and also
199 <filename>/var</filename> in case of <literal>systemd.volatile=yes</literal>.</para></listitem>
200 </varlistentry>
201 </variablelist>
202 </refsect1>
203
204 <refsect1>
205 <title>See Also</title>
206 <para>
207 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
208 <citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
209 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
210 <citerefentry><refentrytitle>systemd.swap</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
211 <citerefentry><refentrytitle>systemd-cryptsetup-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
212 <citerefentry><refentrytitle>kernel-command-line</refentrytitle><manvolnum>7</manvolnum></citerefentry>
213 </para>
214 </refsect1>
215
216 </refentry>