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 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       ┌─────────────────────────────────────┬──────────────────┬─────────────────┬──────────────────┐
51Partition Type                       Name             Mount Point     Explanation      
52GUID                                 │                  │                 │                  │
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       │933ac7e1-2eb4-4f13-b844-0e14e2aef915 │ Home Partition   │ /home/          │ The first home   │
107       │                                     │                  │                 │ partition on the │
108       │                                     │                  │                 │ disk the root    │
109       │                                     │                  │                 │ partition is     │
110       │                                     │                  │                 │ located on is    │
111       │                                     │                  │                 │ mounted to       │
112       │                                     │                  │                 │ /home/.          │
113       ├─────────────────────────────────────┼──────────────────┼─────────────────┼──────────────────┤
114       │3b8f8425-20e0-4f3b-907f-1a25a76f98e8 │ Server Data      │ /srv/           │ The first server │
115       │                                     │ Partition        │                 │ data partition   │
116       │                                     │                  │                 │ on the disk the  │
117       │                                     │                  │                 │ root partition   │
118       │                                     │                  │                 │ is located on is │
119       │                                     │                  │                 │ mounted to       │
120       │                                     │                  │                 │ /srv/.           │
121       ├─────────────────────────────────────┼──────────────────┼─────────────────┼──────────────────┤
122       │4d21b016-b534-45c2-a9fb-5c16e091fd2d │ Variable Data    │ /var/           │ The first        │
123       │                                     │ Partition        │                 │ variable data    │
124       │                                     │                  │                 │ partition on the │
125       │                                     │                  │                 │ disk the root    │
126       │                                     │                  │                 │ partition is     │
127       │                                     │                  │                 │ located on is    │
128       │                                     │                  │                 │ mounted to /var/ │
129       │                                     │                  │                 │ — under the      │
130       │                                     │                  │                 │ condition its    │
131       │                                     │                  │                 │ partition UUID   │
132       │                                     │                  │                 │ matches the      │
133       │                                     │                  │                 │ first 128 bit of │
134       │                                     │                  │                 │ the HMAC-SHA256  │
135       │                                     │                  │                 │ of the GPT type  │
136       │                                     │                  │                 │ uuid of this     │
137       │                                     │                  │                 │ partition keyed  │
138       │                                     │                  │                 │ by the machine   │
139       │                                     │                  │                 │ ID of the        │
140       │                                     │                  │                 │ installation     │
141       │                                     │                  │                 │ stored in        │
142       │                                     │                  │                 │ machine-id(5).   │
143       ├─────────────────────────────────────┼──────────────────┼─────────────────┼──────────────────┤
144       │7ec6f557-3bc5-4aca-b293-16ef5df639d1 │ Temporary Data   │ /var/tmp/       │ The first        │
145       │                                     │ Partition        │                 │ temporary data   │
146       │                                     │                  │                 │ partition on the │
147       │                                     │                  │                 │ disk the root    │
148       │                                     │                  │                 │ partition is     │
149       │                                     │                  │                 │ located on is    │
150       │                                     │                  │                 │ mounted to       │
151       │                                     │                  │                 │ /var/tmp/.       │
152       ├─────────────────────────────────────┼──────────────────┼─────────────────┼──────────────────┤
153       │0657fd6d-a4ab-43c4-84e5-0933c84b4f4f │ Swap             │ n/a             │ All swap         │
154       │                                     │                  │                 │ partitions       │
155       │                                     │                  │                 │ located on the   │
156       │                                     │                  │                 │ disk the root    │
157       │                                     │                  │                 │ partition is     │
158       │                                     │                  │                 │ located on are   │
159       │                                     │                  │                 │ enabled.         │
160       ├─────────────────────────────────────┼──────────────────┼─────────────────┼──────────────────┤
161       │c12a7328-f81f-11d2-ba4b-00a0c93ec93b │ EFI System       │ /efi/ or /boot/ │ The first ESP    │
162       │                                     │ Partition (ESP)  │                 │ located on the   │
163       │                                     │                  │                 │ disk the root    │
164       │                                     │                  │                 │ partition is     │
165       │                                     │                  │                 │ located on is    │
166       │                                     │                  │                 │ mounted to       │
167       │                                     │                  │                 │ /boot/ or /efi/, │
168       │                                     │                  │                 │ see below.       │
169       ├─────────────────────────────────────┼──────────────────┼─────────────────┼──────────────────┤
170       │bc13c2ff-59e6-4262-a352-b275fd6f7172 │ Extended Boot    │ /boot/          │ The first        │
171       │                                     │ Loader Partition │                 │ Extended Boot    │
172       │                                     │                  │                 │ Loader Partition │
173       │                                     │                  │                 │ is mounted to    │
174       │                                     │                  │                 │ /boot/, see      │
175       │                                     │                  │                 │ below.           │
176       └─────────────────────────────────────┴──────────────────┴─────────────────┴──────────────────┘
177
178       This generator understands the following attribute flags for
179       partitions:
180
181       Table 2. Partition Attributes
182       ┌──────────────────────────────┬────────────────────┬──────────────────┬──────────────────┐
183Name                          Value              Applicable to    Explanation      
184       ├──────────────────────────────┼────────────────────┼──────────────────┼──────────────────┤
185GPT_FLAG_READ_ONLY            │ 0x1000000000000000 │ /, /home/,       │ Partition is     │
186       │                              │                    │ /srv/, /var/,    │ mounted          │
187       │                              │                    │ /var/tmp/,       │ read-only        │
188       │                              │                    │ Extended Boot    │                  │
189       │                              │                    │ Loader Partition │                  │
190       ├──────────────────────────────┼────────────────────┼──────────────────┼──────────────────┤
191GPT_FLAG_NO_AUTO              │ 0x8000000000000000 │ /, /home/,       │ Partition is not │
192       │                              │                    │ /srv/, /var/,    │ mounted          │
193       │                              │                    │ /var/tmp/,       │ automatically    │
194       │                              │                    │ Extended Boot    │                  │
195       │                              │                    │ Loader Partition │                  │
196       ├──────────────────────────────┼────────────────────┼──────────────────┼──────────────────┤
197GPT_FLAG_NO_BLOCK_IO_PROTOCOL │ 0x0000000000000002 │ EFI System       │ Partition is not │
198       │                              │                    │ Partition (ESP)  │ mounted          │
199       │                              │                    │                  │ automatically    │
200       └──────────────────────────────┴────────────────────┴──────────────────┴──────────────────┘
201
202       The /home/, /srv/, /var/ and /var/tmp/ partitions may be encrypted in
203       LUKS format. In this case, a device mapper device is set up under the
204       names /dev/mapper/home, /dev/mapper/srv, /dev/mapper/var and
205       /dev/mapper/tmp. Note that this might create conflicts if the same
206       partition is listed in /etc/crypttab with a different device mapper
207       device name.
208
209       When systemd is running in the initrd the / partition may be encrypted
210       in LUKS format as well. In this case, a device mapper device is set up
211       under the name /dev/mapper/root, and a sysroot.mount is set up that
212       mounts the device under /sysroot. For more information, see bootup(7).
213
214       Mount and automount units for the EFI System Partition (ESP) are
215       generated on EFI systems. The ESP is mounted to /boot/ (except if an
216       Extended Boot Loader partition exists, see below), unless a mount point
217       directory /efi/ exists, in which case it is mounted there. Since this
218       generator creates an automount unit, the mount will only be activated
219       on-demand, when accessed. On systems where /boot/ (or /efi/ if it
220       exists) is an explicitly configured mount (for example, listed in
221       fstab(5)) or where the /boot/ (or /efi/) mount point is non-empty, no
222       mount units are generated.
223
224       If the disk contains an Extended Boot Loader partition, as defined in
225       the Boot Loader Specification[4], it is made available at /boot/ (by
226       means of an automount point, similar to the ESP, see above). If both an
227       EFI System Partition and an Extended Boot Loader partition exist the
228       latter is preferably mounted to /boot/. Make sure to create both /efi/
229       and /boot/ to ensure both partitions are mounted.
230
231       When using this generator in conjunction with btrfs file systems, make
232       sure to set the correct default subvolumes on them, using btrfs
233       subvolume set-default.
234
235       systemd-gpt-auto-generator implements systemd.generator(7).
236

KERNEL COMMAND LINE

238       systemd-gpt-auto-generator understands the following kernel command
239       line parameters:
240
241       systemd.gpt_auto, rd.systemd.gpt_auto
242           Those options take an optional boolean argument, and default to
243           yes. The generator is enabled by default, and a negative value may
244           be used to disable it.
245
246       root=
247           When used with the special value "gpt-auto", automatic discovery of
248           the root partition based on the GPT partition type is enabled. Any
249           other value disables this generator.
250
251       rw, ro
252           Mount the root partition read-write or read-only initially.
253
254           Note that unlike most kernel command line options these settings do
255           not override configuration in the file system, and the file system
256           may be remounted later. See systemd-remount-fs.service(8).
257

SEE ALSO

259       systemd(1), systemd.mount(5), systemd.swap(5), systemd-fstab-
260       generator(8), systemd-cryptsetup@.service(8), machine-id(5),
261       cryptsetup(8), fstab(5), btrfs(8)
262

NOTES

264        1. UEFI Specification
265           https://uefi.org/specifications
266
267        2. Discoverable Partitions Specification
268           https://systemd.io/DISCOVERABLE_PARTITIONS
269
270        3. Boot Loader Interface
271           https://systemd.io/BOOT_LOADER_INTERFACE
272
273        4. Boot Loader Specification
274           https://systemd.io/BOOT_LOADER_SPECIFICATION
275
276
277
278systemd 246                                      SYSTEMD-GPT-AUTO-GENERATOR(8)
Impressum