Debian Codegraph @

upstream/fedora-44/man8/systemd-gpt-auto-generator.8

raw
1 '\" t
2 .TH "SYSTEMD\-GPT\-AUTO\-GENERATOR" "8" "" "systemd 259.5" "systemd-gpt-auto-generator"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 systemd-gpt-auto-generator \- Generator for automatically discovering and mounting root, /home/, /srv/, /var/ and /var/tmp/ partitions, as well as discovering and enabling swap partitions, based on GPT partition type GUIDs
24 .SH "SYNOPSIS"
25 .PP
26 /usr/lib/systemd/system\-generators/systemd\-gpt\-auto\-generator
27 .SH "DESCRIPTION"
28 .PP
29 systemd\-gpt\-auto\-generator
30 is a unit generator that automatically discovers the root partition,
31 /home/,
32 /srv/,
33 /var/,
34 /var/tmp/, the EFI System Partition (ESP), the Extended Boot Loader Partition (XBOOTLDR), and swap partitions and creates mount and swap units for them, based on the partition type GUIDs of GUID partition tables (GPT)\&. See
35 \m[blue]\fBUEFI Specification\fR\m[]\&\s-2\u[1]\d\s+2, chapter 5 for more details\&. It implements the
36 \m[blue]\fBUAPI\&.2 Discoverable Partitions Specification\fR\m[]\&\s-2\u[2]\d\s+2\&.
37 .PP
38 Note that this generator has no effect on non\-GPT systems\&. It will also not create mount point configuration for directories which already contain files or if the mount point is explicitly configured in
39 \fBfstab\fR(5)\&. Additionally no unit will be created for the ESP or the XBOOTLDR partition if mount entries are found in the
40 /boot/
41 or
42 /efi/
43 hierarchies in
44 \fBfstab\fR(5)\&.
45 .PP
46 If the units this generator creates are overridden, for example by units in directories with higher precedence, drop\-ins and additional dependencies created by this generator might still be used\&.
47 .PP
48 When run in the initial RAM disk (initrd) this generator can automatically search for the root file system\&. Specifically:
49 .sp
50 .RS 4
51 .ie n \{\
52 \h'-04'\(bu\h'+03'\c
53 .\}
54 .el \{\
55 .sp -1
56 .IP \(bu 2.3
57 .\}
58 It will look for the root partition on the same physical disk where the EFI System Partition (ESP) is located\&. Note that support from the boot loader is required for this to work: the EFI variable
59 \fILoaderDevicePartUUID\fR
60 of the
61 \fB4a67b082\-0a4c\-41cf\-b6c7\-440b29bb8c4f\fR
62 vendor UUID is used to determine from which partition (and hence disk) the system was booted\&. If the boot loader does not set this variable, this generator will not be able to detect the root partition\&. See the
63 \m[blue]\fBBoot Loader Interface\fR\m[]\&\s-2\u[3]\d\s+2
64 for details\&.
65 .RE
66 .sp
67 .RS 4
68 .ie n \{\
69 \h'-04'\(bu\h'+03'\c
70 .\}
71 .el \{\
72 .sp -1
73 .IP \(bu 2.3
74 .\}
75 Alternatively, it will look for the root file system on a loopback block device whose
76 "\&.lo_name"
77 field is set to one of the literal strings
78 "rootdisk"
79 or
80 "rootdisk\&.raw"\&. This field can be set via
81 \fBlosetup\fR\*(Aqs
82 \fB\-\-loop\-ref=\fR
83 string\&. For images downloaded via
84 \fBsystemd-import-generator\fR(8)
85 make sure to set the
86 "blockdev"
87 option and set the local name string to
88 "rootdisk"
89 to achieve this effect\&. Note that discovery of the root file system on loopback block devices like this is only done if
90 "root=gpt\-auto"
91 or
92 "root=dissect"
93 is specified explicitly on the kernel command line, unlike the discovery based on the boot loader reported ESP which is also enabled if no
94 "root="
95 parameter is specified at all\&. (The latter relies on
96 \fBsystemd\-udevd\&.service\fR\*(Aqs
97 /dev/gpt\-auto\-root
98 block device symlink generation)\&.
99 .RE
100 .PP
101 When run on the host system (i\&.e\&. after successfully transitioning out of the initrd into the root filesystem) this generator will look for all other partitions on the same physical disk as the root partition\&. For this discovery, boot loader support is not required\&. Moreover, it is not required that the root partition was automatically discovered by the initrd (as described above) for the discovery of the non\-root file partitions to take place\&. Or in other words: automatic discovery of the root file system and of the non\-root file systems are independent operations, that do not rely on each other, and are done during two distinct phases of the boot process (one in the initrd, the other after)\&. These partitions will not be searched for on systems where the root file system is distributed on multiple disks, for example via btrfs RAID\&.
102 .PP
103 The root partition can be configured explicitly by symlinking
104 /run/systemd/volatile\-root
105 to
106 /dev/block/$major:$minor\&. This is especially useful if the root mount has been replaced by some form of volatile file system (overlayfs)\&.
107 .PP
108 systemd\-gpt\-auto\-generator
109 is useful for centralizing file system configuration in the partition table and making configuration in
110 /etc/fstab
111 or on the kernel command line unnecessary\&.
112 .PP
113 This generator looks for the partitions based on their partition type GUID\&. The following partition type GUIDs are identified:
114 .sp
115 .it 1 an-trap
116 .nr an-no-space-flag 1
117 .nr an-break-flag 1
118 .br
119 .B Table\ \&1.\ \&Partition Type GUIDs
120 .TS
121 allbox tab(:);
122 lB lB lB lB lB.
123 T{
124 Partition Type
125 T}:T{
126 GUID
127 T}:T{
128 Name
129 T}:T{
130 Mount Point
131 T}:T{
132 Explanation
133 T}
134 .T&
135 l l l l l
136 l l l l l
137 l l l l l
138 l l l l l
139 l l l l l
140 l l l l l
141 l l l l l
142 l l l l l
143 l l l l l
144 l l l l l.
145 T{
146 \fBSD_GPT_ROOT_X86_64\fR
147 T}:T{
148 \fB4f68bce3\-e8cd\-4db1\-96e7\-fbcaf984b709\fR
149 T}:T{
150 Root Partition (x86\-64)
151 T}:T{
152 /
153 T}:T{
154 The first partition with this type UUID, located on the same disk as the ESP used for booting, is used as the root file system / on AMD64 / 64\-bit x86 systems\&.
155 T}
156 T{
157 \fBSD_GPT_ROOT_ARM64\fR
158 T}:T{
159 \fBb921b045\-1df0\-41c3\-af44\-4c6f280d3fae\fR
160 T}:T{
161 Root Partition (64\-bit ARM)
162 T}:T{
163 /
164 T}:T{
165 The first partition with this type UUID, located on the same disk as the ESP used for booting, is used as the root file system / on AArch64 / 64\-bit ARM systems\&.
166 T}
167 T{
168 \fBSD_GPT_ROOT_ALPHA\fR \fBSD_GPT_ROOT_ARC\fR \fBSD_GPT_ROOT_ARM\fR \fBSD_GPT_ROOT_ARM64\fR \fBSD_GPT_ROOT_IA64\fR \fBSD_GPT_ROOT_LOONGARCH64\fR \fBSD_GPT_ROOT_MIPS\fR \fBSD_GPT_ROOT_MIPS64\fR \fBSD_GPT_ROOT_MIPS_LE\fR \fBSD_GPT_ROOT_MIPS64_LE\fR \fBSD_GPT_ROOT_PARISC\fR \fBSD_GPT_ROOT_PPC\fR \fBSD_GPT_ROOT_PPC64\fR \fBSD_GPT_ROOT_PPC64_LE\fR \fBSD_GPT_ROOT_RISCV32\fR \fBSD_GPT_ROOT_RISCV64\fR \fBSD_GPT_ROOT_S390\fR \fBSD_GPT_ROOT_S390X\fR \fBSD_GPT_ROOT_TILEGX\fR \fBSD_GPT_ROOT_X86\fR \fBSD_GPT_ROOT_X86_64\fR \fBSD_GPT_USR_ALPHA\fR \fBSD_GPT_USR_ARC\fR \fBSD_GPT_USR_ARM\fR \fBSD_GPT_USR_IA64\fR \fBSD_GPT_USR_LOONGARCH64\fR \fBSD_GPT_USR_MIPS_LE\fR \fBSD_GPT_USR_MIPS64_LE\fR \fBSD_GPT_USR_PARISC\fR \fBSD_GPT_USR_PPC\fR \fBSD_GPT_USR_PPC64\fR \fBSD_GPT_USR_PPC64_LE\fR \fBSD_GPT_USR_RISCV32\fR \fBSD_GPT_USR_RISCV64\fR \fBSD_GPT_USR_S390\fR \fBSD_GPT_USR_S390X\fR \fBSD_GPT_USR_TILEGX\fR \fBSD_GPT_USR_X86\fR
169 T}:T{
170 \&...
171 T}:T{
172 Root partitions for other architectures
173 T}:T{
174 /
175 T}:T{
176 The first partition with the type UUID matching the architecture, located on the same disk as the ESP used for booting, is used as the root file system /\&. For the full list and constant values, see \m[blue]\fBUAPI\&.2 Discoverable Partitions Specification\fR\m[]\&\s-2\u[2]\d\s+2\&.
177 T}
178 T{
179 \fBSD_GPT_HOME\fR
180 T}:T{
181 \fB933ac7e1\-2eb4\-4f13\-b844\-0e14e2aef915\fR
182 T}:T{
183 Home Partition
184 T}:T{
185 /home/
186 T}:T{
187 The first partition with this type UUID on the same disk as the root partition is mounted to /home/\&.
188 T}
189 T{
190 \fBSD_GPT_SRV\fR
191 T}:T{
192 \fB3b8f8425\-20e0\-4f3b\-907f\-1a25a76f98e8\fR
193 T}:T{
194 Server Data Partition
195 T}:T{
196 /srv/
197 T}:T{
198 The first partition with this type UUID on the same disk as the root partition is mounted to /srv/\&.
199 T}
200 T{
201 \fBSD_GPT_VAR\fR
202 T}:T{
203 \fB4d21b016\-b534\-45c2\-a9fb\-5c16e091fd2d\fR
204 T}:T{
205 Variable Data Partition
206 T}:T{
207 /var/
208 T}:T{
209 The first partition with this type UUID on the same disk as the root partition is mounted to /var/ \(em under the condition its partition UUID matches the first 128 bit of the HMAC\-SHA256 of the GPT type uuid of this partition keyed by the machine ID of the installation stored in \fBmachine-id\fR(5)\&. This can be generated using \fBsystemd-id128\fR(1)\&.
210 T}
211 T{
212 \fBSD_GPT_TMP\fR
213 T}:T{
214 \fB7ec6f557\-3bc5\-4aca\-b293\-16ef5df639d1\fR
215 T}:T{
216 Temporary Data Partition
217 T}:T{
218 /var/tmp/
219 T}:T{
220 The first partition with this type UUID on the same disk as the root partition is mounted to /var/tmp/\&.
221 T}
222 T{
223 \fBSD_GPT_SWAP\fR
224 T}:T{
225 \fB0657fd6d\-a4ab\-43c4\-84e5\-0933c84b4f4f\fR
226 T}:T{
227 Swap
228 T}:T{
229 n/a
230 T}:T{
231 All partitions with this type UUID on the same disk as the root partition are used as swap\&.
232 T}
233 T{
234 \fBSD_GPT_ESP\fR
235 T}:T{
236 \fBc12a7328\-f81f\-11d2\-ba4b\-00a0c93ec93b\fR
237 T}:T{
238 EFI System Partition (ESP)
239 T}:T{
240 /efi/ or /boot/
241 T}:T{
242 The first partition with this type UUID located on the same disk as the root partition is mounted to /boot/ or /efi/, see below\&.
243 T}
244 T{
245 \fBSD_GPT_XBOOTLDR\fR
246 T}:T{
247 \fBbc13c2ff\-59e6\-4262\-a352\-b275fd6f7172\fR
248 T}:T{
249 Extended Boot Loader Partition
250 T}:T{
251 /boot/
252 T}:T{
253 The first partition with this type UUID located on the same disk as the root partition is mounted to /boot/, see below\&.
254 T}
255 .TE
256 .sp 1
257 .PP
258 This generator understands the following attribute flags for partitions:
259 .sp
260 .it 1 an-trap
261 .nr an-no-space-flag 1
262 .nr an-break-flag 1
263 .br
264 .B Table\ \&2.\ \&Partition Attribute Flags
265 .TS
266 allbox tab(:);
267 lB lB lB lB.
268 T{
269 Flag
270 T}:T{
271 Value
272 T}:T{
273 Applicable to
274 T}:T{
275 Explanation
276 T}
277 .T&
278 l l l l
279 l l l l
280 l l l l.
281 T{
282 \fBSD_GPT_FLAG_READ_ONLY\fR
283 T}:T{
284 \fB0x1000000000000000\fR
285 T}:T{
286 /, /home/, /srv/, /var/, /var/tmp/, Extended Boot Loader Partition
287 T}:T{
288 Partition is mounted read\-only
289 T}
290 T{
291 \fBSD_GPT_FLAG_NO_AUTO\fR
292 T}:T{
293 \fB0x8000000000000000\fR
294 T}:T{
295 /, /home/, /srv/, /var/, /var/tmp/, Extended Boot Loader Partition
296 T}:T{
297 Partition is not mounted automatically
298 T}
299 T{
300 \fBSD_GPT_FLAG_NO_BLOCK_IO_PROTOCOL\fR
301 T}:T{
302 \fB0x0000000000000002\fR
303 T}:T{
304 EFI System Partition (ESP)
305 T}:T{
306 Partition is not mounted automatically
307 T}
308 .TE
309 .sp 1
310 .PP
311 The
312 /home/,
313 /srv/,
314 /var/,
315 /var/tmp/
316 and swap partitions may be encrypted in LUKS format\&. In this case, a device mapper device is set up under the names
317 /dev/mapper/home,
318 /dev/mapper/srv,
319 /dev/mapper/var,
320 /dev/mapper/tmp
321 or
322 /dev/mapper/swap\&. Note that this might create conflicts if the same partition is listed in
323 /etc/crypttab
324 with a different device mapper device name\&.
325 .PP
326 When systemd is running in the initrd the
327 /
328 partition may be encrypted with LUKS as well\&. In this case, a device mapper device is set up under the name
329 /dev/mapper/root, and a
330 sysroot\&.mount
331 is set up that mounts the device under
332 /sysroot\&. For more information, see
333 \fBbootup\fR(7)\&.
334 .PP
335 Mount and automount units for the EFI System Partition (ESP) and Extended Boot Loader Partition (XBOOTLDR) are generated on EFI systems\&. If the disk contains an XBOOTLDR partition, as defined in the
336 \m[blue]\fBUAPI\&.1 Boot Loader Specification\fR\m[]\&\s-2\u[4]\d\s+2, it is made available at
337 /boot/\&. This generator creates an automount unit; the mount will only be activated on\-demand when accessed\&. The mount point will be created if necessary\&.
338 .PP
339 The ESP is mounted to
340 /boot/
341 if that directory exists and is not used for XBOOTLDR, and otherwise to
342 /efi/\&. Same as for
343 /boot/, an automount unit is used\&. The mount point will be created if necessary\&.
344 .PP
345 No configuration is created for mount points that are configured in
346 \fBfstab\fR(5)
347 or when the target directory contains files\&.
348 .PP
349 When using this generator in conjunction with btrfs file systems, make sure to set the correct default subvolumes on them, using
350 \fBbtrfs subvolume set\-default\fR\&.
351 .PP
352 If the system was booted via
353 \fBsystemd-stub\fR(7)
354 and the stub reported to userspace that the kernel image was measured to a TPM2 PCR, then any discovered root and
355 /var/
356 volume identifiers (and volume encryption key in case it is encrypted) will be automatically measured into PCR 15 on activation, via
357 \[email protected]\fR(8)\&.
358 .PP
359 Mount constraint metadata contained in the file systems is validated by pulling in
360 \[email protected]\fR(8)
361 for generated mounts\&.
362 .PP
363 systemd\-gpt\-auto\-generator
364 implements
365 \fBsystemd.generator\fR(7)\&.
366 .SH "KERNEL COMMAND LINE"
367 .PP
368 systemd\-gpt\-auto\-generator
369 understands the following kernel command line parameters:
370 .PP
371 \fIsystemd\&.gpt_auto\fR, \fIrd\&.systemd\&.gpt_auto\fR
372 .RS 4
373 Those options take an optional boolean argument, and default to yes\&. The generator is enabled by default, and a false value may be used to disable it (e\&.g\&.
374 "systemd\&.gpt_auto=0")\&.
375 .sp
376 Added in version 242\&.
377 .RE
378 .PP
379 \fIsystemd\&.image_policy=\fR
380 .RS 4
381 Takes an image dissection policy string as argument (as per
382 \fBsystemd.image-policy\fR(7)), and allows enforcing a policy on dissection and use of the automatically discovered GPT partition table entries\&.
383 .sp
384 Note that the specified image policy is not taken into account for automatic root or
385 /usr/
386 file system discovery unless
387 \fIroot=dissect\fR/\fImount\&.usr=dissect\fR
388 (or
389 \fIroot=dissect\-force\fR) are specified\&. (The policy will always be applied to the other auto\-discoverable partition types\&.)
390 .sp
391 Added in version 254\&.
392 .RE
393 .PP
394 \fIsystemd\&.image_filter=\fR
395 .RS 4
396 Takes an image dissection filter string as argument (as per
397 \fBsystemd.image-filter\fR(7)), and allows enforcing a set of globbing patterns on the partition matching of the automatically discovered GPT partition table entries\&.
398 .sp
399 Note that the specified image filter is not taken into account for automatic root or
400 /usr/
401 file system discovery unless
402 \fIroot=dissect\fR/\fImount\&.usr=dissect\fR
403 (or
404 \fIroot=dissect\-force\fR) are specified\&. (The filter will always be applied to the other auto\-discoverable partition types\&.)
405 .sp
406 Added in version 258\&.
407 .RE
408 .PP
409 \fIroot=\fR, \fIrootfstype=\fR, \fIrootflags=\fR
410 .RS 4
411 When
412 \fIroot=\fR
413 is used with the special value
414 "gpt\-auto", basic automatic discovery of the root partition based on the GPT partition type is enabled\&. Use of the root partition is delayed until factory reset mode is left, in case it is enabled during the current boot\&. See
415 \m[blue]\fBFactory Reset\fR\m[]\&\s-2\u[5]\d\s+2
416 for more information on that\&. If
417 "gpt\-auto\-force"
418 is specified automatic discovery of the root partition is enabled, ignoring any factory reset mode\&.
419 .sp
420 If
421 \fIroot=\fR
422 is set to the special value
423 "dissect"
424 full automatic discovery of the root partition based on GPT partition information is enabled\&. This is a superset of
425 \fIroot=gpt\-auto\fR, as it automatically configures Verity partitions (including signature\-based setup) following the logic defined for that in the
426 \m[blue]\fBUAPI\&.2 Discoverable Partitions Specification\fR\m[]\&\s-2\u[6]\d\s+2\&. Moreover it takes the configured image policy and image filter into account for all partition types, including the root file system\&.
427 "root=dissect"
428 will wait for the factory reset phase to be completed if it is in effect before activating the root file system\&. Use
429 "root=dissect\-force"
430 to ignore the factory reset phase and activate the root file system immediately\&.
431 .sp
432 Any other value (i\&.e\&. besides
433 "gpt\-auto",
434 "gpt\-auto\-force",
435 "dissect",
436 "dissect\-force") disables automatic root file system discovery\&.
437 .sp
438 If
439 \fIroot=\fR
440 is not specified at all on the kernel command line automatic discovery of the root partition via the ESP reported by the boot loader is also enabled (taking factory reset state into account, i\&.e\&. equivalent to
441 "root=gpt\-auto"), however in this case discovery based on the loopback block device
442 "\&.lo_name"
443 field is not enabled\&.
444 .sp
445 The
446 \fIrootfstype=\fR
447 and
448 \fIrootflags=\fR
449 options are used to select the file system type and options when the root file system is automatically discovered\&.
450 .sp
451 Added in version 242\&.
452 .RE
453 .PP
454 \fImount\&.usr=\fR, \fImount\&.usrfstype=\fR, \fImount\&.usrflags=\fR
455 .RS 4
456 Similar to
457 \fIroot=\fR,
458 \fIrootfstype=\fR,
459 \fIrootflags=\fR
460 (see above), but applies to the
461 /usr/
462 partition instead\&. Note that the
463 "gpt\-auto",
464 "gpt\-auto\-force",
465 "dissect\-force"
466 settings that
467 root=
468 understands are not supported by
469 \fImount\&.usr=\fR
470 (however
471 "dissect"
472 is)\&.
473 .sp
474 Also note that automatic partition discovery for
475 /usr/
476 must be enabled explicitly, unlike the discovery for the root file system, which is enabled if no
477 \fIroot=\fR
478 parameter is passed at all\&.
479 .sp
480 Added in version 258\&.
481 .RE
482 .PP
483 \fIrw\fR, \fIro\fR
484 .RS 4
485 Mount the root partition read\-write or read\-only
486 \fIinitially\fR\&.
487 .sp
488 Note that unlike most kernel command line options these settings do not override configuration in the file system, and the file system may be remounted later\&. See
489 \fBsystemd-remount-fs.service\fR(8)\&.
490 .sp
491 Added in version 242\&.
492 .RE
493 .PP
494 \fIsystemd\&.swap=\fR
495 .RS 4
496 Takes a boolean argument or enables the option if specified without an argument\&. If disabled, automatic discovery of swap partition(s) based on GPT partition type is disabled\&. Defaults to enabled\&.
497 .sp
498 Added in version 254\&.
499 .RE
500 .SH "SEE ALSO"
501 .PP
502 \fBsystemd\fR(1), \fBsystemd.mount\fR(5), \fBsystemd.swap\fR(5), \fBsystemd-fstab-generator\fR(8), \[email protected]\fR(8), \[email protected]\fR(8), \[email protected]\fR(8), \fBmachine-id\fR(5), \fBcryptsetup\fR(8), \fBfstab\fR(5), \fBbtrfs\fR(8)
503 .SH "NOTES"
504 .IP " 1." 4
505 UEFI Specification
506 .RS 4
507 \%https://uefi.org/specifications
508 .RE
509 .IP " 2." 4
510 UAPI.2 Discoverable Partitions Specification
511 .RS 4
512 \%https://uapi-group.org/specifications/specs/discoverable_partitions_specification
513 .RE
514 .IP " 3." 4
515 Boot Loader Interface
516 .RS 4
517 \%https://systemd.io/BOOT_LOADER_INTERFACE
518 .RE
519 .IP " 4." 4
520 UAPI.1 Boot Loader Specification
521 .RS 4
522 \%https://uapi-group.org/specifications/specs/boot_loader_specification
523 .RE
524 .IP " 5." 4
525 Factory Reset
526 .RS 4
527 \%https://systemd.io/FACTORY_RESET
528 .RE
529 .IP " 6." 4
530 UAPI.2 Discoverable Partitions Specification
531 .RS 4
532 \%https://uapi-group.org/specifications/specs/discoverable_partitions_specification/
533 .RE