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