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 the root partition, /home/, /srv/, /var/, /var/tmp/, the EFI
17       System Partition, the Extended Boot Loader Partition, and swap
18       partitions and creates mount and swap units for them, based on the
19       partition type GUIDs of GUID partition tables (GPT). See UEFI
20       Specification[1], chapter 5 for more details. It implements the
21       Discoverable Partitions Specification[2].
22
23       Note that this generator has no effect on non-GPT systems. It will also
24       not create mount point configuration for directories which already
25       contain files or if the mount point is explicitly configured in
26       fstab(5). If the units this generator creates are overridden, for
27       example by units in directories with higher precedence, drop-ins and
28       additional dependencies created by this generator might still be used.
29
30       This generator will only look for the root partition on the same
31       physical disk where the EFI System Partition (ESP) is located. Note
32       that support from the boot loader is required: the EFI variable
33       LoaderDevicePartUUID of the 4a67b082-0a4c-41cf-b6c7-440b29bb8c4f vendor
34       UUID is used to determine from which partition, and hence the disk,
35       from which the system was booted. If the boot loader does not set this
36       variable, this generator will not be able to detect the root partition.
37       See the Boot Loader Interface[3] for details.
38
39       Similarly, this generator will only look for the other partitions on
40       the same physical disk as the root partition. In this case, boot loader
41       support is not required. These partitions will not be searched for on
42       systems where the root file system is distributed on multiple disks,
43       for example via btrfs RAID.
44
45       systemd-gpt-auto-generator is useful for centralizing file system
46       configuration in the partition table and making configuration in
47       /etc/fstab or on the kernel command line unnecessary.
48
49       This generator looks for the partitions based on their partition type
50       GUID. The following partition type GUIDs are identified:
51
52       Table 1. Partition Type GUIDs
53       ┌─────────────────────────────────────┬──────────────────┬─────────────────┬───────────────────┐
54Partition Type                       Name             Mount Point     Explanation       
55GUID                                 │                  │                 │                   │
56       ├─────────────────────────────────────┼──────────────────┼─────────────────┼───────────────────┤
57SD_GPT_ROOT_X86_64                   │ Root Partition   │ /               │ The first         │
584f68bce3-e8cd-4db1-96e7-fbcaf984b709 │ (x86-64)         │                 │ partition with    │
59       │                                     │                  │                 │ this type UUID,   │
60       │                                     │                  │                 │ located on the    │
61       │                                     │                  │                 │ same disk as the  │
62       │                                     │                  │                 │ ESP, is used as   │
63       │                                     │                  │                 │ the root file     │
64       │                                     │                  │                 │ system / on       │
65       │                                     │                  │                 │ AMD64 / 64-bit    │
66       │                                     │                  │                 │ x86 systems.      │
67       ├─────────────────────────────────────┼──────────────────┼─────────────────┼───────────────────┤
68SD_GPT_ROOT_ARM64                    │ Root Partition   │ /               │ The first         │
69b921b045-1df0-41c3-af44-4c6f280d3fae │ (64-bit ARM)     │                 │ partition with    │
70       │                                     │                  │                 │ this type UUID,   │
71       │                                     │                  │                 │ located on the    │
72       │                                     │                  │                 │ same disk as the  │
73       │                                     │                  │                 │ ESP, is used as   │
74       │                                     │                  │                 │ the root file     │
75       │                                     │                  │                 │ system / on       │
76       │                                     │                  │                 │ AArch64 / 64-bit  │
77       │                                     │                  │                 │ ARM systems.      │
78       ├─────────────────────────────────────┼──────────────────┼─────────────────┼───────────────────┤
79SD_GPT_ROOT_ALPHA SD_GPT_ROOT_ARC    │ root partitions  │ /               │ The first         │
80SD_GPT_ROOT_ARM SD_GPT_ROOT_ARM64    │ for other        │                 │ partition with    │
81SD_GPT_ROOT_IA64                     │ architectures    │                 │ the type UUID     │
82SD_GPT_ROOT_LOONGARCH64              │                  │                 │ matching the      │
83SD_GPT_ROOT_MIPS SD_GPT_ROOT_MIPS64  │                  │                 │ architecture,     │
84SD_GPT_ROOT_MIPS_LE                  │                  │                 │ located on the    │
85SD_GPT_ROOT_MIPS64_LE                │                  │                 │ same disk as the  │
86SD_GPT_ROOT_PARISC SD_GPT_ROOT_PPC   │                  │                 │ ESP, is used as   │
87SD_GPT_ROOT_PPC64                    │                  │                 │ the root file     │
88SD_GPT_ROOT_PPC64_LE                 │                  │                 │ system /. For     │
89SD_GPT_ROOT_RISCV32                  │                  │                 │ the full list     │
90SD_GPT_ROOT_RISCV64 SD_GPT_ROOT_S390 │                  │                 │ and constant      │
91SD_GPT_ROOT_S390X SD_GPT_ROOT_TILEGX │                  │                 │ values, see       │
92SD_GPT_ROOT_X86 SD_GPT_ROOT_X86_64   │                  │                 │ Discoverable      
93SD_GPT_USR_ALPHA SD_GPT_USR_ARC      │                  │                 │ Partitions        │
94SD_GPT_USR_ARM SD_GPT_USR_IA64       │                  │                 │ Specification[2]. │
95SD_GPT_USR_LOONGARCH64               │                  │                 │                   │
96SD_GPT_USR_MIPS_LE                   │                  │                 │                   │
97SD_GPT_USR_MIPS64_LE                 │                  │                 │                   │
98SD_GPT_USR_PARISC SD_GPT_USR_PPC     │                  │                 │                   │
99SD_GPT_USR_PPC64 SD_GPT_USR_PPC64_LE │                  │                 │                   │
100SD_GPT_USR_RISCV32                   │                  │                 │                   │
101SD_GPT_USR_RISCV64 SD_GPT_USR_S390   │                  │                 │                   │
102SD_GPT_USR_S390X SD_GPT_USR_TILEGX   │                  │                 │                   │
103SD_GPT_USR_X86                       │                  │                 │                   │
104       ├─────────────────────────────────────┼──────────────────┼─────────────────┼───────────────────┤
105SD_GPT_HOME                          │ Home Partition   │ /home/          │ The first         │
106933ac7e1-2eb4-4f13-b844-0e14e2aef915 │                  │                 │ partition with    │
107       │                                     │                  │                 │ this type UUID on │
108       │                                     │                  │                 │ the same disk as  │
109       │                                     │                  │                 │ the ESP is        │
110       │                                     │                  │                 │ mounted to        │
111       │                                     │                  │                 │ /home/.           │
112       ├─────────────────────────────────────┼──────────────────┼─────────────────┼───────────────────┤
113SD_GPT_SRV                           │ Server Data      │ /srv/           │ The first         │
1143b8f8425-20e0-4f3b-907f-1a25a76f98e8 │ Partition        │                 │ partition with    │
115       │                                     │                  │                 │ this type UUID on │
116       │                                     │                  │                 │ the same disk as  │
117       │                                     │                  │                 │ the ESP is        │
118       │                                     │                  │                 │ mounted to /srv/. │
119       ├─────────────────────────────────────┼──────────────────┼─────────────────┼───────────────────┤
120SD_GPT_VAR                           │ Variable Data    │ /var/           │ The first         │
1214d21b016-b534-45c2-a9fb-5c16e091fd2d │ Partition        │                 │ partition with    │
122       │                                     │                  │                 │ this type UUID on │
123       │                                     │                  │                 │ the same disk as  │
124       │                                     │                  │                 │ the ESP is        │
125       │                                     │                  │                 │ mounted to /var/  │
126       │                                     │                  │                 │ — under the       │
127       │                                     │                  │                 │ condition its     │
128       │                                     │                  │                 │ partition UUID    │
129       │                                     │                  │                 │ matches the first │
130       │                                     │                  │                 │ 128 bit of the    │
131       │                                     │                  │                 │ HMAC-SHA256 of    │
132       │                                     │                  │                 │ the GPT type uuid │
133       │                                     │                  │                 │ of this partition │
134       │                                     │                  │                 │ keyed by the      │
135       │                                     │                  │                 │ machine ID of the │
136       │                                     │                  │                 │ installation      │
137       │                                     │                  │                 │ stored in         │
138       │                                     │                  │                 │ machine-id(5).    │
139       ├─────────────────────────────────────┼──────────────────┼─────────────────┼───────────────────┤
140SD_GPT_TMP                           │ Temporary Data   │ /var/tmp/       │ The first         │
1417ec6f557-3bc5-4aca-b293-16ef5df639d1 │ Partition        │                 │ partition with    │
142       │                                     │                  │                 │ this type UUID on │
143       │                                     │                  │                 │ the same disk as  │
144       │                                     │                  │                 │ the ESP is        │
145       │                                     │                  │                 │ mounted to        │
146       │                                     │                  │                 │ /var/tmp/.        │
147       ├─────────────────────────────────────┼──────────────────┼─────────────────┼───────────────────┤
148SD_GPT_SWAP                          │ Swap             │ n/a             │ All partitions    │
1490657fd6d-a4ab-43c4-84e5-0933c84b4f4f │                  │                 │ with this type    │
150       │                                     │                  │                 │ UUID on the same  │
151       │                                     │                  │                 │ disk as the ESP   │
152       │                                     │                  │                 │ are used as swap. │
153       ├─────────────────────────────────────┼──────────────────┼─────────────────┼───────────────────┤
154SD_GPT_ESP                           │ EFI System       │ /efi/ or /boot/ │ The first         │
155c12a7328-f81f-11d2-ba4b-00a0c93ec93b │ Partition (ESP)  │                 │ partition with    │
156       │                                     │                  │                 │ this type UUID    │
157       │                                     │                  │                 │ located on the    │
158       │                                     │                  │                 │ same disk as the  │
159       │                                     │                  │                 │ root partition is │
160       │                                     │                  │                 │ mounted to /boot/ │
161       │                                     │                  │                 │ or /efi/, see     │
162       │                                     │                  │                 │ below.            │
163       ├─────────────────────────────────────┼──────────────────┼─────────────────┼───────────────────┤
164SD_GPT_XBOOTLDR                      │ Extended Boot    │ /boot/          │ The first         │
165bc13c2ff-59e6-4262-a352-b275fd6f7172 │ Loader Partition │                 │ partition with    │
166       │                                     │                  │                 │ this type UUID    │
167       │                                     │                  │                 │ located on the    │
168       │                                     │                  │                 │ same disk as the  │
169       │                                     │                  │                 │ root partition is │
170       │                                     │                  │                 │ mounted to        │
171       │                                     │                  │                 │ /boot/, see       │
172       │                                     │                  │                 │ below.            │
173       └─────────────────────────────────────┴──────────────────┴─────────────────┴───────────────────┘
174
175       This generator understands the following attribute flags for
176       partitions:
177
178       Table 2. Partition Attribute Flags
179       ┌─────────────────────────────────┬───────────────────┬───────────────────┐
180Flag                             Applicable to     Explanation       
181       ├─────────────────────────────────┼───────────────────┼───────────────────┤
182SD_GPT_FLAG_READ_ONLY            │ /, /home/, /srv/, │ Partition is      │
1830x1000000000000000               │ /var/, /var/tmp/, │ mounted read-only │
184       │                                 │ Extended Boot     │                   │
185       │                                 │ Loader Partition  │                   │
186       ├─────────────────────────────────┼───────────────────┼───────────────────┤
187SD_GPT_FLAG_NO_AUTO              │ /, /home/, /srv/, │ Partition is not  │
1880x8000000000000000               │ /var/, /var/tmp/, │ mounted           │
189       │                                 │ Extended Boot     │ automatically     │
190       │                                 │ Loader Partition  │                   │
191       ├─────────────────────────────────┼───────────────────┼───────────────────┤
192SD_GPT_FLAG_NO_BLOCK_IO_PROTOCOL │ EFI System        │ Partition is not  │
1930x0000000000000002               │ Partition (ESP)   │ mounted           │
194       │                                 │                   │ automatically     │
195       └─────────────────────────────────┴───────────────────┴───────────────────┘
196
197       The /home/, /srv/, /var/, /var/tmp/ and swap partitions may be
198       encrypted in LUKS format. In this case, a device mapper device is set
199       up under the names /dev/mapper/home, /dev/mapper/srv, /dev/mapper/var,
200       /dev/mapper/tmp or /dev/mapper/swap. Note that this might create
201       conflicts if the same partition is listed in /etc/crypttab with a
202       different device mapper device name.
203
204       When systemd is running in the initrd the / partition may be encrypted
205       with LUKS as well. In this case, a device mapper device is set up under
206       the name /dev/mapper/root, and a sysroot.mount is set up that mounts
207       the device under /sysroot. For more information, see bootup(7).
208
209       The root partition can be specified by symlinking
210       /run/systemd/volatile-root to /dev/block/$major:$minor. This is
211       especially useful if the root mount has been replaced by some form of
212       volatile file system (overlayfs).
213
214       Mount and automount units for the EFI System Partition (ESP) and
215       Extended Boot Loader Partition (XBOOTLDR) are generated on EFI systems.
216       If the disk contains an XBOOTLDR partition, as defined in the Boot
217       Loader Specification[4], it is made available at /boot/. This generator
218       creates an automount unit; the mount will only be activated on-demand
219       when accessed. The mount point will be created if necessary.
220
221       The ESP is mounted to /boot/ if that directory exists and is not used
222       for XBOOTLDR, and otherwise to /efi/. Same as for /boot/, an automount
223       unit is used. The mount point will be created if necessary.
224
225       No configuration is created for mount points that are configured in
226       fstab(5) or when the target directory contains files.
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       systemd.image_policy=, rd.systemd.image_policy=
250           Takes an image dissection policy string as argument (as per
251           systemd.image-policy(7)), and allows enforcing a policy on
252           dissection and use of the automatically discovered GPT partition
253           table entries.
254
255       root=, rootfstype=, rootflags=
256           When root= is used with the special value "gpt-auto" (or if the
257           parameter is not used at all), automatic discovery of the root
258           partition based on the GPT partition type is enabled. Any other
259           value disables this logic.
260
261           The rootfstype= and rootflags= are used to select the file system
262           type and options when the root file system is automatically
263           discovered.
264
265       rw, ro
266           Mount the root partition read-write or read-only initially.
267
268           Note that unlike most kernel command line options these settings do
269           not override configuration in the file system, and the file system
270           may be remounted later. See systemd-remount-fs.service(8).
271
272       systemd.swap=
273           Takes a boolean argument or enables the option if specified without
274           an argument. If disabled, automatic discovery of swap partition(s)
275           based on GPT partition type is disabled. Defaults to enabled.
276

SEE ALSO

278       systemd(1), systemd.mount(5), systemd.swap(5), systemd-fstab-
279       generator(8), systemd-cryptsetup@.service(8), systemd-
280       pcrfs@.service(8), machine-id(5), cryptsetup(8), fstab(5), btrfs(8)
281

NOTES

283        1. UEFI Specification
284           https://uefi.org/specifications
285
286        2. Discoverable Partitions Specification
287           https://uapi-group.org/specifications/specs/discoverable_partitions_specification
288
289        3. Boot Loader Interface
290           https://systemd.io/BOOT_LOADER_INTERFACE
291
292        4. Boot Loader Specification
293           https://uapi-group.org/specifications/specs/boot_loader_specification
294
295
296
297systemd 254                                      SYSTEMD-GPT-AUTO-GENERATOR(8)
Impressum