1SYSTEMD-GPT-AUTO-GENERATOR(s8y)stemd-gpt-auto-generatSoYrSTEMD-GPT-AUTO-GENERATOR(8)
2
3
4

NAME

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

SYNOPSIS

12       /usr/lib/systemd/system-generators/systemd-gpt-auto-generator
13

DESCRIPTION

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 where the EFI System Partition (ESP) is located. Note
29       that 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       ┌─────────────────────────────────────┬──────────────────┬─────────────────┬───────────────────┐
51Partition Type                       Name             Mount Point     Explanation       
52GUID                                 │                  │                 │                   │
53       ├─────────────────────────────────────┼──────────────────┼─────────────────┼───────────────────┤
54SD_GPT_ROOT_X86_64                   │ Root Partition   │ /               │ The first         │
554f68bce3-e8cd-4db1-96e7-fbcaf984b709 │ (x86-64)         │                 │ partition with    │
56       │                                     │                  │                 │ this type UUID,   │
57       │                                     │                  │                 │ located on the    │
58       │                                     │                  │                 │ same disk as the  │
59       │                                     │                  │                 │ ESP, is used as   │
60       │                                     │                  │                 │ the root file     │
61       │                                     │                  │                 │ system / on       │
62       │                                     │                  │                 │ AMD64 / 64-bit    │
63       │                                     │                  │                 │ x86 systems.      │
64       ├─────────────────────────────────────┼──────────────────┼─────────────────┼───────────────────┤
65SD_GPT_ROOT_ARM64                    │ Root Partition   │ /               │ The first         │
66b921b045-1df0-41c3-af44-4c6f280d3fae │ (64-bit ARM)     │                 │ partition with    │
67       │                                     │                  │                 │ this type UUID,   │
68       │                                     │                  │                 │ located on the    │
69       │                                     │                  │                 │ same disk as the  │
70       │                                     │                  │                 │ ESP, is used as   │
71       │                                     │                  │                 │ the root file     │
72       │                                     │                  │                 │ system / on       │
73       │                                     │                  │                 │ AArch64 / 64-bit  │
74       │                                     │                  │                 │ ARM systems.      │
75       ├─────────────────────────────────────┼──────────────────┼─────────────────┼───────────────────┤
76SD_GPT_ROOT_ALPHA SD_GPT_ROOT_ARC    │ root partitions  │ /               │ The first         │
77SD_GPT_ROOT_ARM SD_GPT_ROOT_ARM64    │ for other        │                 │ partition with    │
78SD_GPT_ROOT_IA64                     │ architectures    │                 │ the type UUID     │
79SD_GPT_ROOT_LOONGARCH64              │                  │                 │ matching the      │
80SD_GPT_ROOT_MIPS SD_GPT_ROOT_MIPS64  │                  │                 │ architecture,     │
81SD_GPT_ROOT_MIPS_LE                  │                  │                 │ located on the    │
82SD_GPT_ROOT_MIPS64_LE                │                  │                 │ same disk as the  │
83SD_GPT_ROOT_PARISC SD_GPT_ROOT_PPC   │                  │                 │ ESP, is used as   │
84SD_GPT_ROOT_PPC64                    │                  │                 │ the root file     │
85SD_GPT_ROOT_PPC64_LE                 │                  │                 │ system /. For     │
86SD_GPT_ROOT_RISCV32                  │                  │                 │ the full list     │
87SD_GPT_ROOT_RISCV64 SD_GPT_ROOT_S390 │                  │                 │ and constant      │
88SD_GPT_ROOT_S390X SD_GPT_ROOT_TILEGX │                  │                 │ values, see       │
89SD_GPT_ROOT_X86 SD_GPT_ROOT_X86_64   │                  │                 │ Discoverable      
90SD_GPT_USR_ALPHA SD_GPT_USR_ARC      │                  │                 │ Partitions        │
91SD_GPT_USR_ARM SD_GPT_USR_IA64       │                  │                 │ Specification[2]. │
92SD_GPT_USR_LOONGARCH64               │                  │                 │                   │
93SD_GPT_USR_MIPS_LE                   │                  │                 │                   │
94SD_GPT_USR_MIPS64_LE                 │                  │                 │                   │
95SD_GPT_USR_PARISC SD_GPT_USR_PPC     │                  │                 │                   │
96SD_GPT_USR_PPC64 SD_GPT_USR_PPC64_LE │                  │                 │                   │
97SD_GPT_USR_RISCV32                   │                  │                 │                   │
98SD_GPT_USR_RISCV64 SD_GPT_USR_S390   │                  │                 │                   │
99SD_GPT_USR_S390X SD_GPT_USR_TILEGX   │                  │                 │                   │
100SD_GPT_USR_X86                       │                  │                 │                   │
101       ├─────────────────────────────────────┼──────────────────┼─────────────────┼───────────────────┤
102SD_GPT_HOME                          │ Home Partition   │ /home/          │ The first         │
103933ac7e1-2eb4-4f13-b844-0e14e2aef915 │                  │                 │ partition with    │
104       │                                     │                  │                 │ this type UUID on │
105       │                                     │                  │                 │ the same disk as  │
106       │                                     │                  │                 │ the ESP is        │
107       │                                     │                  │                 │ mounted to        │
108       │                                     │                  │                 │ /home/.           │
109       ├─────────────────────────────────────┼──────────────────┼─────────────────┼───────────────────┤
110SD_GPT_SRV                           │ Server Data      │ /srv/           │ The first         │
1113b8f8425-20e0-4f3b-907f-1a25a76f98e8 │ Partition        │                 │ partition with    │
112       │                                     │                  │                 │ this type UUID on │
113       │                                     │                  │                 │ the same disk as  │
114       │                                     │                  │                 │ the ESP is        │
115       │                                     │                  │                 │ mounted to /srv/. │
116       ├─────────────────────────────────────┼──────────────────┼─────────────────┼───────────────────┤
117SD_GPT_VAR                           │ Variable Data    │ /var/           │ The first         │
1184d21b016-b534-45c2-a9fb-5c16e091fd2d │ Partition        │                 │ partition with    │
119       │                                     │                  │                 │ this type UUID on │
120       │                                     │                  │                 │ the same disk as  │
121       │                                     │                  │                 │ the ESP is        │
122       │                                     │                  │                 │ mounted to /var/  │
123       │                                     │                  │                 │ — under the       │
124       │                                     │                  │                 │ condition its     │
125       │                                     │                  │                 │ partition UUID    │
126       │                                     │                  │                 │ matches the first │
127       │                                     │                  │                 │ 128 bit of the    │
128       │                                     │                  │                 │ HMAC-SHA256 of    │
129       │                                     │                  │                 │ the GPT type uuid │
130       │                                     │                  │                 │ of this partition │
131       │                                     │                  │                 │ keyed by the      │
132       │                                     │                  │                 │ machine ID of the │
133       │                                     │                  │                 │ installation      │
134       │                                     │                  │                 │ stored in         │
135       │                                     │                  │                 │ machine-id(5).    │
136       ├─────────────────────────────────────┼──────────────────┼─────────────────┼───────────────────┤
137SD_GPT_TMP                           │ Temporary Data   │ /var/tmp/       │ The first         │
1387ec6f557-3bc5-4aca-b293-16ef5df639d1 │ Partition        │                 │ partition with    │
139       │                                     │                  │                 │ this type UUID on │
140       │                                     │                  │                 │ the same disk as  │
141       │                                     │                  │                 │ the ESP is        │
142       │                                     │                  │                 │ mounted to        │
143       │                                     │                  │                 │ /var/tmp/.        │
144       ├─────────────────────────────────────┼──────────────────┼─────────────────┼───────────────────┤
145SD_GPT_SWAP                          │ Swap             │ n/a             │ All partitions    │
1460657fd6d-a4ab-43c4-84e5-0933c84b4f4f │                  │                 │ with this type    │
147       │                                     │                  │                 │ UUID on the same  │
148       │                                     │                  │                 │ disk as the ESP   │
149       │                                     │                  │                 │ are used as swap. │
150       ├─────────────────────────────────────┼──────────────────┼─────────────────┼───────────────────┤
151SD_GPT_ESP                           │ EFI System       │ /efi/ or /boot/ │ The first         │
152c12a7328-f81f-11d2-ba4b-00a0c93ec93b │ Partition (ESP)  │                 │ partition with    │
153       │                                     │                  │                 │ this type UUID    │
154       │                                     │                  │                 │ located on the    │
155       │                                     │                  │                 │ same disk as the  │
156       │                                     │                  │                 │ root partition is │
157       │                                     │                  │                 │ mounted to /boot/ │
158       │                                     │                  │                 │ or /efi/, see     │
159       │                                     │                  │                 │ below.            │
160       ├─────────────────────────────────────┼──────────────────┼─────────────────┼───────────────────┤
161SD_GPT_XBOOTLDR                      │ Extended Boot    │ /boot/          │ The first         │
162bc13c2ff-59e6-4262-a352-b275fd6f7172 │ Loader Partition │                 │ partition with    │
163       │                                     │                  │                 │ this type UUID    │
164       │                                     │                  │                 │ located on the    │
165       │                                     │                  │                 │ same disk as the  │
166       │                                     │                  │                 │ root partition is │
167       │                                     │                  │                 │ mounted to        │
168       │                                     │                  │                 │ /boot/, see       │
169       │                                     │                  │                 │ below.            │
170       └─────────────────────────────────────┴──────────────────┴─────────────────┴───────────────────┘
171
172       This generator understands the following attribute flags for
173       partitions:
174
175       Table 2. Partition Attribute Flags
176       ┌─────────────────────────────────┬───────────────────┬───────────────────┐
177Flag                             Applicable to     Explanation       
178       ├─────────────────────────────────┼───────────────────┼───────────────────┤
179SD_GPT_FLAG_READ_ONLY            │ /, /home/, /srv/, │ Partition is      │
1800x1000000000000000               │ /var/, /var/tmp/, │ mounted read-only │
181       │                                 │ Extended Boot     │                   │
182       │                                 │ Loader Partition  │                   │
183       ├─────────────────────────────────┼───────────────────┼───────────────────┤
184SD_GPT_FLAG_NO_AUTO              │ /, /home/, /srv/, │ Partition is not  │
1850x8000000000000000               │ /var/, /var/tmp/, │ mounted           │
186       │                                 │ Extended Boot     │ automatically     │
187       │                                 │ Loader Partition  │                   │
188       ├─────────────────────────────────┼───────────────────┼───────────────────┤
189SD_GPT_FLAG_NO_BLOCK_IO_PROTOCOL │ EFI System        │ Partition is not  │
1900x0000000000000002               │ Partition (ESP)   │ mounted           │
191       │                                 │                   │ automatically     │
192       └─────────────────────────────────┴───────────────────┴───────────────────┘
193
194       The /home/, /srv/, /var/ and /var/tmp/ partitions may be encrypted in
195       LUKS format. In this case, a device mapper device is set up under the
196       names /dev/mapper/home, /dev/mapper/srv, /dev/mapper/var and
197       /dev/mapper/tmp. Note that this might create conflicts if the same
198       partition is listed in /etc/crypttab with a different device mapper
199       device name.
200
201       When systemd is running in the initrd the / partition may be encrypted
202       in LUKS format as well. In this case, a device mapper device is set up
203       under the name /dev/mapper/root, and a sysroot.mount is set up that
204       mounts the device under /sysroot. For more information, see bootup(7).
205
206       The root partition can be specified by symlinking
207       /run/systemd/volatile-root to /dev/block/$major:$minor. This is
208       especially useful if the root mount has been replaced by some form of
209       volatile file system (overlayfs).
210
211       Mount and automount units for the EFI System Partition (ESP) are
212       generated on EFI systems. The ESP is mounted to /boot/ (except if an
213       Extended Boot Loader partition exists, see below), unless a mount point
214       directory /efi/ exists, in which case it is mounted there. Since this
215       generator creates an automount unit, the mount will only be activated
216       on-demand, when accessed. On systems where /boot/ (or /efi/ if it
217       exists) is an explicitly configured mount (for example, listed in
218       fstab(5)) or where the /boot/ (or /efi/) mount point is non-empty, no
219       mount units are generated.
220
221       If the disk contains an Extended Boot Loader partition, as defined in
222       the Boot Loader Specification[4], it is made available at /boot/ (by
223       means of an automount point, similar to the ESP, see above). If both an
224       EFI System Partition and an Extended Boot Loader partition exist the
225       latter is preferably mounted to /boot/. Make sure to create both /efi/
226       and /boot/ to ensure both partitions are mounted.
227
228       When using this generator in conjunction with btrfs file systems, make
229       sure to set the correct default subvolumes on them, using btrfs
230       subvolume set-default.
231
232       If the system was booted via systemd-stub(7) and the stub reported to
233       userspace that the kernel image was measured to a TPM2 PCR, then any
234       discovered root and /var/ volume identifiers (and volume encryption key
235       in case it is encrypted) will be automatically measured into PCR 15 on
236       activation, via systemd-pcrfs@.service(8).
237
238       systemd-gpt-auto-generator implements systemd.generator(7).
239

KERNEL COMMAND LINE

241       systemd-gpt-auto-generator understands the following kernel command
242       line parameters:
243
244       systemd.gpt_auto, rd.systemd.gpt_auto
245           Those options take an optional boolean argument, and default to
246           yes. The generator is enabled by default, and a false value may be
247           used to disable it (e.g.  "systemd.gpt_auto=0").
248
249       root=, rootfstype=, rootflags=
250           When root= is used with the special value "gpt-auto" (or if the
251           parameter is not used at all), automatic discovery of the root
252           partition based on the GPT partition type is enabled. Any other
253           value disables this logic.
254
255           The rootfstype= and rootflags= are used to select the file system
256           type and options when the root file system is automatically
257           discovered.
258
259       rw, ro
260           Mount the root partition read-write or read-only initially.
261
262           Note that unlike most kernel command line options these settings do
263           not override configuration in the file system, and the file system
264           may be remounted later. See systemd-remount-fs.service(8).
265

SEE ALSO

267       systemd(1), systemd.mount(5), systemd.swap(5), systemd-fstab-
268       generator(8), systemd-cryptsetup@.service(8), systemd-
269       pcrfs@.service(8), machine-id(5), cryptsetup(8), fstab(5), btrfs(8)
270

NOTES

272        1. UEFI Specification
273           https://uefi.org/specifications
274
275        2. Discoverable Partitions Specification
276           https://uapi-group.org/specifications/specs/discoverable_partitions_specification
277
278        3. Boot Loader Interface
279           https://systemd.io/BOOT_LOADER_INTERFACE
280
281        4. Boot Loader Specification
282           https://uapi-group.org/specifications/specs/boot_loader_specification
283
284
285
286systemd 253                                      SYSTEMD-GPT-AUTO-GENERATOR(8)
Impressum