1SYSTEMD-GPT-AUTO-GENERATOR(s8y)stemd-gpt-auto-generatSoYrSTEMD-GPT-AUTO-GENERATOR(8)
2
3
4
6 systemd-gpt-auto-generator - Generator for automatically discovering
7 and mounting root, /home/, /srv/, /var/ and /var/tmp/ partitions, as
8 well as discovering and enabling swap partitions, based on GPT
9 partition type GUIDs
10
12 /usr/lib/systemd/system-generators/systemd-gpt-auto-generator
13
15 systemd-gpt-auto-generator is a unit generator that automatically
16 discovers root, /home/, /srv/, /var/, /var/tmp/, the EFI System
17 Partition, the Extended Boot Loader Partition and swap partitions and
18 creates mount and swap units for them, based on the partition type
19 GUIDs of GUID partition tables (GPT), see UEFI Specification[1],
20 chapter 5. It implements the Discoverable Partitions Specification[2].
21 Note that this generator has no effect on non-GPT systems, and on
22 specific mount points that are directories already containing files.
23 Also, on systems where the units are explicitly configured (for
24 example, listed in fstab(5)), the units this generator creates are
25 overridden, but additional implicit dependencies might be created.
26
27 This generator will only look for the root partition on the same
28 physical disk the EFI System Partition (ESP) is located on. Note that
29 support from the boot loader is required: the EFI variable
30 LoaderDevicePartUUID of the 4a67b082-0a4c-41cf-b6c7-440b29bb8c4f vendor
31 UUID is used to determine from which partition, and hence the disk from
32 which the system was booted. If the boot loader does not set this
33 variable, this generator will not be able to autodetect the root
34 partition. See the Boot Loader Interface[3] for details.
35
36 Similarly, this generator will only look for the other partitions on
37 the same physical disk as the root partition. In this case, boot loader
38 support is not required. These partitions will not be searched for on
39 systems where the root file system is distributed on multiple disks,
40 for example via btrfs RAID.
41
42 systemd-gpt-auto-generator is useful for centralizing file system
43 configuration in the partition table and making configuration in
44 /etc/fstab or on the kernel command line unnecessary.
45
46 This generator looks for the partitions based on their partition type
47 GUID. The following partition type GUIDs are identified:
48
49 Table 1. Partition Type GUIDs
50 ┌─────────────────────────────────────┬──────────────────┬─────────────────┬──────────────────┐
51 │Partition Type │ Name │ Mount Point │ Explanation │
52 │GUID │ │ │ │
53 ├─────────────────────────────────────┼──────────────────┼─────────────────┼──────────────────┤
54 │44479540-f297-41b2-9af7-d131d5f0458a │ Root Partition │ / │ On 32-bit x86 │
55 │ │ (x86) │ │ systems, the │
56 │ │ │ │ first x86 root │
57 │ │ │ │ partition on the │
58 │ │ │ │ disk the EFI ESP │
59 │ │ │ │ is located on is │
60 │ │ │ │ mounted to the │
61 │ │ │ │ root directory │
62 │ │ │ │ /. │
63 ├─────────────────────────────────────┼──────────────────┼─────────────────┼──────────────────┤
64 │4f68bce3-e8cd-4db1-96e7-fbcaf984b709 │ Root Partition │ / │ On 64-bit x86 │
65 │ │ (x86-64) │ │ systems, the │
66 │ │ │ │ first x86-64 │
67 │ │ │ │ root partition │
68 │ │ │ │ on the disk the │
69 │ │ │ │ EFI ESP is │
70 │ │ │ │ located on is │
71 │ │ │ │ mounted to the │
72 │ │ │ │ root directory │
73 │ │ │ │ /. │
74 ├─────────────────────────────────────┼──────────────────┼─────────────────┼──────────────────┤
75 │69dad710-2ce4-4e3c-b16c-21a1d49abed3 │ Root Partition │ / │ On 32-bit ARM │
76 │ │ (32-bit ARM) │ │ systems, the │
77 │ │ │ │ first ARM root │
78 │ │ │ │ partition on the │
79 │ │ │ │ disk the EFI ESP │
80 │ │ │ │ is located on is │
81 │ │ │ │ mounted to the │
82 │ │ │ │ root directory │
83 │ │ │ │ /. │
84 ├─────────────────────────────────────┼──────────────────┼─────────────────┼──────────────────┤
85 │b921b045-1df0-41c3-af44-4c6f280d3fae │ Root Partition │ / │ On 64-bit ARM │
86 │ │ (64-bit ARM) │ │ systems, the │
87 │ │ │ │ first ARM root │
88 │ │ │ │ partition on the │
89 │ │ │ │ disk the EFI ESP │
90 │ │ │ │ is located on is │
91 │ │ │ │ mounted to the │
92 │ │ │ │ root directory │
93 │ │ │ │ /. │
94 ├─────────────────────────────────────┼──────────────────┼─────────────────┼──────────────────┤
95 │993d8d3d-f80e-4225-855a-9daf8ed7ea97 │ Root Partition │ / │ On Itanium │
96 │ │ (Itanium/IA-64) │ │ systems, the │
97 │ │ │ │ first Itanium │
98 │ │ │ │ root partition │
99 │ │ │ │ on the disk the │
100 │ │ │ │ EFI ESP is │
101 │ │ │ │ located on is │
102 │ │ │ │ mounted to the │
103 │ │ │ │ root directory │
104 │ │ │ │ /. │
105 ├─────────────────────────────────────┼──────────────────┼─────────────────┼──────────────────┤
106 │60d5a7fe-8e7d-435c-b714-3dd8162144e1 │ Root Partition │ / │ On RISC-V 32-bit │
107 │ │ (RISCV-V 32) │ │ systems, the │
108 │ │ │ │ first RISCV-V │
109 │ │ │ │ 32-bit root │
110 │ │ │ │ partition on the │
111 │ │ │ │ disk the EFI ESP │
112 │ │ │ │ is located on is │
113 │ │ │ │ mounted to the │
114 │ │ │ │ root directory │
115 │ │ │ │ /. │
116 ├─────────────────────────────────────┼──────────────────┼─────────────────┼──────────────────┤
117 │72ec70a6-cf74-40e6-bd49-4bda08e8f224 │ Root Partition │ / │ On RISC-V 64-bit │
118 │ │ (RISCV-V 64) │ │ systems, the │
119 │ │ │ │ first RISCV-V │
120 │ │ │ │ 64-bit root │
121 │ │ │ │ partition on the │
122 │ │ │ │ disk the EFI ESP │
123 │ │ │ │ is located on is │
124 │ │ │ │ mounted to the │
125 │ │ │ │ root directory │
126 │ │ │ │ /. │
127 ├─────────────────────────────────────┼──────────────────┼─────────────────┼──────────────────┤
128 │933ac7e1-2eb4-4f13-b844-0e14e2aef915 │ Home Partition │ /home/ │ The first home │
129 │ │ │ │ partition on the │
130 │ │ │ │ disk the root │
131 │ │ │ │ partition is │
132 │ │ │ │ located on is │
133 │ │ │ │ mounted to │
134 │ │ │ │ /home/. │
135 ├─────────────────────────────────────┼──────────────────┼─────────────────┼──────────────────┤
136 │3b8f8425-20e0-4f3b-907f-1a25a76f98e8 │ Server Data │ /srv/ │ The first server │
137 │ │ Partition │ │ data partition │
138 │ │ │ │ on the disk the │
139 │ │ │ │ root partition │
140 │ │ │ │ is located on is │
141 │ │ │ │ mounted to │
142 │ │ │ │ /srv/. │
143 ├─────────────────────────────────────┼──────────────────┼─────────────────┼──────────────────┤
144 │4d21b016-b534-45c2-a9fb-5c16e091fd2d │ Variable Data │ /var/ │ The first │
145 │ │ Partition │ │ variable data │
146 │ │ │ │ partition on the │
147 │ │ │ │ disk the root │
148 │ │ │ │ partition is │
149 │ │ │ │ located on is │
150 │ │ │ │ mounted to /var/ │
151 │ │ │ │ — under the │
152 │ │ │ │ condition its │
153 │ │ │ │ partition UUID │
154 │ │ │ │ matches the │
155 │ │ │ │ first 128 bit of │
156 │ │ │ │ the HMAC-SHA256 │
157 │ │ │ │ of the GPT type │
158 │ │ │ │ uuid of this │
159 │ │ │ │ partition keyed │
160 │ │ │ │ by the machine │
161 │ │ │ │ ID of the │
162 │ │ │ │ installation │
163 │ │ │ │ stored in │
164 │ │ │ │ machine-id(5). │
165 ├─────────────────────────────────────┼──────────────────┼─────────────────┼──────────────────┤
166 │7ec6f557-3bc5-4aca-b293-16ef5df639d1 │ Temporary Data │ /var/tmp/ │ The first │
167 │ │ Partition │ │ temporary data │
168 │ │ │ │ partition on the │
169 │ │ │ │ disk the root │
170 │ │ │ │ partition is │
171 │ │ │ │ located on is │
172 │ │ │ │ mounted to │
173 │ │ │ │ /var/tmp/. │
174 ├─────────────────────────────────────┼──────────────────┼─────────────────┼──────────────────┤
175 │0657fd6d-a4ab-43c4-84e5-0933c84b4f4f │ Swap │ n/a │ All swap │
176 │ │ │ │ partitions │
177 │ │ │ │ located on the │
178 │ │ │ │ disk the root │
179 │ │ │ │ partition is │
180 │ │ │ │ located on are │
181 │ │ │ │ enabled. │
182 ├─────────────────────────────────────┼──────────────────┼─────────────────┼──────────────────┤
183 │c12a7328-f81f-11d2-ba4b-00a0c93ec93b │ EFI System │ /efi/ or /boot/ │ The first ESP │
184 │ │ Partition (ESP) │ │ located on the │
185 │ │ │ │ disk the root │
186 │ │ │ │ partition is │
187 │ │ │ │ located on is │
188 │ │ │ │ mounted to │
189 │ │ │ │ /boot/ or /efi/, │
190 │ │ │ │ see below. │
191 ├─────────────────────────────────────┼──────────────────┼─────────────────┼──────────────────┤
192 │bc13c2ff-59e6-4262-a352-b275fd6f7172 │ Extended Boot │ /boot/ │ The first │
193 │ │ Loader Partition │ │ Extended Boot │
194 │ │ │ │ Loader Partition │
195 │ │ │ │ is mounted to │
196 │ │ │ │ /boot/, see │
197 │ │ │ │ below. │
198 └─────────────────────────────────────┴──────────────────┴─────────────────┴──────────────────┘
199
200 This generator understands the following attribute flags for
201 partitions:
202
203 Table 2. Partition Attributes
204 ┌──────────────────────────────┬────────────────────┬──────────────────┬──────────────────┐
205 │Name │ Value │ Applicable to │ Explanation │
206 ├──────────────────────────────┼────────────────────┼──────────────────┼──────────────────┤
207 │GPT_FLAG_READ_ONLY │ 0x1000000000000000 │ /, /home/, │ Partition is │
208 │ │ │ /srv/, /var/, │ mounted │
209 │ │ │ /var/tmp/, │ read-only │
210 │ │ │ Extended Boot │ │
211 │ │ │ Loader Partition │ │
212 ├──────────────────────────────┼────────────────────┼──────────────────┼──────────────────┤
213 │GPT_FLAG_NO_AUTO │ 0x8000000000000000 │ /, /home/, │ Partition is not │
214 │ │ │ /srv/, /var/, │ mounted │
215 │ │ │ /var/tmp/, │ automatically │
216 │ │ │ Extended Boot │ │
217 │ │ │ Loader Partition │ │
218 ├──────────────────────────────┼────────────────────┼──────────────────┼──────────────────┤
219 │GPT_FLAG_NO_BLOCK_IO_PROTOCOL │ 0x0000000000000002 │ EFI System │ Partition is not │
220 │ │ │ Partition (ESP) │ mounted │
221 │ │ │ │ automatically │
222 └──────────────────────────────┴────────────────────┴──────────────────┴──────────────────┘
223
224 The /home/, /srv/, /var/ and /var/tmp/ partitions may be encrypted in
225 LUKS format. In this case, a device mapper device is set up under the
226 names /dev/mapper/home, /dev/mapper/srv, /dev/mapper/var and
227 /dev/mapper/tmp. Note that this might create conflicts if the same
228 partition is listed in /etc/crypttab with a different device mapper
229 device name.
230
231 When systemd is running in the initrd the / partition may be encrypted
232 in LUKS format as well. In this case, a device mapper device is set up
233 under the name /dev/mapper/root, and a sysroot.mount is set up that
234 mounts the device under /sysroot. For more information, see bootup(7).
235
236 Mount and automount units for the EFI System Partition (ESP) are
237 generated on EFI systems. The ESP is mounted to /boot/ (except if an
238 Extended Boot Loader partition exists, see below), unless a mount point
239 directory /efi/ exists, in which case it is mounted there. Since this
240 generator creates an automount unit, the mount will only be activated
241 on-demand, when accessed. On systems where /boot/ (or /efi/ if it
242 exists) is an explicitly configured mount (for example, listed in
243 fstab(5)) or where the /boot/ (or /efi/) mount point is non-empty, no
244 mount units are generated.
245
246 If the disk contains an Extended Boot Loader partition, as defined in
247 the Boot Loader Specification[4], it is made available at /boot/ (by
248 means of an automount point, similar to the ESP, see above). If both an
249 EFI System Partition and an Extended Boot Loader partition exist the
250 latter is preferably mounted to /boot/. Make sure to create both /efi/
251 and /boot/ to ensure both partitions are mounted.
252
253 When using this generator in conjunction with btrfs file systems, make
254 sure to set the correct default subvolumes on them, using btrfs
255 subvolume set-default.
256
257 systemd-gpt-auto-generator implements systemd.generator(7).
258
260 systemd-gpt-auto-generator understands the following kernel command
261 line parameters:
262
263 systemd.gpt_auto, rd.systemd.gpt_auto
264 Those options take an optional boolean argument, and default to
265 yes. The generator is enabled by default, and a negative value may
266 be used to disable it.
267
268 root=
269 When used with the special value "gpt-auto", automatic discovery of
270 the root partition based on the GPT partition type is enabled. Any
271 other value disables this generator.
272
273 rw, ro
274 Mount the root partition read-write or read-only initially.
275
276 Note that unlike most kernel command line options these settings do
277 not override configuration in the file system, and the file system
278 may be remounted later. See systemd-remount-fs.service(8).
279
281 systemd(1), systemd.mount(5), systemd.swap(5), systemd-fstab-
282 generator(8), systemd-cryptsetup@.service(8), machine-id(5),
283 cryptsetup(8), fstab(5), btrfs(8)
284
286 1. UEFI Specification
287 https://uefi.org/specifications
288
289 2. Discoverable Partitions Specification
290 https://systemd.io/DISCOVERABLE_PARTITIONS
291
292 3. Boot Loader Interface
293 https://systemd.io/BOOT_LOADER_INTERFACE
294
295 4. Boot Loader Specification
296 https://systemd.io/BOOT_LOADER_SPECIFICATION
297
298
299
300systemd 249 SYSTEMD-GPT-AUTO-GENERATOR(8)