]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd-gpt-auto-generator.xml
verify: use manager_load_startable_unit_or_warn() to load units for verification
[thirdparty/systemd.git] / man / systemd-gpt-auto-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 2013 Lennart Poettering
10
11 systemd is free software; you can redistribute it and/or modify it
12 under the terms of the GNU Lesser General Public License as published by
13 the Free Software Foundation; either version 2.1 of the License, or
14 (at your option) any later version.
15
16 systemd is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Lesser General Public License for more details.
20
21 You should have received a copy of the GNU Lesser General Public License
22 along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 -->
24 <refentry id="systemd-gpt-auto-generator">
25
26 <refentryinfo>
27 <title>systemd-gpt-auto-generator</title>
28 <productname>systemd</productname>
29
30 <authorgroup>
31 <author>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
36 </author>
37 </authorgroup>
38 </refentryinfo>
39
40 <refmeta>
41 <refentrytitle>systemd-gpt-auto-generator</refentrytitle>
42 <manvolnum>8</manvolnum>
43 </refmeta>
44
45 <refnamediv>
46 <refname>systemd-gpt-auto-generator</refname>
47 <refpurpose>Generator for automatically discovering
48 and mounting root, <filename>/home</filename> and
49 <filename>/srv</filename> partitions, as well as
50 discovering and enabling swap partitions, based on GPT
51 partition type GUIDs.</refpurpose>
52 </refnamediv>
53
54 <refsynopsisdiv>
55 <para><filename>/usr/lib/systemd/system-generators/systemd-gpt-auto-generator</filename></para>
56 </refsynopsisdiv>
57
58 <refsect1>
59 <title>Description</title>
60
61 <para><filename>systemd-gpt-auto-generator</filename> is a unit
62 generator that automatically discovers root,
63 <filename>/home</filename>, <filename>/srv</filename> and swap
64 partitions and creates mount and swap units for them, based on the
65 partition type GUIDs of GUID partition tables (GPT),
66 see <ulink url="http://www.uefi.org/specifications">UEFI Specification</ulink>, chapter 5.
67 It implements the <ulink
68 url="https://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/">Discoverable
69 Partitions Specification</ulink>. Note that this generator has no
70 effect on non-GPT systems, or where the directories under the
71 mount points are already non-empty. Also, on systems where the
72 units are explicitly configured (for example, listed in
73 <citerefentry
74 project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>),
75 the units this generator creates are overridden, but additional
76 implicit dependencies might be created.</para>
77
78 <para>This generator will only look for root partitions on the
79 same physical disk the EFI System Partition (ESP) is located on.
80 It will only look for the other partitions on the same physical
81 disk the root file system is located on. These partitions will not
82 be searched for on systems where the root file system is distributed
83 on multiple disks, for example via btrfs RAID.</para>
84
85 <para><filename>systemd-gpt-auto-generator</filename> is useful
86 for centralizing file system configuration in the partition table
87 and making configuration in <filename>/etc/fstab</filename> unnecessary.
88 </para>
89
90 <para>This generator looks for the partitions based on their
91 partition type GUID. The following partition type GUIDs are
92 identified:</para>
93
94 <table>
95 <title>Partition Type GUIDs</title>
96 <tgroup cols='3' align='left' colsep='1' rowsep='1'>
97 <colspec colname="guid" />
98 <colspec colname="name" />
99 <colspec colname="explanation" />
100 <thead>
101 <row>
102 <entry>Partition Type GUID</entry>
103 <entry>Name</entry>
104 <entry>Explanation</entry>
105 </row>
106 </thead>
107 <tbody>
108 <row>
109 <entry>44479540-f297-41b2-9af7-d131d5f0458a</entry>
110 <entry><filename>Root Partition (x86)</filename></entry>
111 <entry>On 32-bit x86 systems, the first x86 root partition on the disk the EFI ESP is located on is mounted to the root directory <filename>/</filename>.</entry>
112 </row>
113 <row>
114 <entry>4f68bce3-e8cd-4db1-96e7-fbcaf984b709</entry>
115 <entry><filename>Root Partition (x86-64)</filename></entry>
116 <entry>On 64-bit x86 systems, the first x86-64 root partition on the disk the EFI ESP is located on is mounted to the root directory <filename>/</filename>.</entry>
117 </row>
118 <row>
119 <entry>69dad710-2ce4-4e3c-b16c-21a1d49abed3</entry>
120 <entry><filename>Root Partition (32-bit ARM)</filename></entry>
121 <entry>On 32-bit ARM systems, the first ARM root partition on the disk the EFI ESP is located on is mounted to the root directory <filename>/</filename>.</entry>
122 </row>
123 <row>
124 <entry>b921b045-1df0-41c3-af44-4c6f280d3fae</entry>
125 <entry><filename>Root Partition (64-bit ARM)</filename></entry>
126 <entry>On 64-bit ARM systems, the first ARM root partition on the disk the EFI ESP is located on is mounted to the root directory <filename>/</filename>.</entry>
127 </row>
128 <row>
129 <entry>993d8d3d-f80e-4225-855a-9daf8ed7ea97</entry>
130 <entry><filename>Root Partition (Itanium/IA-64)</filename></entry>
131 <entry>On Itanium systems, the first Itanium root partition on the disk the EFI ESP is located on is mounted to the root directory <filename>/</filename>.</entry>
132 </row>
133 <row>
134 <entry>933ac7e1-2eb4-4f13-b844-0e14e2aef915</entry>
135 <entry>Home Partition</entry>
136 <entry>The first home partition on the disk the root partition is located on is mounted to <filename>/home</filename>.</entry>
137 </row>
138 <row>
139 <entry>3b8f8425-20e0-4f3b-907f-1a25a76f98e8</entry>
140 <entry>Server Data Partition</entry>
141 <entry>The first server data partition on the disk the root partition is located on is mounted to <filename>/srv</filename>.</entry>
142 </row>
143 <row>
144 <entry>0657fd6d-a4ab-43c4-84e5-0933c84b4f4f</entry>
145 <entry>Swap</entry>
146 <entry>All swap partitions located on the disk the root partition is located on are enabled.</entry>
147 </row>
148 <row>
149 <entry>c12a7328-f81f-11d2-ba4b-00a0c93ec93b</entry>
150 <entry>EFI System Partition (ESP)</entry>
151 <entry>The first ESP located on the disk the root partition is located on is mounted to <filename>/boot</filename> or <filename>/efi</filename>, see below.</entry>
152 </row>
153 </tbody>
154 </tgroup>
155 </table>
156
157 <para>This generator understands the following attribute flags for partitions:</para>
158
159 <table>
160 <title>Partition Attributes</title>
161 <tgroup cols='4' align='left' colsep='1' rowsep='1'>
162 <colspec colname="attribute" />
163 <colspec colname="value" />
164 <colspec colname="where" />
165 <colspec colname="explanation" />
166 <thead>
167 <row>
168 <entry>Name</entry>
169 <entry>Value</entry>
170 <entry>Applicable to</entry>
171 <entry>Explanation</entry>
172 </row>
173 </thead>
174 <tbody>
175 <row>
176 <entry><constant>GPT_FLAG_READ_ONLY</constant></entry>
177 <entry>0x1000000000000000</entry>
178 <entry><filename>/</filename>, <filename>/srv</filename>, <filename>/home</filename></entry>
179 <entry>Partition is mounted read-only</entry>
180 </row>
181
182 <row>
183 <entry><constant>GPT_FLAG_NO_AUTO</constant></entry>
184 <entry>0x8000000000000000</entry>
185 <entry><filename>/</filename>, <filename>/srv</filename>, <filename>/home</filename></entry>
186 <entry>Partition is not mounted automatically</entry>
187 </row>
188
189 <row>
190 <entry><constant>GPT_FLAG_NO_BLOCK_IO_PROTOCOL</constant></entry>
191 <entry>0x0000000000000002</entry>
192 <entry>ESP</entry>
193 <entry>Partition is not mounted automatically</entry>
194 </row>
195 </tbody>
196 </tgroup>
197 </table>
198
199 <para>The <filename>/home</filename> and <filename>/srv</filename>
200 partitions may be encrypted in LUKS format. In this case, a device
201 mapper device is set up under the names
202 <filename>/dev/mapper/home</filename> and
203 <filename>/dev/mapper/srv</filename>. Note that this might create
204 conflicts if the same partition is listed in
205 <filename>/etc/crypttab</filename> with a different device mapper
206 device name.</para>
207
208 <para>Mount and automount units for the EFI System Partition (ESP) are generated on EFI systems. The ESP is mounted
209 to <filename>/boot</filename>, unless a mount point directory <filename>/efi</filename> exists, in which case it is
210 mounted there. Since this generator creates an automount unit, the mount will only be activated on-demand, when
211 accessed. On systems where <filename>/boot</filename> (or <filename>/efi</filename> if it exists) is an explicitly
212 configured mount (for example, listed in <citerefentry
213 project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>) or where the
214 <filename>/boot</filename> (or <filename>/efi</filename>) mount point is non-empty, no mount units are
215 generated.</para>
216
217 <para>When using this generator in conjunction with btrfs file
218 systems, make sure to set the correct default subvolumes on them,
219 using <command>btrfs subvolume set-default</command>.</para>
220
221 <para><filename>systemd-gpt-auto-generator</filename> implements
222 <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
223 </refsect1>
224
225 <refsect1>
226 <title>See Also</title>
227 <para>
228 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
229 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
230 <citerefentry><refentrytitle>systemd.swap</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
231 <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
232 <citerefentry><refentrytitle>systemd-cryptsetup@.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
233 <citerefentry project='die-net'><refentrytitle>cryptsetup</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
234 <citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
235 <citerefentry project='man-pages'><refentrytitle>btrfs</refentrytitle><manvolnum>8</manvolnum></citerefentry>
236 </para>
237 </refsect1>
238
239 </refentry>