Debian Codegraph @

upstream/mageia-cauldron/man5/repart.d.5

raw
1 '\" t
2 .TH "REPART\&.D" "5" "" "systemd 258.7" "repart.d"
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 repart.d \- Partition Definition Files for Automatic Boot\-Time Repartitioning
24 .SH "SYNOPSIS"
25 .PP
26 .RS 4
27 /etc/repart\&.d/*\&.conf
28 .RE
29 .RS 4
30 /run/repart\&.d/*\&.conf
31 .RE
32 .RS 4
33 /usr/local/lib/repart\&.d/*\&.conf
34 .RE
35 .RS 4
36 /usr/lib/repart\&.d/*\&.conf
37 .RE
38 .SH "DESCRIPTION"
39 .PP
40 repart\&.d/*\&.conf
41 files describe basic properties of partitions of block devices of the local system\&. They may be used to declare types, names and sizes of partitions that shall exist\&. The
42 \fBsystemd-repart\fR(8)
43 service reads these files and attempts to add new partitions currently missing and enlarge existing partitions according to these definitions\&. Operation is generally incremental, i\&.e\&. when applied, what exists already is left intact, and partitions are never shrunk, moved or deleted\&.
44 .PP
45 These definition files are useful for implementing operating system images that are prepared and delivered with minimally sized images (for example lacking any state or swap partitions), and which on first boot automatically take possession of any remaining disk space following a few basic rules\&.
46 .PP
47 Currently, support for partition definition files is only implemented for GPT partition tables\&.
48 .PP
49 Partition files are generally matched against any partitions already existing on disk in a simple algorithm: the partition files are sorted by their filename (ignoring the directory prefix), and then compared in order against existing partitions matching the same partition type UUID\&. Specifically, the first existing partition with a specific partition type UUID is assigned the first definition file with the same partition type UUID, and the second existing partition with a specific type UUID the second partition file with the same type UUID, and so on\&. Any left\-over partition files that have no matching existing partition are assumed to define new partition that shall be created\&. Such partitions are appended to the end of the partition table, in the order defined by their names utilizing the first partition slot greater than the highest slot number currently in use\&. Any existing partitions that have no matching partition file are left as they are\&.
50 .PP
51 Note that these definitions may only be used to create and initialize new partitions or to grow existing ones\&. In the latter case, it will not grow the contained files systems however; separate mechanisms, such as
52 \fBsystemd-growfs\fR(8)
53 may be used to grow the file systems inside of these partitions\&. Partitions may also be marked for automatic growing via the
54 \fIGrowFileSystem=\fR
55 setting, in which case the file system is grown on first mount by tools that respect this flag\&. See below for details\&.
56 .SH "[PARTITION] SECTION OPTIONS"
57 .PP
58 \fIType=\fR
59 .RS 4
60 The GPT partition type UUID to match\&. This may be a GPT partition type UUID such as
61 \fB4f68bce3\-e8cd\-4db1\-96e7\-fbcaf984b709\fR, or an identifier\&.
62 .sp
63 The supported identifiers are:
64 .sp
65 .it 1 an-trap
66 .nr an-no-space-flag 1
67 .nr an-break-flag 1
68 .br
69 .B Table\ \&1.\ \&GPT partition type identifiers
70 .TS
71 allbox tab(:);
72 lB lB.
73 T{
74 Identifier
75 T}:T{
76 Explanation
77 T}
78 .T&
79 l l
80 l l
81 l l
82 l l
83 l l
84 l l
85 l l
86 l l
87 l l
88 l l
89 l l
90 l l
91 l l
92 l l
93 l l
94 l l
95 l l
96 l l
97 l l
98 l l
99 l l
100 l l
101 l l
102 l l
103 l l
104 l l.
105 T{
106 \fBesp\fR
107 T}:T{
108 EFI System Partition
109 T}
110 T{
111 \fBxbootldr\fR
112 T}:T{
113 Extended Boot Loader Partition
114 T}
115 T{
116 \fBswap\fR
117 T}:T{
118 Swap partition
119 T}
120 T{
121 \fBhome\fR
122 T}:T{
123 Home (/home/) partition
124 T}
125 T{
126 \fBsrv\fR
127 T}:T{
128 Server data (/srv/) partition
129 T}
130 T{
131 \fBvar\fR
132 T}:T{
133 Variable data (/var/) partition
134 T}
135 T{
136 \fBtmp\fR
137 T}:T{
138 Temporary data (/var/tmp/) partition
139 T}
140 T{
141 \fBlinux\-generic\fR
142 T}:T{
143 Generic Linux file system partition
144 T}
145 T{
146 \fBroot\fR
147 T}:T{
148 Root file system partition type appropriate for the local architecture (an alias for an architecture root file system partition type listed below, e\&.g\&. \fBroot\-x86\-64\fR)
149 T}
150 T{
151 \fBroot\-verity\fR
152 T}:T{
153 Verity data for the root file system partition for the local architecture
154 T}
155 T{
156 \fBroot\-verity\-sig\fR
157 T}:T{
158 Verity signature data for the root file system partition for the local architecture
159 T}
160 T{
161 \fBroot\-secondary\fR
162 T}:T{
163 Root file system partition of the secondary architecture of the local architecture (usually the matching 32\-bit architecture for the local 64\-bit architecture)
164 T}
165 T{
166 \fBroot\-secondary\-verity\fR
167 T}:T{
168 Verity data for the root file system partition of the secondary architecture
169 T}
170 T{
171 \fBroot\-secondary\-verity\-sig\fR
172 T}:T{
173 Verity signature data for the root file system partition of the secondary architecture
174 T}
175 T{
176 \fBroot\-{arch}\fR
177 T}:T{
178 Root file system partition of the given architecture (such as \fBroot\-x86\-64\fR or \fBroot\-riscv64\fR)
179 T}
180 T{
181 \fBroot\-{arch}\-verity\fR
182 T}:T{
183 Verity data for the root file system partition of the given architecture
184 T}
185 T{
186 \fBroot\-{arch}\-verity\-sig\fR
187 T}:T{
188 Verity signature data for the root file system partition of the given architecture
189 T}
190 T{
191 \fBusr\fR
192 T}:T{
193 /usr/ file system partition type appropriate for the local architecture (an alias for an architecture /usr/ file system partition type listed below, e\&.g\&. \fBusr\-x86\-64\fR)
194 T}
195 T{
196 \fBusr\-verity\fR
197 T}:T{
198 Verity data for the /usr/ file system partition for the local architecture
199 T}
200 T{
201 \fBusr\-verity\-sig\fR
202 T}:T{
203 Verity signature data for the /usr/ file system partition for the local architecture
204 T}
205 T{
206 \fBusr\-secondary\fR
207 T}:T{
208 /usr/ file system partition of the secondary architecture of the local architecture (usually the matching 32\-bit architecture for the local 64\-bit architecture)
209 T}
210 T{
211 \fBusr\-secondary\-verity\fR
212 T}:T{
213 Verity data for the /usr/ file system partition of the secondary architecture
214 T}
215 T{
216 \fBusr\-secondary\-verity\-sig\fR
217 T}:T{
218 Verity signature data for the /usr/ file system partition of the secondary architecture
219 T}
220 T{
221 \fBusr\-{arch}\fR
222 T}:T{
223 /usr/ file system partition of the given architecture
224 T}
225 T{
226 \fBusr\-{arch}\-verity\fR
227 T}:T{
228 Verity data for the /usr/ file system partition of the given architecture
229 T}
230 T{
231 \fBusr\-{arch}\-verity\-sig\fR
232 T}:T{
233 Verity signature data for the /usr/ file system partition of the given architecture
234 T}
235 .TE
236 .sp 1
237 Architecture specific partition types can use one of these architecture identifiers:
238 \fBalpha\fR,
239 \fBarc\fR,
240 \fBarm\fR
241 (32\-bit),
242 \fBarm64\fR
243 (64\-bit, aka aarch64),
244 \fBia64\fR,
245 \fBloongarch64\fR,
246 \fBmips\-le\fR,
247 \fBmips64\-le\fR,
248 \fBparisc\fR,
249 \fBppc\fR,
250 \fBppc64\fR,
251 \fBppc64\-le\fR,
252 \fBriscv32\fR,
253 \fBriscv64\fR,
254 \fBs390\fR,
255 \fBs390x\fR,
256 \fBtilegx\fR,
257 \fBx86\fR
258 (32\-bit, aka i386) and
259 \fBx86\-64\fR
260 (64\-bit, aka amd64)\&.
261 .sp
262 Most of the partition type UUIDs listed above are defined in the
263 \m[blue]\fBDiscoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2\&.
264 .sp
265 Added in version 245\&.
266 .RE
267 .PP
268 \fILabel=\fR
269 .RS 4
270 The textual label to assign to the partition if none is assigned yet\&. Note that this setting is not used for matching\&. It is also not used when a label is already set for an existing partition\&. It is thus only used when a partition is newly created or when an existing one had a no label set (that is: an empty label)\&. If not specified, a label derived from the partition type is automatically used\&. Simple specifier expansion is supported, see below\&.
271 .sp
272 Added in version 245\&.
273 .RE
274 .PP
275 \fIUUID=\fR
276 .RS 4
277 The UUID to assign to the partition if none is assigned yet\&. Note that this setting is not used for matching\&. It is also not used when a UUID is already set for an existing partition\&. It is thus only used when a partition is newly created or when an existing one had a all\-zero UUID set\&. If set to
278 "null", the UUID is set to all zeroes\&. If not specified a UUID derived from the partition type is automatically used\&.
279 .sp
280 Added in version 246\&.
281 .RE
282 .PP
283 \fIPriority=\fR
284 .RS 4
285 A numeric priority to assign to this partition, in the range \-2147483648\&...2147483647, with smaller values indicating higher priority, and higher values indicating smaller priority\&. This priority is used in case the configured size constraints on the defined partitions do not permit fitting all partitions onto the available disk space\&. If the partitions do not fit, the highest numeric partition priority of all defined partitions is determined, and all defined partitions with this priority are removed from the list of new partitions to create (which may be multiple, if the same priority is used for multiple partitions)\&. The fitting algorithm is then tried again\&. If the partitions still do not fit, the now highest numeric partition priority is determined, and the matching partitions removed too, and so on\&. Partitions of a priority of 0 or lower are never removed\&. If all partitions with a priority above 0 are removed and the partitions still do not fit on the device the operation fails\&. Note that this priority has no effect on ordering partitions, for that use the alphabetical order of the filenames of the partition definition files\&. Defaults to 0\&.
286 .sp
287 Added in version 245\&.
288 .RE
289 .PP
290 \fIWeight=\fR
291 .RS 4
292 A numeric weight to assign to this partition in the range 0\&...1000000\&. Available disk space is assigned the defined partitions according to their relative weights (subject to the size constraints configured with
293 \fISizeMinBytes=\fR,
294 \fISizeMaxBytes=\fR), so that a partition with weight 2000 gets double the space as one with weight 1000, and a partition with weight 333 a third of that\&. Defaults to 1000\&.
295 .sp
296 The
297 \fIWeight=\fR
298 setting is used to distribute available disk space in an "elastic" fashion, based on the disk size and existing partitions\&. If a partition shall have a fixed size use both
299 \fISizeMinBytes=\fR
300 and
301 \fISizeMaxBytes=\fR
302 with the same value in order to fixate the size to one value, in which case the weight has no effect\&.
303 .sp
304 Added in version 245\&.
305 .RE
306 .PP
307 \fIPaddingWeight=\fR
308 .RS 4
309 Similar to
310 \fIWeight=\fR, but sets a weight for the free space after the partition (the "padding")\&. When distributing available space the weights of all partitions and all defined padding is summed, and then each partition and padding gets the fraction defined by its weight\&. Defaults to 0, i\&.e\&. by default no padding is applied\&.
311 .sp
312 Padding is useful if empty space shall be left for later additions or a safety margin at the end of the device or between partitions\&.
313 .sp
314 Added in version 245\&.
315 .RE
316 .PP
317 \fISizeMinBytes=\fR, \fISizeMaxBytes=\fR
318 .RS 4
319 Specifies minimum and maximum size constraints in bytes\&. Takes the usual K, M, G, T, \&... suffixes (to the base of 1024)\&. If
320 \fISizeMinBytes=\fR
321 is specified the partition is created at or grown to at least the specified size\&. If
322 \fISizeMaxBytes=\fR
323 is specified the partition is created at or grown to at most the specified size\&. The precise size is determined through the weight value configured with
324 \fIWeight=\fR, see above\&. When
325 \fISizeMinBytes=\fR
326 is set equal to
327 \fISizeMaxBytes=\fR
328 the configured weight has no effect as the partition is explicitly sized to the specified fixed value\&. Note that partitions are never created smaller than 4096 bytes, and since partitions are never shrunk the previous size of the partition (in case the partition already exists) is also enforced as lower bound for the new size\&. The values should be specified as multiples of 4096 bytes, and are rounded upwards (in case of
329 \fISizeMinBytes=\fR) or downwards (in case of
330 \fISizeMaxBytes=\fR) otherwise\&. If the backing device does not provide enough space to fulfill the constraints placing the partition will fail\&. For partitions that shall be created, depending on the setting of
331 \fIPriority=\fR
332 (see above) the partition might be dropped and the placing algorithm restarted\&. By default, a minimum size constraint of 10M and no maximum size constraint is set\&.
333 .sp
334 If
335 \fIFormat=\fR
336 is set, the minimum size is automatically raised to the minimum file system size for the selected file system type, if known\&. Moreover, for the ESP/XBOOTLDR partitions the minimum is raised to 100M (for 512b sector images) or 260M (for 4K sector images) automatically, if specified smaller\&.
337 .sp
338 Added in version 245\&.
339 .RE
340 .PP
341 \fIPaddingMinBytes=\fR, \fIPaddingMaxBytes=\fR
342 .RS 4
343 Specifies minimum and maximum size constraints in bytes for the free space after the partition (the "padding")\&. Semantics are similar to
344 \fISizeMinBytes=\fR
345 and
346 \fISizeMaxBytes=\fR, except that unlike partition sizes free space can be shrunk and can be as small as zero\&. By default, no size constraints on padding are set, so that only
347 \fIPaddingWeight=\fR
348 determines the size of the padding applied\&.
349 .sp
350 Added in version 245\&.
351 .RE
352 .PP
353 \fICopyBlocks=\fR
354 .RS 4
355 Takes a path to a regular file, block device node, char device node or directory, or the special value
356 "auto"\&. If specified and the partition is newly created, the data from the specified path is written to the newly created partition, on the block level\&. If a directory is specified, the backing block device of the file system the directory is on is determined, and the data read directly from that\&. This option is useful to efficiently replicate existing file systems onto new partitions on the block level \(em for example to build a simple OS installer or an OS image builder\&. Specify
357 /dev/urandom
358 as value to initialize a partition with random data\&.
359 .sp
360 If the special value
361 "auto"
362 is specified, the source to copy from is automatically picked up from the running system (or the image specified with
363 \fB\-\-image=\fR
364 \(em if used)\&. A partition that matches both the configured partition type (as declared with
365 \fIType=\fR
366 described above), and the currently mounted directory appropriate for that partition type is determined\&. For example, if the partition type is set to
367 "root"
368 the partition backing the root directory (/) is used as source to copy from \(em if its partition type is set to
369 "root"
370 as well\&. If the declared type is
371 "usr"
372 the partition backing
373 /usr/
374 is used as source to copy blocks from \(em if its partition type is set to
375 "usr"
376 too\&. The logic is capable of automatically tracking down the backing partitions for encrypted and Verity\-enabled volumes\&.
377 "CopyBlocks=auto"
378 is useful for implementing "self\-replicating" systems, i\&.e\&. systems that are their own installer\&.
379 .sp
380 The file specified here must have a size that is a multiple of the basic block size 512 and not be empty\&. If this option is used, the size allocation algorithm is slightly altered: the partition is created at least as big as required to fit the data in, i\&.e\&. the data size is an additional minimum size value taken into consideration for the allocation algorithm, similar to and in addition to the
381 \fISizeMin=\fR
382 value configured above\&.
383 .sp
384 This option has no effect if the partition it is declared for already exists, i\&.e\&. existing data is never overwritten\&. Note that the data is copied in before the partition table is updated, i\&.e\&. before the partition actually is persistently created\&. This provides robustness: it is guaranteed that the partition either does not exist or exists fully populated; it is not possible that the partition exists but is not or only partially populated\&.
385 .sp
386 This option cannot be combined with
387 \fIFormat=\fR
388 or
389 \fICopyFiles=\fR\&.
390 .sp
391 Added in version 246\&.
392 .RE
393 .PP
394 \fIFormat=\fR
395 .RS 4
396 Takes a file system name, such as
397 "ext4",
398 "btrfs",
399 "xfs",
400 "vfat",
401 "erofs",
402 "squashfs"
403 or the special value
404 "swap"\&. If specified and the partition is newly created it is formatted with the specified file system (or as swap device)\&. The file system UUID and label are automatically derived from the partition UUID and label\&. If this option is used, the size allocation algorithm is slightly altered: the partition is created at least as big as required for the minimal file system of the specified type (or 4KiB if the minimal size is not known)\&.
405 .sp
406 This also takes a special meta value
407 "empty"\&. If specified this is equivalent to specifying
408 "Label=_empty"
409 and
410 "NoAuto=1"\&.
411 .sp
412 This option has no effect if the partition already exists\&.
413 .sp
414 Similarly to the behaviour of
415 \fICopyBlocks=\fR, the file system is formatted before the partition is created, ensuring that the partition only ever exists with a fully initialized file system\&.
416 .sp
417 This option cannot be combined with
418 \fICopyBlocks=\fR\&.
419 .sp
420 Added in version 247\&.
421 .RE
422 .PP
423 \fICopyFiles=\fR
424 .RS 4
425 Takes a colon\-separated triplet in the form
426 "\fIsource\fR[:\fItarget\fR[:\fIoptions\fR]]"\&.
427 \fIsource\fR
428 is an absolute path which refers to a source file or directory on the host\&.
429 \fItarget\fR
430 is an absolute path in the file system of the newly created partition and formatted file system\&.
431 \fIoptions\fR
432 is a comma\-separated list of options where each option is in the form
433 "\fIkey\fR[=\fIvalue\fR]"\&.
434 .sp
435 This setting may be used to copy files or directories from the host into the file system that is created due to the
436 \fIFormat=\fR
437 option\&. If
438 \fICopyFiles=\fR
439 is used without
440 \fIFormat=\fR
441 specified explicitly,
442 "Format="
443 with a suitable default is implied (currently
444 "vfat"
445 for
446 "ESP"
447 and
448 "XBOOTLDR"
449 partitions, and
450 "ext4"
451 otherwise, but this may change in the future)\&. This option may be used multiple times to copy multiple files or directories from host into the newly formatted file system\&.
452 .sp
453 The
454 \fItarget\fR
455 path may be omitted in which case the
456 \fIsource\fR
457 path is also used as the target path (relative to the root of the newly created file system)\&. If the source path refers to a directory it is copied recursively\&.
458 .sp
459 The
460 \fIoptions\fR
461 may contain the following values:
462 .PP
463 \fIfsverity=\fR
464 .RS 4
465 May be set to the value
466 "off"
467 (the default if the option is not present) or
468 "copy"\&. If set to
469 "off"
470 then no files copied into the filesystem from this source will have fs\-verity enabled\&. If set to
471 "copy"
472 then the fs\-verity information for each file will be copied from the corresponding source file\&.
473 .sp
474 Added in version 258\&.
475 .RE
476 .sp
477 This option has no effect if the partition already exists: it cannot be used to copy additional files into an existing partition, it may only be used to populate a file system created anew\&.
478 .sp
479 The copy operation is executed before the file system is registered in the partition table, thus ensuring that a file system populated this way only ever exists fully initialized\&.
480 .sp
481 Note that
482 \fICopyFiles=\fR
483 will skip copying files that are not supported by the target filesystem (e\&.g symlinks, fifos, sockets and devices on vfat)\&. When an unsupported file type is encountered,
484 \fBsystemd\-repart\fR
485 will skip copying this file and write a log message about it\&.
486 .sp
487 Note that
488 \fBsystemd\-repart\fR
489 does not change the UIDs/GIDs of any copied files and directories\&. When running
490 \fBsystemd\-repart\fR
491 as an unprivileged user to build an image of files and directories owned by the same user, you can run
492 \fBsystemd\-repart\fR
493 in a user namespace with the current user mapped to the root user to make sure the files and directories in the image are owned by the root user\&.
494 .sp
495 Note that when populating XFS filesystems with
496 \fBsystemd\-repart\fR
497 and loop devices are not available, populating XFS filesystems with files containing spaces, tabs or newlines might fail on old versions of
498 \fBmkfs.xfs\fR(8)
499 due to limitations of its protofile format\&.
500 .sp
501 Note that when populating XFS filesystems with
502 \fBsystemd\-repart\fR
503 and loop devices are not available, extended attributes will not be copied into generated XFS filesystems due to limitations
504 \fBmkfs.xfs\fR(8)\*(Aqs protofile format\&.
505 .sp
506 This option cannot be combined with
507 \fICopyBlocks=\fR\&.
508 .sp
509 When
510 \fBsystemd-repart\fR(8)
511 is invoked with the
512 \fB\-\-copy\-source=\fR
513 command line switch the file paths are taken relative to the specified directory\&. If
514 \fB\-\-copy\-source=\fR
515 is not used, but the
516 \fB\-\-image=\fR
517 or
518 \fB\-\-root=\fR
519 switches are used, the source paths are taken relative to the specified root directory or disk image root\&.
520 .sp
521 Added in version 247\&.
522 .RE
523 .PP
524 \fIExcludeFiles=\fR, \fIExcludeFilesTarget=\fR
525 .RS 4
526 Takes one or more absolute paths, separated by whitespace, each referring to a source file or directory on the host\&. This setting may be used to exclude files or directories from the host from being copied into the file system when
527 \fICopyFiles=\fR
528 is used\&. This option may be used multiple times to exclude multiple files or directories from host from being copied into the newly formatted file system\&.
529 .sp
530 If the path is a directory and ends with
531 "/", only the directory\*(Aqs contents are excluded but not the directory itself\&. If the path is a directory and does not end with
532 "/", both the directory and its contents are excluded\&.
533 .sp
534 \fIExcludeFilesTarget=\fR
535 is like
536 \fIExcludeFiles=\fR
537 except that instead of excluding the path on the host from being copied into the partition, it excludes any files and directories from being copied into the given path in the partition\&.
538 .sp
539 When
540 \fBsystemd-repart\fR(8)
541 is invoked with the
542 \fB\-\-image=\fR
543 or
544 \fB\-\-root=\fR
545 command line switches the paths specified are taken relative to the specified root directory or disk image root\&.
546 .sp
547 Added in version 254\&.
548 .RE
549 .PP
550 \fIMakeDirectories=\fR
551 .RS 4
552 Takes one or more absolute paths, separated by whitespace, each declaring a directory to create within the new file system\&. Behaviour is similar to
553 \fICopyFiles=\fR, but instead of copying in a set of files this just creates the specified directories with the default mode of 0755 owned by the root user and group, plus all their parent directories (with the same ownership and access mode)\&. To configure directories with different ownership or access mode, use
554 \fICopyFiles=\fR
555 and specify a source tree to copy containing appropriately owned/configured directories\&. This option may be used more than once to create multiple directories\&. When
556 \fICopyFiles=\fR
557 and
558 \fIMakeDirectories=\fR
559 are used together the former is applied first\&. If a directory listed already exists no operation is executed (in particular, the ownership/access mode of the directories is left as is)\&.
560 .sp
561 The primary use case for this option is to create a minimal set of directories that may be mounted over by other partitions contained in the same disk image\&. For example, a disk image where the root file system is formatted at first boot might want to automatically pre\-create
562 /usr/
563 in it this way, so that the
564 "usr"
565 partition may over\-mount it\&.
566 .sp
567 Consider using
568 \fBsystemd-tmpfiles\fR(8)
569 with its
570 \fB\-\-image=\fR
571 option to pre\-create other, more complex directory hierarchies (as well as other inodes) with fine\-grained control of ownership, access modes and other file attributes\&.
572 .sp
573 Added in version 249\&.
574 .RE
575 .PP
576 \fIMakeSymlinks=\fR
577 .RS 4
578 Takes one or more arguments, separated by whitespace, each declaring a symlink to create within the new file system\&. Each argument is a pair of symlink source and target paths, separated by a colon\&. This option may be used more than once to create multiple symlinks\&. When
579 \fICopyFiles=\fR
580 and
581 \fIMakeSymlinks=\fR
582 are used together the former is applied first\&.
583 .sp
584 The primary use case for this option is to create symlinks that need to exist before
585 \fBsystemd-tmpfiles\fR(8)
586 is executed\&. For example, when using
587 \fBsystemd-confext\fR(8), this setting can be used to create symlinks in
588 /var/lib/extensions\&.mutable
589 to redirect writes to mutable confexts to a custom location\&.
590 .sp
591 Consider using
592 \fBsystemd-tmpfiles\fR(8)
593 with its
594 \fB\-\-image=\fR
595 option to pre\-create other symlinks (as well as other inodes) with fine\-grained control of ownership, access modes and other file attributes\&.
596 .sp
597 Added in version 257\&.
598 .RE
599 .PP
600 \fISubvolumes=\fR
601 .RS 4
602 Takes one or more absolute paths, separated by whitespace, each declaring a directory that should be a subvolume within the new file system\&. Each path may optionally be followed by a colon and a list of comma\-separated subvolume flags\&. The following flags are understood:
603 .sp
604 .it 1 an-trap
605 .nr an-no-space-flag 1
606 .nr an-break-flag 1
607 .br
608 .B Table\ \&2.\ \&Subvolume Flags
609 .TS
610 allbox tab(:);
611 lB lB.
612 T{
613 Flag
614 T}:T{
615 Purpose
616 T}
617 .T&
618 l l.
619 T{
620 "ro"
621 T}:T{
622 Make this subvolume read\-only\&.
623 T}
624 .TE
625 .sp 1
626 Note that this option does not create the directories themselves, that can be configured with
627 \fIMakeDirectories=\fR
628 and
629 \fICopyFiles=\fR\&.
630 .sp
631 Note that this option only takes effect if the target filesystem supports subvolumes, such as
632 \fBbtrfs\fR(8)\&.
633 .sp
634 Note that this option is only supported in combination with
635 \fB\-\-offline=yes\fR
636 since
637 btrfs\-progs
638 6\&.12 or newer\&.
639 .sp
640 Added in version 255\&.
641 .RE
642 .PP
643 \fIDefaultSubvolume=\fR
644 .RS 4
645 Takes an absolute path specifying the default subvolume within the new filesystem\&. Note that this setting does not create the subvolume itself, that can be configured with
646 \fISubvolumes=\fR\&.
647 .sp
648 Note that this option only takes effect if the target filesystem supports subvolumes, such as
649 \fBbtrfs\fR(8)\&.
650 .sp
651 Note that this option is only supported in combination with
652 \fB\-\-offline=yes\fR
653 since
654 btrfs\-progs
655 6\&.12 or newer\&.
656 .sp
657 Added in version 256\&.
658 .RE
659 .PP
660 \fIEncrypt=\fR
661 .RS 4
662 Takes one of
663 "off",
664 "key\-file",
665 "tpm2"
666 and
667 "key\-file+tpm2"
668 (alternatively, also accepts a boolean value, which is mapped to
669 "off"
670 when false, and
671 "key\-file"
672 when true)\&. Defaults to
673 "off"\&. If not
674 "off"
675 the partition will be formatted with a LUKS2 superblock, before the blocks configured with
676 \fICopyBlocks=\fR
677 are copied in or the file system configured with
678 \fIFormat=\fR
679 is created\&.
680 .sp
681 The LUKS2 UUID is automatically derived from the partition UUID in a stable fashion\&. If
682 "key\-file"
683 or
684 "key\-file+tpm2"
685 is used, a key is added to the LUKS2 superblock, configurable with the
686 \fB\-\-key\-file=\fR
687 option to
688 \fBsystemd\-repart\fR\&. If
689 "tpm2"
690 or
691 "key\-file+tpm2"
692 is used, a key is added to the LUKS2 superblock that is enrolled to the local TPM2 chip, as configured with the
693 \fB\-\-tpm2\-device=\fR
694 and
695 \fB\-\-tpm2\-pcrs=\fR
696 options to
697 \fBsystemd\-repart\fR\&.
698 .sp
699 When used this slightly alters the size allocation logic as the implicit, minimal size limits of
700 \fIFormat=\fR
701 and
702 \fICopyBlocks=\fR
703 are increased by the space necessary for the LUKS2 superblock (see above)\&.
704 .sp
705 This option has no effect if the partition already exists\&.
706 .sp
707 Added in version 247\&.
708 .RE
709 .PP
710 \fIVerity=\fR
711 .RS 4
712 Takes one of
713 "off",
714 "data",
715 "hash"
716 or
717 "signature"\&. Defaults to
718 "off"\&. If set to
719 "off"
720 or
721 "data", the partition is populated with content as specified by
722 \fICopyBlocks=\fR
723 or
724 \fICopyFiles=\fR\&. If set to
725 "hash", the partition will be populated with verity hashes from the matching verity data partition\&. If set to
726 "signature", the partition will be populated with a JSON object containing a signature of the verity root hash of the matching verity hash partition\&.
727 .sp
728 A matching verity partition is a partition with the same verity match key (as configured with
729 \fIVerityMatchKey=\fR)\&.
730 .sp
731 If not explicitly configured, the data partition\*(Aqs UUID will be set to the first 128 bits of the verity root hash\&. Similarly, if not configured, the hash partition\*(Aqs UUID will be set to the final 128 bits of the verity root hash\&. The verity root hash itself will be included in the output of
732 \fBsystemd\-repart\fR\&.
733 .sp
734 This option has no effect if the partition already exists\&.
735 .sp
736 Usage of this option in combination with
737 \fIEncrypt=\fR
738 is not supported\&.
739 .sp
740 For each unique
741 \fIVerityMatchKey=\fR
742 value, a single verity data partition ("Verity=data") and a single verity hash partition ("Verity=hash") must be defined\&.
743 .sp
744 Added in version 252\&.
745 .RE
746 .PP
747 \fIVerityMatchKey=\fR
748 .RS 4
749 Takes a short, user\-chosen identifier string\&. This setting is used to find sibling verity partitions for the current verity partition\&. See the description for
750 \fIVerity=\fR\&.
751 .sp
752 Added in version 252\&.
753 .RE
754 .PP
755 \fIVerityDataBlockSizeBytes=\fR
756 .RS 4
757 Configures the data block size of the generated verity hash partition\&. Must be between 512 and 4096 bytes and must be a power of 2\&. Defaults to the sector size if configured explicitly, or the underlying block device sector size, or 4K if
758 \fBsystemd\-repart\fR
759 is not operating on a block device\&.
760 .sp
761 Added in version 255\&.
762 .RE
763 .PP
764 \fIVerityHashBlockSizeBytes=\fR
765 .RS 4
766 Configures the hash block size of the generated verity hash partition\&. Must be between 512 and 4096 bytes and must be a power of 2\&. Defaults to the sector size if configured explicitly, or the underlying block device sector size, or 4K if
767 \fBsystemd\-repart\fR
768 is not operating on a block device\&.
769 .sp
770 Added in version 255\&.
771 .RE
772 .PP
773 \fIFactoryReset=\fR
774 .RS 4
775 Takes a boolean argument\&. If specified the partition is marked for removal during a factory reset operation\&. This functionality is useful to implement schemes where images can be reset into their original state by removing partitions and creating them anew\&. Defaults to off\&.
776 .sp
777 Added in version 245\&.
778 .RE
779 .PP
780 \fIFlags=\fR
781 .RS 4
782 Configures the 64\-bit GPT partition flags field to set for the partition when creating it\&. This option has no effect if the partition already exists\&. If not specified, the flags value is set to all zeroes, except for the three bits that can also be configured via
783 \fINoAuto=\fR,
784 \fIReadOnly=\fR
785 and
786 \fIGrowFileSystem=\fR; see below for details on the defaults for these three flags\&. Specify the flags value in hexadecimal (by prefixing it with
787 "0x"), binary (prefix
788 "0b") or decimal (no prefix)\&.
789 .sp
790 Added in version 249\&.
791 .RE
792 .PP
793 \fINoAuto=\fR, \fIReadOnly=\fR, \fIGrowFileSystem=\fR
794 .RS 4
795 Configures the No\-Auto, Read\-Only and Grow\-File\-System partition flags (bit 63, 60 and 59) of the partition table entry, as defined by the
796 \m[blue]\fBDiscoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2\&. Only available for partition types supported by the specification\&. This option is a friendly way to set bits 63, 60 and 59 of the partition flags value without setting any of the other bits, and may be set via
797 \fIFlags=\fR
798 too, see above\&.
799 .sp
800 If
801 \fIFlags=\fR
802 is used in conjunction with one or more of
803 \fINoAuto=\fR/\fIReadOnly=\fR/\fIGrowFileSystem=\fR
804 the latter control the value of the relevant flags, i\&.e\&. the high\-level settings
805 \fINoAuto=\fR/\fIReadOnly=\fR/\fIGrowFileSystem=\fR
806 override the relevant bits of the low\-level setting
807 \fIFlags=\fR\&.
808 .sp
809 Note that the three flags affect only automatic partition mounting, as implemented by
810 \fBsystemd-gpt-auto-generator\fR(8)
811 or the
812 \fB\-\-image=\fR
813 option of various commands (such as
814 \fBsystemd-nspawn\fR(1))\&. It has no effect on explicit mounts, such as those done via
815 \fBmount\fR(8)
816 or
817 \fBfstab\fR(5)\&.
818 .sp
819 If both bit 60 and 59 are set for a partition (i\&.e\&. the partition is marked both read\-only and marked for file system growing) the latter is typically without effect: the read\-only flag takes precedence in most tools reading these flags, and since growing the file system involves writing to the partition it is consequently ignored\&.
820 .sp
821 \fINoAuto=\fR
822 defaults to off\&.
823 \fIReadOnly=\fR
824 defaults to on for Verity partition types, and off for all others\&.
825 \fIGrowFileSystem=\fR
826 defaults to on for all partition types that support it, except if the partition is marked read\-only (and thus effectively, defaults to off for Verity partitions)\&.
827 .sp
828 Added in version 249\&.
829 .RE
830 .PP
831 \fISplitName=\fR
832 .RS 4
833 Configures the suffix to append to split artifacts when the
834 \fB\-\-split\fR
835 option of
836 \fBsystemd-repart\fR(8)
837 is used\&. Simple specifier expansion is supported, see below\&. Defaults to
838 "%t"\&. To disable split artifact generation for a partition, set
839 \fISplitName=\fR
840 to
841 "\-"\&.
842 .sp
843 Added in version 252\&.
844 .RE
845 .PP
846 \fIMinimize=\fR
847 .RS 4
848 Takes one of
849 "off",
850 "best", and
851 "guess"
852 (alternatively, also accepts a boolean value, which is mapped to
853 "off"
854 when false, and
855 "best"
856 when true)\&. Defaults to
857 "off"\&. If set to
858 "best", the partition will have the minimal size required to store the sources configured with
859 \fICopyFiles=\fR\&.
860 "best"
861 is currently only supported for read\-only filesystems\&. If set to
862 "guess", the partition is created at least as big as required to store the sources configured with
863 \fICopyFiles=\fR\&. Note that unless the filesystem is a read\-only filesystem,
864 \fBsystemd\-repart\fR
865 will have to populate the filesystem twice to guess the minimal required size, so enabling this option might slow down repart when populating large partitions\&.
866 .sp
867 Added in version 253\&.
868 .RE
869 .PP
870 \fIMountPoint=\fR
871 .RS 4
872 Specifies where and how the partition should be mounted\&. Takes at least one and at most two fields separated with a colon (":")\&. The first field specifies where the partition should be mounted\&. The second field specifies extra mount options to append to the default mount options\&. These fields correspond to the second and fourth column of the
873 \fBfstab\fR(5)
874 format\&. As a colon is used for separating fields, each field needs to be quoted when it contains colons\&. E\&.g\&.
875 .sp
876 .if n \{\
877 .RS 4
878 .\}
879 .nf
880 MountPoint="/path/with:colon":"zstd:1,noatime,lazytime"
881 .fi
882 .if n \{\
883 .RE
884 .\}
885 .sp
886 This setting may be specified multiple times to mount the partition multiple times\&. This can be used to add mounts for different
887 \fBbtrfs\fR(8)
888 subvolumes located on the same btrfs partition\&.
889 .sp
890 Note that this setting is only taken into account when
891 \fB\-\-generate\-fstab=\fR
892 is specified on the
893 \fBsystemd\-repart\fR
894 command line\&.
895 .sp
896 Added in version 256\&.
897 .RE
898 .PP
899 \fIEncryptedVolume=\fR
900 .RS 4
901 Specifies how the encrypted partition should be set up\&. Takes at least one and at most three fields separated with a colon (":")\&. The first field specifies the encrypted volume name under
902 /dev/mapper/\&. If not specified,
903 "luks\-UUID"
904 will be used where
905 "UUID"
906 is the LUKS UUID\&. The second field specifies the keyfile to use following the same format as specified in crypttab\&. The third field specifies a comma\-delimited list of crypttab options\&. These fields correspond to the first, third and fourth column of the
907 \fBcrypttab\fR(5)
908 format\&.
909 .sp
910 Note that this setting is only taken into account when
911 \fB\-\-generate\-crypttab=\fR
912 is specified on the
913 \fBsystemd\-repart\fR
914 command line\&.
915 .sp
916 Added in version 256\&.
917 .RE
918 .PP
919 \fICompression=\fR
920 .RS 4
921 Specifies the compression algorithm to use for the filesystem configured with
922 \fIFormat=\fR\&. Takes a single argument specifying the compression algorithm\&.
923 .sp
924 Note that this setting is only taken into account when the filesystem configured with
925 \fIFormat=\fR
926 supports compression (
927 \fBbtrfs\fR(8), squashfs,
928 \fBerofs\fR(5))\&. Here\*(Aqs an incomplete list of compression algorithms supported by the filesystems known to
929 \fBsystemd\-repart\fR:
930 .sp
931 .it 1 an-trap
932 .nr an-no-space-flag 1
933 .nr an-break-flag 1
934 .br
935 .B Table\ \&3.\ \&File System Compression Algorithms
936 .TS
937 allbox tab(:);
938 lB lB lB.
939 T{
940 File System
941 T}:T{
942 Compression Algorithms
943 T}:T{
944 Documentation
945 T}
946 .T&
947 l l l
948 l l l
949 l l l.
950 T{
951 \fBsquashfs\fR
952 T}:T{
953 gzip, lzo, lz4, xz, zstd, lzma
954 T}:T{
955 \fBmksquashfs\fR(1)
956 T}
957 T{
958 \fBerofs\fR
959 T}:T{
960 lz4, lz4hc, lzma, deflate, libdeflate, zstd
961 T}:T{
962 \fBmkfs.erofs\fR(1)
963 T}
964 T{
965 \fBbtrfs\fR
966 T}:T{
967 zlib, lzo, zstd
968 T}:T{
969 \fBmkfs.btrfs\fR(8)
970 T}
971 .TE
972 .sp 1
973 Added in version 257\&.
974 .RE
975 .PP
976 \fICompressionLevel=\fR
977 .RS 4
978 Specifies the compression level to use for the filesystem configured with
979 \fIFormat=\fR\&. Takes a single argument specifying the compression level to use for the configured compression algorithm\&. The possible compression levels and their meaning are filesystem specific (refer to the filesystem\*(Aqs documentation for the exact meaning of a particular compression level)\&.
980 .sp
981 Note that this setting is only taken into account when the filesystem configured with
982 \fIFormat=\fR
983 supports compression and the
984 \fICompression=\fR
985 setting is configured explicitly\&.
986 .sp
987 Added in version 257\&.
988 .RE
989 .PP
990 \fISupplementFor=\fR
991 .RS 4
992 Takes a partition definition name, such as
993 "10\-esp"\&. If specified,
994 \fBsystemd\-repart\fR
995 will avoid creating this partition and instead prefer to partially merge the two definitions\&. However, depending on the existing layout of partitions on disk,
996 \fBsystemd\-repart\fR
997 may be forced to fall back onto un\-merging the definitions and using them as originally written, potentially creating this partition\&. Specifically,
998 \fBsystemd\-repart\fR
999 will fall back if this partition is found to already exist on disk, or if the target partition already exists on disk but is too small, or if it cannot allocate space for the merged partition for some other reason\&.
1000 .sp
1001 The following fields are merged into the target definition in the specified ways:
1002 \fIWeight=\fR
1003 and
1004 \fIPaddingWeight=\fR
1005 are simply overwritten;
1006 \fISizeMinBytes=\fR
1007 and
1008 \fIPaddingMinBytes=\fR
1009 use the larger of the two values;
1010 \fISizeMaxBytes=\fR
1011 and
1012 \fIPaddingMaxBytes=\fR
1013 use the smaller value; and
1014 \fICopyFiles=\fR,
1015 \fIExcludeFiles=\fR,
1016 \fIExcludeFilesTarget=\fR,
1017 \fIMakeDirectories=\fR, and
1018 \fISubvolumes=\fR
1019 are concatenated\&.
1020 .sp
1021 Usage of this option in combination with
1022 \fICopyBlocks=\fR,
1023 \fIEncrypt=\fR, or
1024 \fIVerity=\fR
1025 is not supported\&. The target definition cannot set these settings either\&. A definition cannot simultaneously be a supplement and act as a target for some other supplement definition\&. A target cannot have more than one supplement partition associated with it\&.
1026 .sp
1027 For example, distributions can use this to implement
1028 \fI$BOOT\fR
1029 as defined in the
1030 \m[blue]\fBBoot Loader Specification\fR\m[]\&\s-2\u[2]\d\s+2\&. Distributions may prefer to use the ESP as
1031 \fI$BOOT\fR
1032 whenever possible, but to adhere to the spec XBOOTLDR must sometimes be used instead\&. So, they should create two definitions: the first defining an ESP big enough to hold just the bootloader, and a second for the XBOOTLDR that\*(Aqs sufficiently large to hold kernels and configured as a supplement for the ESP\&. Whenever possible,
1033 \fBsystemd-repart\fR(8)
1034 will try to merge the two definitions to create one large ESP, but if that\*(Aqs not allowable due to the existing conditions on disk a small ESP and a large XBOOTLDR will be created instead\&.
1035 .sp
1036 As another example, distributions can also use this to seamlessly share a single
1037 /home
1038 partition in a multi\-boot scenario, while preferring to keep
1039 /home
1040 on the root partition by default\&. Having a
1041 /home
1042 partition separated from the root partition entails some extra complexity: someone has to decide how to split the space between the two partitions\&. On the other hand, it allows a user to share their home area between multiple installed OSs (i\&.e\&. via
1043 \fBsystemd-homed.service\fR(8))\&. Distributions should create two definitions: the first for a root partition that takes up some relatively small percentage of the disk, and the second as a supplement for the first to create a
1044 /home
1045 partition that takes up all the remaining free space\&. On first boot, if
1046 \fBsystemd\-repart\fR
1047 finds an existing
1048 /home
1049 partition on disk, it\*(Aqll un\-merge the definitions and create just a small root partition\&. Otherwise, the definitions will be merged and a single large root partition will be created\&.
1050 .sp
1051 Added in version 257\&.
1052 .RE
1053 .PP
1054 \fIAddValidateFS=\fR
1055 .RS 4
1056 Takes a boolean argument\&. If enabled will set the
1057 \fIuser\&.validatefs\&.gpt_label\fR,
1058 \fIuser\&.validatefs\&.gpt_type_uuid\fR
1059 and
1060 \fIuser\&.validatefs\&.mount_point\fR
1061 extended attributes on the root inode of the formatted file system to the partition labels, partition type UUIDs and the intended mount point for the file system\&. Defaults to on if
1062 \fIFormat=\fR
1063 is used and the specified argument is neither
1064 "swap"
1065 nor
1066 "vfat"\&.
1067 .sp
1068 These extended attributes are read by
1069 \[email protected]\fR(8)
1070 and may encode constraints on mounted file systems that must be fulfilled for the system to successfully boot\&. This is particular important in
1071 \fBsystemd-gpt-auto-generator\fR(8)
1072 scenarios, which puts together the mount hierarchy from untrusted data from the GPT partition table\&. As these extended attributes are stored inside the file system, they are typically authenticated as part of the file system (assuming it is contained in protected volume; i\&.e\&. LUKS or dm\-verity), and hence may be used to securely validate the matching partition table fields\&.
1073 .sp
1074 Added in version 258\&.
1075 .RE
1076 .PP
1077 \fIFileSystemSectorSize=\fR
1078 .RS 4
1079 Controls the sector size for any file system, LUKS volume or Verity volume formatted on this partition\&. Expects a power of 2 as value, and must be equal or larger than 512\&. Typically it\*(Aqs recommended to set the file system sector size to 4096, even on 512 sector disks (and in particular for images that are only ever intended to be stored as file on disks), in order to optimize performance\&. However, for compatibility with foreign operating systems or firmware it might be advisable to use the native sector size of the backing disk\&.
1080 .sp
1081 If unspecified and operating on a block device, defaults to the native sector size of the device\&. If unspecified and operating on a disk image file defaults to 4096\&.
1082 .sp
1083 Regardless of what is configured here, or which default is picked, the file system sector size is always increased to be equal or larger than the disk sector size\&.
1084 .sp
1085 Added in version 258\&.
1086 .RE
1087 .SH "SPECIFIERS"
1088 .PP
1089 Specifiers may be used in the
1090 \fILabel=\fR,
1091 \fICopyBlocks=\fR,
1092 \fICopyFiles=\fR,
1093 \fIMakeDirectories=\fR,
1094 \fISplitName=\fR
1095 settings\&. The following expansions are understood:
1096 .sp
1097 .it 1 an-trap
1098 .nr an-no-space-flag 1
1099 .nr an-break-flag 1
1100 .br
1101 .B Table\ \&4.\ \&Specifiers available
1102 .TS
1103 allbox tab(:);
1104 lB lB lB.
1105 T{
1106 Specifier
1107 T}:T{
1108 Meaning
1109 T}:T{
1110 Details
1111 T}
1112 .T&
1113 l l l
1114 l l l
1115 l l l
1116 l l l
1117 l l l
1118 l l l
1119 l l l
1120 l l l
1121 l l l
1122 l l l
1123 l l l
1124 l l l
1125 l l l
1126 l l l
1127 l l l
1128 l l l.
1129 T{
1130 "%a"
1131 T}:T{
1132 Architecture
1133 T}:T{
1134 A short string identifying the architecture of the local system\&. A string such as \fBx86\fR, \fBx86\-64\fR or \fBarm64\fR\&. See the architectures defined for \fIConditionArchitecture=\fR in \fBsystemd.unit\fR(5) for a full list\&.
1135 T}
1136 T{
1137 "%A"
1138 T}:T{
1139 Operating system image version
1140 T}:T{
1141 The operating system image version identifier of the running system, as read from the \fIIMAGE_VERSION=\fR field of /etc/os\-release\&. If not set, resolves to an empty string\&. See \fBos-release\fR(5) for more information\&.
1142 T}
1143 T{
1144 "%b"
1145 T}:T{
1146 Boot ID
1147 T}:T{
1148 The boot ID of the running system, formatted as string\&. See \fBrandom\fR(4) for more information\&.
1149 T}
1150 T{
1151 "%B"
1152 T}:T{
1153 Operating system build ID
1154 T}:T{
1155 The operating system build identifier of the running system, as read from the \fIBUILD_ID=\fR field of /etc/os\-release\&. If not set, resolves to an empty string\&. See \fBos-release\fR(5) for more information\&.
1156 T}
1157 T{
1158 "%H"
1159 T}:T{
1160 Host name
1161 T}:T{
1162 The hostname of the running system\&.
1163 T}
1164 T{
1165 "%l"
1166 T}:T{
1167 Short host name
1168 T}:T{
1169 The hostname of the running system, truncated at the first dot to remove any domain component\&.
1170 T}
1171 T{
1172 "%m"
1173 T}:T{
1174 Machine ID
1175 T}:T{
1176 The machine ID of the running system, formatted as string\&. See \fBmachine-id\fR(5) for more information\&.
1177 T}
1178 T{
1179 "%M"
1180 T}:T{
1181 Operating system image identifier
1182 T}:T{
1183 The operating system image identifier of the running system, as read from the \fIIMAGE_ID=\fR field of /etc/os\-release\&. If not set, resolves to an empty string\&. See \fBos-release\fR(5) for more information\&.
1184 T}
1185 T{
1186 "%o"
1187 T}:T{
1188 Operating system ID
1189 T}:T{
1190 The operating system identifier of the running system, as read from the \fIID=\fR field of /etc/os\-release\&. See \fBos-release\fR(5) for more information\&.
1191 T}
1192 T{
1193 "%q"
1194 T}:T{
1195 Pretty host name
1196 T}:T{
1197 The pretty hostname of the running system, as read from the \fIPRETTY_HOSTNAME=\fR field of /etc/machine\-info\&. If not set, resolves to the short hostname\&. See \fBmachine-info\fR(5) for more information\&.
1198 T}
1199 T{
1200 "%v"
1201 T}:T{
1202 Kernel release
1203 T}:T{
1204 Identical to \fBuname \-r\fR output\&.
1205 T}
1206 T{
1207 "%w"
1208 T}:T{
1209 Operating system version ID
1210 T}:T{
1211 The operating system version identifier of the running system, as read from the \fIVERSION_ID=\fR field of /etc/os\-release\&. If not set, resolves to an empty string\&. See \fBos-release\fR(5) for more information\&.
1212 T}
1213 T{
1214 "%W"
1215 T}:T{
1216 Operating system variant ID
1217 T}:T{
1218 The operating system variant identifier of the running system, as read from the \fIVARIANT_ID=\fR field of /etc/os\-release\&. If not set, resolves to an empty string\&. See \fBos-release\fR(5) for more information\&.
1219 T}
1220 T{
1221 "%T"
1222 T}:T{
1223 Directory for temporary files
1224 T}:T{
1225 This is either /tmp or the path "$TMPDIR", "$TEMP" or "$TMP" are set to\&. (Note that the directory may be specified without a trailing slash\&.)
1226 T}
1227 T{
1228 "%V"
1229 T}:T{
1230 Directory for larger and persistent temporary files
1231 T}:T{
1232 This is either /var/tmp or the path "$TMPDIR", "$TEMP" or "$TMP" are set to\&. (Note that the directory may be specified without a trailing slash\&.)
1233 T}
1234 T{
1235 "%%"
1236 T}:T{
1237 Single percent sign
1238 T}:T{
1239 Use "%%" in place of "%" to specify a single percent sign\&.
1240 T}
1241 .TE
1242 .sp 1
1243 .PP
1244 Additionally, for the
1245 \fISplitName=\fR
1246 setting, the following specifiers are also understood:
1247 .sp
1248 .it 1 an-trap
1249 .nr an-no-space-flag 1
1250 .nr an-break-flag 1
1251 .br
1252 .B Table\ \&5.\ \&Specifiers available
1253 .TS
1254 allbox tab(:);
1255 lB lB lB.
1256 T{
1257 Specifier
1258 T}:T{
1259 Meaning
1260 T}:T{
1261 Details
1262 T}
1263 .T&
1264 l l l
1265 l l l
1266 l l l
1267 l l l.
1268 T{
1269 "%T"
1270 T}:T{
1271 Partition Type UUID
1272 T}:T{
1273 The partition type UUID, as configured with \fIType=\fR
1274 T}
1275 T{
1276 "%t"
1277 T}:T{
1278 Partition Type Identifier
1279 T}:T{
1280 The partition type identifier corresponding to the partition type UUID
1281 T}
1282 T{
1283 "%U"
1284 T}:T{
1285 Partition UUID
1286 T}:T{
1287 The partition UUID, as configured with \fIUUID=\fR
1288 T}
1289 T{
1290 "%n"
1291 T}:T{
1292 Partition Number
1293 T}:T{
1294 The partition number assigned to the partition
1295 T}
1296 .TE
1297 .sp 1
1298 .SH "ENVIRONMENT"
1299 .PP
1300 Extra filesystem formatting options can be provided using filesystem\-specific environment variables:
1301 \fI$SYSTEMD_REPART_MKFS_OPTIONS_BTRFS\fR,
1302 \fI$SYSTEMD_REPART_MKFS_OPTIONS_XFS\fR,
1303 \fI$SYSTEMD_REPART_MKFS_OPTIONS_VFAT\fR,
1304 \fI$SYSTEMD_REPART_MKFS_OPTIONS_EROFS\fR, and
1305 \fI$SYSTEMD_REPART_MKFS_OPTIONS_SQUASHFS\fR\&. Each variable accepts valid
1306 \fBmkfs\&.\fR\fB\fIfilesystem\fR\fR
1307 command\-line arguments\&. The content of those variables is passed as\-is to the command, without any verification\&.
1308 .SH "EXAMPLES"
1309 .PP
1310 \fBExample\ \&1.\ \&Grow the root partition to the full disk size at first boot\fR
1311 .PP
1312 With the following file the root partition is automatically grown to the full disk if possible during boot\&.
1313 .PP
1314 .if n \{\
1315 .RS 4
1316 .\}
1317 .nf
1318 # /usr/lib/repart\&.d/50\-root\&.conf
1319 [Partition]
1320 Type=root
1321 .fi
1322 .if n \{\
1323 .RE
1324 .\}
1325
1326 .PP
1327 \fBExample\ \&2.\ \&Create a swap and home partition automatically on boot, if missing\fR
1328 .PP
1329 The home partition gets all available disk space while the swap partition gets 1G at most and 64M at least\&. We set a priority > 0 on the swap partition to ensure the swap partition is not used if not enough space is available\&. For every three bytes assigned to the home partition the swap partition gets assigned one\&.
1330 .PP
1331 .if n \{\
1332 .RS 4
1333 .\}
1334 .nf
1335 # /usr/lib/repart\&.d/60\-home\&.conf
1336 [Partition]
1337 Type=home
1338 .fi
1339 .if n \{\
1340 .RE
1341 .\}
1342 .PP
1343 .if n \{\
1344 .RS 4
1345 .\}
1346 .nf
1347 # /usr/lib/repart\&.d/70\-swap\&.conf
1348 [Partition]
1349 Type=swap
1350 SizeMinBytes=64M
1351 SizeMaxBytes=1G
1352 Priority=1
1353 Weight=333
1354 .fi
1355 .if n \{\
1356 .RE
1357 .\}
1358
1359 .PP
1360 \fBExample\ \&3.\ \&Create B partitions in an A/B Verity setup, if missing\fR
1361 .PP
1362 Let\*(Aqs say the vendor intends to update OS images in an A/B setup, i\&.e\&. with two root partitions (and two matching Verity partitions) that shall be used alternatingly during upgrades\&. To minimize image sizes the original image is shipped only with one root and one Verity partition (the "A" set), and the second root and Verity partitions (the "B" set) shall be created on first boot on the free space on the medium\&.
1363 .PP
1364 .if n \{\
1365 .RS 4
1366 .\}
1367 .nf
1368 # /usr/lib/repart\&.d/50\-root\&.conf
1369 [Partition]
1370 Type=root
1371 SizeMinBytes=512M
1372 SizeMaxBytes=512M
1373 .fi
1374 .if n \{\
1375 .RE
1376 .\}
1377 .PP
1378 .if n \{\
1379 .RS 4
1380 .\}
1381 .nf
1382 # /usr/lib/repart\&.d/60\-root\-verity\&.conf
1383 [Partition]
1384 Type=root\-verity
1385 SizeMinBytes=64M
1386 SizeMaxBytes=64M
1387 .fi
1388 .if n \{\
1389 .RE
1390 .\}
1391 .PP
1392 The definitions above cover the "A" set of root partition (of a fixed 512M size) and Verity partition for the root partition (of a fixed 64M size)\&. Let\*(Aqs use symlinks to create the "B" set of partitions, since after all they shall have the same properties and sizes as the "A" set\&.
1393 .PP
1394 .if n \{\
1395 .RS 4
1396 .\}
1397 .nf
1398 # ln \-s 50\-root\&.conf /usr/lib/repart\&.d/70\-root\-b\&.conf
1399 # ln \-s 60\-root\-verity\&.conf /usr/lib/repart\&.d/80\-root\-verity\-b\&.conf
1400 .fi
1401 .if n \{\
1402 .RE
1403 .\}
1404
1405 .PP
1406 \fBExample\ \&4.\ \&Create a data partition and corresponding verity partitions from a OS tree\fR
1407 .PP
1408 Assuming we have an OS tree at
1409 /var/tmp/os\-tree
1410 that we want to package in a root partition together with matching verity partitions, we can do so as follows:
1411 .PP
1412 .if n \{\
1413 .RS 4
1414 .\}
1415 .nf
1416 # 50\-root\&.conf
1417 [Partition]
1418 Type=root
1419 CopyFiles=/var/tmp/os\-tree
1420 Verity=data
1421 VerityMatchKey=root
1422 Minimize=guess
1423 .fi
1424 .if n \{\
1425 .RE
1426 .\}
1427 .PP
1428 .if n \{\
1429 .RS 4
1430 .\}
1431 .nf
1432 # 60\-root\-verity\&.conf
1433 [Partition]
1434 Type=root\-verity
1435 Verity=hash
1436 VerityMatchKey=root
1437 # Explicitly set the hash and data block size to 4K
1438 VerityDataBlockSizeBytes=4096
1439 VerityHashBlockSizeBytes=4096
1440 Minimize=best
1441 .fi
1442 .if n \{\
1443 .RE
1444 .\}
1445 .PP
1446 .if n \{\
1447 .RS 4
1448 .\}
1449 .nf
1450 # 70\-root\-verity\-sig\&.conf
1451 [Partition]
1452 Type=root\-verity\-sig
1453 Verity=signature
1454 VerityMatchKey=root
1455 .fi
1456 .if n \{\
1457 .RE
1458 .\}
1459
1460 .SH "SEE ALSO"
1461 .PP
1462 \fBsystemd\fR(1), \fBsystemd-repart\fR(8), \fBsfdisk\fR(8), \fBsystemd-cryptenroll\fR(1)
1463 .SH "NOTES"
1464 .IP " 1." 4
1465 Discoverable Partitions Specification
1466 .RS 4
1467 \%https://uapi-group.org/specifications/specs/discoverable_partitions_specification
1468 .RE
1469 .IP " 2." 4
1470 Boot Loader Specification
1471 .RS 4
1472 \%https://uapi-group.org/specifications/specs/boot_loader_specification/
1473 .RE