Debian Codegraph @

upstream/fedora-44/man5/repart.d.5

raw
1 '\" t
2 .TH "REPART\&.D" "5" "" "systemd 259.5" "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]\fBUAPI\&.2 Discoverable 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 \fIVolumeLabel=\fR
276 .RS 4
277 The textual label to assign to the LUKS superblock if applicable\&. If not specified defaults to the same string as the partition label (see
278 \fILabel=\fR
279 above), however prefixed with
280 "luks\-"\&. This setting has no effect if encryption is not enabled for this partition\&.
281 .sp
282 Added in version 259\&.
283 .RE
284 .PP
285 \fIUUID=\fR
286 .RS 4
287 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
288 "null", the UUID is set to all zeroes\&. If not specified a UUID derived from the partition type is automatically used\&.
289 .sp
290 Added in version 246\&.
291 .RE
292 .PP
293 \fIPriority=\fR
294 .RS 4
295 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\&.
296 .sp
297 Added in version 245\&.
298 .RE
299 .PP
300 \fIWeight=\fR
301 .RS 4
302 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
303 \fISizeMinBytes=\fR,
304 \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\&.
305 .sp
306 The
307 \fIWeight=\fR
308 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
309 \fISizeMinBytes=\fR
310 and
311 \fISizeMaxBytes=\fR
312 with the same value in order to fixate the size to one value, in which case the weight has no effect\&.
313 .sp
314 Added in version 245\&.
315 .RE
316 .PP
317 \fIPaddingWeight=\fR
318 .RS 4
319 Similar to
320 \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\&.
321 .sp
322 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\&.
323 .sp
324 Added in version 245\&.
325 .RE
326 .PP
327 \fISizeMinBytes=\fR, \fISizeMaxBytes=\fR
328 .RS 4
329 Specifies minimum and maximum size constraints in bytes\&. Takes the usual K, M, G, T, \&... suffixes (to the base of 1024)\&. If
330 \fISizeMinBytes=\fR
331 is specified the partition is created at or grown to at least the specified size\&. If
332 \fISizeMaxBytes=\fR
333 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
334 \fIWeight=\fR, see above\&. When
335 \fISizeMinBytes=\fR
336 is set equal to
337 \fISizeMaxBytes=\fR
338 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
339 \fISizeMinBytes=\fR) or downwards (in case of
340 \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
341 \fIPriority=\fR
342 (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\&.
343 .sp
344 If
345 \fIFormat=\fR
346 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\&.
347 .sp
348 Added in version 245\&.
349 .RE
350 .PP
351 \fIPaddingMinBytes=\fR, \fIPaddingMaxBytes=\fR
352 .RS 4
353 Specifies minimum and maximum size constraints in bytes for the free space after the partition (the "padding")\&. Semantics are similar to
354 \fISizeMinBytes=\fR
355 and
356 \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
357 \fIPaddingWeight=\fR
358 determines the size of the padding applied\&.
359 .sp
360 Added in version 245\&.
361 .RE
362 .PP
363 \fICopyBlocks=\fR
364 .RS 4
365 Takes a path to a regular file, block device node, char device node or directory, or the special value
366 "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
367 /dev/urandom
368 as value to initialize a partition with random data\&.
369 .sp
370 If the special value
371 "auto"
372 is specified, the source to copy from is automatically picked up from the running system (or the image specified with
373 \fB\-\-image=\fR
374 \(em if used)\&. A partition that matches both the configured partition type (as declared with
375 \fIType=\fR
376 described above), and the currently mounted directory appropriate for that partition type is determined\&. For example, if the partition type is set to
377 "root"
378 the partition backing the root directory (/) is used as source to copy from \(em if its partition type is set to
379 "root"
380 as well\&. If the declared type is
381 "usr"
382 the partition backing
383 /usr/
384 is used as source to copy blocks from \(em if its partition type is set to
385 "usr"
386 too\&. The logic is capable of automatically tracking down the backing partitions for encrypted and Verity\-enabled volumes\&.
387 "CopyBlocks=auto"
388 is useful for implementing "self\-replicating" systems, i\&.e\&. systems that are their own installer\&.
389 .sp
390 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
391 \fISizeMin=\fR
392 value configured above\&.
393 .sp
394 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\&.
395 .sp
396 This option cannot be combined with
397 \fIFormat=\fR
398 or
399 \fICopyFiles=\fR\&.
400 .sp
401 Added in version 246\&.
402 .RE
403 .PP
404 \fIFormat=\fR
405 .RS 4
406 Takes a file system name, such as
407 "ext4",
408 "btrfs",
409 "xfs",
410 "vfat",
411 "erofs",
412 "squashfs"
413 or the special value
414 "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)\&.
415 .sp
416 This also takes a special meta value
417 "empty"\&. If specified this is equivalent to specifying
418 "Label=_empty"
419 and
420 "NoAuto=1"\&.
421 .sp
422 This option has no effect if the partition already exists\&.
423 .sp
424 Similarly to the behaviour of
425 \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\&.
426 .sp
427 This option cannot be combined with
428 \fICopyBlocks=\fR\&.
429 .sp
430 Added in version 247\&.
431 .RE
432 .PP
433 \fICopyFiles=\fR
434 .RS 4
435 Takes a colon\-separated triplet in the form
436 "\fIsource\fR[:\fItarget\fR[:\fIoptions\fR]]"\&.
437 \fIsource\fR
438 is an absolute path which refers to a source file or directory on the host\&.
439 \fItarget\fR
440 is an absolute path in the file system of the newly created partition and formatted file system\&.
441 \fIoptions\fR
442 is a comma\-separated list of options where each option is in the form
443 "\fIkey\fR[=\fIvalue\fR]"\&.
444 .sp
445 This setting may be used to copy files or directories from the host into the file system that is created due to the
446 \fIFormat=\fR
447 option\&. If
448 \fICopyFiles=\fR
449 is used without
450 \fIFormat=\fR
451 specified explicitly,
452 "Format="
453 with a suitable default is implied (currently
454 "vfat"
455 for
456 "ESP"
457 and
458 "XBOOTLDR"
459 partitions, and
460 "ext4"
461 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\&.
462 .sp
463 The
464 \fItarget\fR
465 path may be omitted in which case the
466 \fIsource\fR
467 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\&.
468 .sp
469 The
470 \fIoptions\fR
471 may contain the following values:
472 .PP
473 \fIfsverity=\fR
474 .RS 4
475 May be set to the value
476 "off"
477 (the default if the option is not present) or
478 "copy"\&. If set to
479 "off"
480 then no files copied into the filesystem from this source will have fs\-verity enabled\&. If set to
481 "copy"
482 then the fs\-verity information for each file will be copied from the corresponding source file\&.
483 .sp
484 Added in version 258\&.
485 .RE
486 .sp
487 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\&.
488 .sp
489 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\&.
490 .sp
491 Note that
492 \fICopyFiles=\fR
493 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,
494 \fBsystemd\-repart\fR
495 will skip copying this file and write a log message about it\&.
496 .sp
497 Note that
498 \fBsystemd\-repart\fR
499 does not change the UIDs/GIDs of any copied files and directories\&. When running
500 \fBsystemd\-repart\fR
501 as an unprivileged user to build an image of files and directories owned by the same user, you can run
502 \fBsystemd\-repart\fR
503 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\&.
504 .sp
505 Note that when populating XFS filesystems with
506 \fBsystemd\-repart\fR
507 and loop devices are not available, populating XFS filesystems with files containing spaces, tabs or newlines might fail on old versions of
508 \fBmkfs.xfs\fR(8)
509 due to limitations of its protofile format\&.
510 .sp
511 Note that when populating XFS filesystems with
512 \fBsystemd\-repart\fR
513 and loop devices are not available, extended attributes will not be copied into generated XFS filesystems due to limitations
514 \fBmkfs.xfs\fR(8)\*(Aqs protofile format\&.
515 .sp
516 This option cannot be combined with
517 \fICopyBlocks=\fR\&.
518 .sp
519 When
520 \fBsystemd-repart\fR(8)
521 is invoked with the
522 \fB\-\-copy\-source=\fR
523 command line switch the file paths are taken relative to the specified directory\&. If
524 \fB\-\-copy\-source=\fR
525 is not used, but the
526 \fB\-\-image=\fR
527 or
528 \fB\-\-root=\fR
529 switches are used, the source paths are taken relative to the specified root directory or disk image root\&.
530 .sp
531 Added in version 247\&.
532 .RE
533 .PP
534 \fIExcludeFiles=\fR, \fIExcludeFilesTarget=\fR
535 .RS 4
536 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
537 \fICopyFiles=\fR
538 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\&.
539 .sp
540 If the path is a directory and ends with
541 "/", only the directory\*(Aqs contents are excluded but not the directory itself\&. If the path is a directory and does not end with
542 "/", both the directory and its contents are excluded\&.
543 .sp
544 \fIExcludeFilesTarget=\fR
545 is like
546 \fIExcludeFiles=\fR
547 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\&.
548 .sp
549 When
550 \fBsystemd-repart\fR(8)
551 is invoked with the
552 \fB\-\-image=\fR
553 or
554 \fB\-\-root=\fR
555 command line switches the paths specified are taken relative to the specified root directory or disk image root\&.
556 .sp
557 Added in version 254\&.
558 .RE
559 .PP
560 \fIMakeDirectories=\fR
561 .RS 4
562 Takes one or more absolute paths, separated by whitespace, each declaring a directory to create within the new file system\&. Behaviour is similar to
563 \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
564 \fICopyFiles=\fR
565 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
566 \fICopyFiles=\fR
567 and
568 \fIMakeDirectories=\fR
569 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)\&.
570 .sp
571 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
572 /usr/
573 in it this way, so that the
574 "usr"
575 partition may over\-mount it\&.
576 .sp
577 Consider using
578 \fBsystemd-tmpfiles\fR(8)
579 with its
580 \fB\-\-image=\fR
581 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\&.
582 .sp
583 Added in version 249\&.
584 .RE
585 .PP
586 \fIMakeSymlinks=\fR
587 .RS 4
588 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
589 \fICopyFiles=\fR
590 and
591 \fIMakeSymlinks=\fR
592 are used together the former is applied first\&.
593 .sp
594 The primary use case for this option is to create symlinks that need to exist before
595 \fBsystemd-tmpfiles\fR(8)
596 is executed\&. For example, when using
597 \fBsystemd-confext\fR(8), this setting can be used to create symlinks in
598 /var/lib/extensions\&.mutable
599 to redirect writes to mutable confexts to a custom location\&.
600 .sp
601 Consider using
602 \fBsystemd-tmpfiles\fR(8)
603 with its
604 \fB\-\-image=\fR
605 option to pre\-create other symlinks (as well as other inodes) with fine\-grained control of ownership, access modes and other file attributes\&.
606 .sp
607 Added in version 257\&.
608 .RE
609 .PP
610 \fISubvolumes=\fR
611 .RS 4
612 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:
613 .sp
614 .it 1 an-trap
615 .nr an-no-space-flag 1
616 .nr an-break-flag 1
617 .br
618 .B Table\ \&2.\ \&Subvolume Flags
619 .TS
620 allbox tab(:);
621 lB lB.
622 T{
623 Flag
624 T}:T{
625 Purpose
626 T}
627 .T&
628 l l
629 l l.
630 T{
631 "ro"
632 T}:T{
633 Make this subvolume read\-only\&.
634 T}
635 T{
636 "nodatacow"
637 T}:T{
638 Disable data CoW for this subvolume\&.
639 T}
640 .TE
641 .sp 1
642 Note that this option does not create the directories themselves, that can be configured with
643 \fIMakeDirectories=\fR
644 and
645 \fICopyFiles=\fR\&.
646 .sp
647 Note that this option only takes effect if the target filesystem supports subvolumes, such as
648 \fBbtrfs\fR(8)\&.
649 .sp
650 Note that this option is only supported in combination with
651 \fB\-\-offline=yes\fR
652 since
653 btrfs\-progs
654 6\&.12 or newer\&.
655 .sp
656 Added in version 255\&.
657 .RE
658 .PP
659 \fIDefaultSubvolume=\fR
660 .RS 4
661 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
662 \fISubvolumes=\fR\&.
663 .sp
664 Note that this option only takes effect if the target filesystem supports subvolumes, such as
665 \fBbtrfs\fR(8)\&.
666 .sp
667 Note that this option is only supported in combination with
668 \fB\-\-offline=yes\fR
669 since
670 btrfs\-progs
671 6\&.12 or newer\&.
672 .sp
673 Added in version 256\&.
674 .RE
675 .PP
676 \fIEncrypt=\fR
677 .RS 4
678 Takes one of
679 "off",
680 "key\-file",
681 "tpm2"
682 and
683 "key\-file+tpm2"
684 (alternatively, also accepts a boolean value, which is mapped to
685 "off"
686 when false, and
687 "key\-file"
688 when true)\&. Defaults to
689 "off"\&. If not
690 "off"
691 the partition will be formatted with a LUKS2 superblock, before the blocks configured with
692 \fICopyBlocks=\fR
693 are copied in or the file system configured with
694 \fIFormat=\fR
695 is created\&.
696 .sp
697 The LUKS2 UUID is automatically derived from the partition UUID in a stable fashion\&. If
698 "key\-file"
699 or
700 "key\-file+tpm2"
701 is used, a key is added to the LUKS2 superblock, configurable with the
702 \fB\-\-key\-file=\fR
703 option to
704 \fBsystemd\-repart\fR\&. If
705 "tpm2"
706 or
707 "key\-file+tpm2"
708 is used, a key is added to the LUKS2 superblock that is enrolled to the local TPM2 chip, as configured with the
709 \fB\-\-tpm2\-device=\fR
710 and
711 \fB\-\-tpm2\-pcrs=\fR
712 options to
713 \fBsystemd\-repart\fR\&.
714 .sp
715 When used this slightly alters the size allocation logic as the implicit, minimal size limits of
716 \fIFormat=\fR
717 and
718 \fICopyBlocks=\fR
719 are increased by the space necessary for the LUKS2 superblock (see above)\&.
720 .sp
721 This option has no effect if the partition already exists\&.
722 .sp
723 Added in version 247\&.
724 .RE
725 .PP
726 \fIVerity=\fR
727 .RS 4
728 Takes one of
729 "off",
730 "data",
731 "hash"
732 or
733 "signature"\&. Defaults to
734 "off"\&. If set to
735 "off"
736 or
737 "data", the partition is populated with content as specified by
738 \fICopyBlocks=\fR
739 or
740 \fICopyFiles=\fR\&. If set to
741 "hash", the partition will be populated with verity hashes from the matching verity data partition\&. If set to
742 "signature", the partition will be populated with a JSON object containing a signature of the verity root hash of the matching verity hash partition\&.
743 .sp
744 A matching verity partition is a partition with the same verity match key (as configured with
745 \fIVerityMatchKey=\fR)\&.
746 .sp
747 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
748 \fBsystemd\-repart\fR\&.
749 .sp
750 This option has no effect if the partition already exists\&.
751 .sp
752 Usage of this option in combination with
753 \fIEncrypt=\fR
754 is not supported\&.
755 .sp
756 For each unique
757 \fIVerityMatchKey=\fR
758 value, a single verity data partition ("Verity=data") and a single verity hash partition ("Verity=hash") must be defined\&.
759 .sp
760 Added in version 252\&.
761 .RE
762 .PP
763 \fIVerityMatchKey=\fR
764 .RS 4
765 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
766 \fIVerity=\fR\&.
767 .sp
768 Added in version 252\&.
769 .RE
770 .PP
771 \fIVerityDataBlockSizeBytes=\fR
772 .RS 4
773 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
774 \fBsystemd\-repart\fR
775 is not operating on a block device\&.
776 .sp
777 Added in version 255\&.
778 .RE
779 .PP
780 \fIVerityHashBlockSizeBytes=\fR
781 .RS 4
782 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
783 \fBsystemd\-repart\fR
784 is not operating on a block device\&.
785 .sp
786 Added in version 255\&.
787 .RE
788 .PP
789 \fIFactoryReset=\fR
790 .RS 4
791 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\&.
792 .sp
793 Added in version 245\&.
794 .RE
795 .PP
796 \fIFlags=\fR
797 .RS 4
798 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
799 \fINoAuto=\fR,
800 \fIReadOnly=\fR
801 and
802 \fIGrowFileSystem=\fR; see below for details on the defaults for these three flags\&. Specify the flags value in hexadecimal (by prefixing it with
803 "0x"), binary (prefix
804 "0b") or decimal (no prefix)\&.
805 .sp
806 Added in version 249\&.
807 .RE
808 .PP
809 \fINoAuto=\fR, \fIReadOnly=\fR, \fIGrowFileSystem=\fR
810 .RS 4
811 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
812 \m[blue]\fBUAPI\&.2 Discoverable 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
813 \fIFlags=\fR
814 too, see above\&.
815 .sp
816 If
817 \fIFlags=\fR
818 is used in conjunction with one or more of
819 \fINoAuto=\fR/\fIReadOnly=\fR/\fIGrowFileSystem=\fR
820 the latter control the value of the relevant flags, i\&.e\&. the high\-level settings
821 \fINoAuto=\fR/\fIReadOnly=\fR/\fIGrowFileSystem=\fR
822 override the relevant bits of the low\-level setting
823 \fIFlags=\fR\&.
824 .sp
825 Note that the three flags affect only automatic partition mounting, as implemented by
826 \fBsystemd-gpt-auto-generator\fR(8)
827 or the
828 \fB\-\-image=\fR
829 option of various commands (such as
830 \fBsystemd-nspawn\fR(1))\&. It has no effect on explicit mounts, such as those done via
831 \fBmount\fR(8)
832 or
833 \fBfstab\fR(5)\&.
834 .sp
835 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\&.
836 .sp
837 \fINoAuto=\fR
838 defaults to off\&.
839 \fIReadOnly=\fR
840 defaults to on for Verity partition types, and off for all others\&.
841 \fIGrowFileSystem=\fR
842 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)\&.
843 .sp
844 Added in version 249\&.
845 .RE
846 .PP
847 \fISplitName=\fR
848 .RS 4
849 Configures the suffix to append to split artifacts when the
850 \fB\-\-split\fR
851 option of
852 \fBsystemd-repart\fR(8)
853 is used\&. Simple specifier expansion is supported, see below\&. Defaults to
854 "%t"\&. To disable split artifact generation for a partition, set
855 \fISplitName=\fR
856 to
857 "\-"\&.
858 .sp
859 Added in version 252\&.
860 .RE
861 .PP
862 \fIMinimize=\fR
863 .RS 4
864 Takes one of
865 "off",
866 "best", and
867 "guess"
868 (alternatively, also accepts a boolean value, which is mapped to
869 "off"
870 when false, and
871 "best"
872 when true)\&. Defaults to
873 "off"\&. If set to
874 "best", the partition will have the minimal size required to store the sources configured with
875 \fICopyFiles=\fR\&.
876 "best"
877 is currently only supported for read\-only filesystems\&. If set to
878 "guess", the partition is created at least as big as required to store the sources configured with
879 \fICopyFiles=\fR\&. Note that unless the filesystem is a read\-only filesystem,
880 \fBsystemd\-repart\fR
881 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\&.
882 .sp
883 Added in version 253\&.
884 .RE
885 .PP
886 \fIMountPoint=\fR
887 .RS 4
888 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
889 \fBfstab\fR(5)
890 format\&. As a colon is used for separating fields, each field needs to be quoted when it contains colons\&. E\&.g\&.
891 .sp
892 .if n \{\
893 .RS 4
894 .\}
895 .nf
896 MountPoint="/path/with:colon":"zstd:1,noatime,lazytime"
897 .fi
898 .if n \{\
899 .RE
900 .\}
901 .sp
902 This setting may be specified multiple times to mount the partition multiple times\&. This can be used to add mounts for different
903 \fBbtrfs\fR(8)
904 subvolumes located on the same btrfs partition\&.
905 .sp
906 Note that this setting is only taken into account when
907 \fB\-\-generate\-fstab=\fR
908 is specified on the
909 \fBsystemd\-repart\fR
910 command line\&.
911 .sp
912 Added in version 256\&.
913 .RE
914 .PP
915 \fIEncryptedVolume=\fR
916 .RS 4
917 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
918 /dev/mapper/\&. If not specified,
919 "luks\-UUID"
920 will be used where
921 "UUID"
922 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
923 \fBcrypttab\fR(5)
924 format\&.
925 .sp
926 Note that this setting is only taken into account when
927 \fB\-\-generate\-crypttab=\fR
928 is specified on the
929 \fBsystemd\-repart\fR
930 command line\&.
931 .sp
932 Added in version 256\&.
933 .RE
934 .PP
935 \fITPM2PCRs=\fR
936 .RS 4
937 Configures the list of PCRs to use for LUKS2 volumes configured with the
938 \fIEncrypt=tpm2\fR
939 setting in partition files\&. This option take the same parameters as the similarly named options to
940 \fBsystemd-cryptenroll\fR(1)
941 and have the same effect on partitions where TPM2 enrollment is requested\&. This option will be overridden by the global
942 \fI\-\-tpm2\-pcrs=\fR
943 option\&.
944 .sp
945 Added in version 259\&.
946 .RE
947 .PP
948 \fIKeyFile=\fR
949 .RS 4
950 Takes a file system path\&. This path must be absolute, otherwise the option is ignored\&. Configures the encryption key to use when setting up LUKS2 volumes configured with the
951 \fIEncrypt=key\-file\fR
952 setting in partition files\&. Please refer to the documentation of
953 \fI\-\-key\-file=\fR
954 for more details\&. This option will be overridden by the global
955 \fI\-\-key\-file=\fR
956 option\&.
957 .sp
958 Added in version 259\&.
959 .RE
960 .PP
961 \fICompression=\fR
962 .RS 4
963 Specifies the compression algorithm to use for the filesystem configured with
964 \fIFormat=\fR\&. Takes a single argument specifying the compression algorithm\&.
965 .sp
966 Note that this setting is only taken into account when the filesystem configured with
967 \fIFormat=\fR
968 supports compression (
969 \fBbtrfs\fR(8), squashfs,
970 \fBerofs\fR(5))\&. Here\*(Aqs an incomplete list of compression algorithms supported by the filesystems known to
971 \fBsystemd\-repart\fR:
972 .sp
973 .it 1 an-trap
974 .nr an-no-space-flag 1
975 .nr an-break-flag 1
976 .br
977 .B Table\ \&3.\ \&File System Compression Algorithms
978 .TS
979 allbox tab(:);
980 lB lB lB.
981 T{
982 File System
983 T}:T{
984 Compression Algorithms
985 T}:T{
986 Documentation
987 T}
988 .T&
989 l l l
990 l l l
991 l l l.
992 T{
993 \fBsquashfs\fR
994 T}:T{
995 gzip, lzo, lz4, xz, zstd, lzma
996 T}:T{
997 \fBmksquashfs\fR(1)
998 T}
999 T{
1000 \fBerofs\fR
1001 T}:T{
1002 lz4, lz4hc, lzma, deflate, libdeflate, zstd
1003 T}:T{
1004 \fBmkfs.erofs\fR(1)
1005 T}
1006 T{
1007 \fBbtrfs\fR
1008 T}:T{
1009 zlib, lzo, zstd
1010 T}:T{
1011 \fBmkfs.btrfs\fR(8)
1012 T}
1013 .TE
1014 .sp 1
1015 Added in version 257\&.
1016 .RE
1017 .PP
1018 \fICompressionLevel=\fR
1019 .RS 4
1020 Specifies the compression level to use for the filesystem configured with
1021 \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)\&.
1022 .sp
1023 Note that this setting is only taken into account when the filesystem configured with
1024 \fIFormat=\fR
1025 supports compression and the
1026 \fICompression=\fR
1027 setting is configured explicitly\&.
1028 .sp
1029 Added in version 257\&.
1030 .RE
1031 .PP
1032 \fISupplementFor=\fR
1033 .RS 4
1034 Takes a partition definition name, such as
1035 "10\-esp"\&. If specified,
1036 \fBsystemd\-repart\fR
1037 will avoid creating this partition and instead prefer to partially merge the two definitions\&. However, depending on the existing layout of partitions on disk,
1038 \fBsystemd\-repart\fR
1039 may be forced to fall back onto un\-merging the definitions and using them as originally written, potentially creating this partition\&. Specifically,
1040 \fBsystemd\-repart\fR
1041 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\&.
1042 .sp
1043 The following fields are merged into the target definition in the specified ways:
1044 \fIWeight=\fR
1045 and
1046 \fIPaddingWeight=\fR
1047 are simply overwritten;
1048 \fISizeMinBytes=\fR
1049 and
1050 \fIPaddingMinBytes=\fR
1051 use the larger of the two values;
1052 \fISizeMaxBytes=\fR
1053 and
1054 \fIPaddingMaxBytes=\fR
1055 use the smaller value; and
1056 \fICopyFiles=\fR,
1057 \fIExcludeFiles=\fR,
1058 \fIExcludeFilesTarget=\fR,
1059 \fIMakeDirectories=\fR, and
1060 \fISubvolumes=\fR
1061 are concatenated\&.
1062 .sp
1063 Usage of this option in combination with
1064 \fICopyBlocks=\fR,
1065 \fIEncrypt=\fR, or
1066 \fIVerity=\fR
1067 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\&.
1068 .sp
1069 For example, distributions can use this to implement
1070 \fI$BOOT\fR
1071 as defined in the
1072 \m[blue]\fBUAPI\&.1 Boot Loader Specification\fR\m[]\&\s-2\u[2]\d\s+2\&. Distributions may prefer to use the ESP as
1073 \fI$BOOT\fR
1074 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,
1075 \fBsystemd-repart\fR(8)
1076 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\&.
1077 .sp
1078 As another example, distributions can also use this to seamlessly share a single
1079 /home
1080 partition in a multi\-boot scenario, while preferring to keep
1081 /home
1082 on the root partition by default\&. Having a
1083 /home
1084 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
1085 \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
1086 /home
1087 partition that takes up all the remaining free space\&. On first boot, if
1088 \fBsystemd\-repart\fR
1089 finds an existing
1090 /home
1091 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\&.
1092 .sp
1093 Added in version 257\&.
1094 .RE
1095 .PP
1096 \fIAddValidateFS=\fR
1097 .RS 4
1098 Takes a boolean argument\&. If enabled will set the
1099 \fIuser\&.validatefs\&.gpt_label\fR,
1100 \fIuser\&.validatefs\&.gpt_type_uuid\fR
1101 and
1102 \fIuser\&.validatefs\&.mount_point\fR
1103 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
1104 \fIFormat=\fR
1105 is used and the specified argument is neither
1106 "swap"
1107 nor
1108 "vfat"\&.
1109 .sp
1110 These extended attributes are read by
1111 \[email protected]\fR(8)
1112 and may encode constraints on mounted file systems that must be fulfilled for the system to successfully boot\&. This is particular important in
1113 \fBsystemd-gpt-auto-generator\fR(8)
1114 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\&.
1115 .sp
1116 Added in version 258\&.
1117 .RE
1118 .PP
1119 \fIFileSystemSectorSize=\fR
1120 .RS 4
1121 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\&.
1122 .sp
1123 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\&.
1124 .sp
1125 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\&.
1126 .sp
1127 Added in version 258\&.
1128 .RE
1129 .SH "SPECIFIERS"
1130 .PP
1131 Specifiers may be used in the
1132 \fILabel=\fR,
1133 \fICopyBlocks=\fR,
1134 \fICopyFiles=\fR,
1135 \fIMakeDirectories=\fR,
1136 \fISplitName=\fR
1137 settings\&. The following expansions are understood:
1138 .sp
1139 .it 1 an-trap
1140 .nr an-no-space-flag 1
1141 .nr an-break-flag 1
1142 .br
1143 .B Table\ \&4.\ \&Specifiers available
1144 .TS
1145 allbox tab(:);
1146 lB lB lB.
1147 T{
1148 Specifier
1149 T}:T{
1150 Meaning
1151 T}:T{
1152 Details
1153 T}
1154 .T&
1155 l l l
1156 l l l
1157 l l l
1158 l l l
1159 l l l
1160 l l l
1161 l l l
1162 l l l
1163 l l l
1164 l l l
1165 l l l
1166 l l l
1167 l l l
1168 l l l
1169 l l l
1170 l l l.
1171 T{
1172 "%a"
1173 T}:T{
1174 Architecture
1175 T}:T{
1176 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\&.
1177 T}
1178 T{
1179 "%A"
1180 T}:T{
1181 Operating system image version
1182 T}:T{
1183 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\&.
1184 T}
1185 T{
1186 "%b"
1187 T}:T{
1188 Boot ID
1189 T}:T{
1190 The boot ID of the running system, formatted as string\&. See \fBrandom\fR(4) for more information\&.
1191 T}
1192 T{
1193 "%B"
1194 T}:T{
1195 Operating system build ID
1196 T}:T{
1197 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\&.
1198 T}
1199 T{
1200 "%H"
1201 T}:T{
1202 Host name
1203 T}:T{
1204 The hostname of the running system\&.
1205 T}
1206 T{
1207 "%l"
1208 T}:T{
1209 Short host name
1210 T}:T{
1211 The hostname of the running system, truncated at the first dot to remove any domain component\&.
1212 T}
1213 T{
1214 "%m"
1215 T}:T{
1216 Machine ID
1217 T}:T{
1218 The machine ID of the running system, formatted as string\&. See \fBmachine-id\fR(5) for more information\&.
1219 T}
1220 T{
1221 "%M"
1222 T}:T{
1223 Operating system image identifier
1224 T}:T{
1225 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\&.
1226 T}
1227 T{
1228 "%o"
1229 T}:T{
1230 Operating system ID
1231 T}:T{
1232 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\&.
1233 T}
1234 T{
1235 "%q"
1236 T}:T{
1237 Pretty host name
1238 T}:T{
1239 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\&.
1240 T}
1241 T{
1242 "%v"
1243 T}:T{
1244 Kernel release
1245 T}:T{
1246 Identical to \fBuname \-r\fR output\&.
1247 T}
1248 T{
1249 "%w"
1250 T}:T{
1251 Operating system version ID
1252 T}:T{
1253 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\&.
1254 T}
1255 T{
1256 "%W"
1257 T}:T{
1258 Operating system variant ID
1259 T}:T{
1260 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\&.
1261 T}
1262 T{
1263 "%T"
1264 T}:T{
1265 Directory for temporary files
1266 T}:T{
1267 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\&.)
1268 T}
1269 T{
1270 "%V"
1271 T}:T{
1272 Directory for larger and persistent temporary files
1273 T}:T{
1274 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\&.)
1275 T}
1276 T{
1277 "%%"
1278 T}:T{
1279 Single percent sign
1280 T}:T{
1281 Use "%%" in place of "%" to specify a single percent sign\&.
1282 T}
1283 .TE
1284 .sp 1
1285 .PP
1286 Additionally, for the
1287 \fISplitName=\fR
1288 setting, the following specifiers are also understood:
1289 .sp
1290 .it 1 an-trap
1291 .nr an-no-space-flag 1
1292 .nr an-break-flag 1
1293 .br
1294 .B Table\ \&5.\ \&Specifiers available
1295 .TS
1296 allbox tab(:);
1297 lB lB lB.
1298 T{
1299 Specifier
1300 T}:T{
1301 Meaning
1302 T}:T{
1303 Details
1304 T}
1305 .T&
1306 l l l
1307 l l l
1308 l l l
1309 l l l.
1310 T{
1311 "%T"
1312 T}:T{
1313 Partition Type UUID
1314 T}:T{
1315 The partition type UUID, as configured with \fIType=\fR
1316 T}
1317 T{
1318 "%t"
1319 T}:T{
1320 Partition Type Identifier
1321 T}:T{
1322 The partition type identifier corresponding to the partition type UUID
1323 T}
1324 T{
1325 "%U"
1326 T}:T{
1327 Partition UUID
1328 T}:T{
1329 The partition UUID, as configured with \fIUUID=\fR
1330 T}
1331 T{
1332 "%n"
1333 T}:T{
1334 Partition Number
1335 T}:T{
1336 The partition number assigned to the partition
1337 T}
1338 .TE
1339 .sp 1
1340 .SH "ENVIRONMENT"
1341 .PP
1342 Extra filesystem formatting options can be provided using filesystem\-specific environment variables:
1343 \fI$SYSTEMD_REPART_MKFS_OPTIONS_BTRFS\fR,
1344 \fI$SYSTEMD_REPART_MKFS_OPTIONS_XFS\fR,
1345 \fI$SYSTEMD_REPART_MKFS_OPTIONS_VFAT\fR,
1346 \fI$SYSTEMD_REPART_MKFS_OPTIONS_EROFS\fR, and
1347 \fI$SYSTEMD_REPART_MKFS_OPTIONS_SQUASHFS\fR\&. Each variable accepts valid
1348 \fBmkfs\&.\fR\fB\fIfilesystem\fR\fR
1349 command\-line arguments\&. The content of those variables is passed as\-is to the command, without any verification\&.
1350 .SH "EXAMPLES"
1351 .PP
1352 \fBExample\ \&1.\ \&Grow the root partition to the full disk size at first boot\fR
1353 .PP
1354 With the following file the root partition is automatically grown to the full disk if possible during boot\&.
1355 .PP
1356 .if n \{\
1357 .RS 4
1358 .\}
1359 .nf
1360 # /usr/lib/repart\&.d/50\-root\&.conf
1361 [Partition]
1362 Type=root
1363 .fi
1364 .if n \{\
1365 .RE
1366 .\}
1367
1368 .PP
1369 \fBExample\ \&2.\ \&Create a swap and home partition automatically on boot, if missing\fR
1370 .PP
1371 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\&.
1372 .PP
1373 .if n \{\
1374 .RS 4
1375 .\}
1376 .nf
1377 # /usr/lib/repart\&.d/60\-home\&.conf
1378 [Partition]
1379 Type=home
1380 .fi
1381 .if n \{\
1382 .RE
1383 .\}
1384 .PP
1385 .if n \{\
1386 .RS 4
1387 .\}
1388 .nf
1389 # /usr/lib/repart\&.d/70\-swap\&.conf
1390 [Partition]
1391 Type=swap
1392 SizeMinBytes=64M
1393 SizeMaxBytes=1G
1394 Priority=1
1395 Weight=333
1396 .fi
1397 .if n \{\
1398 .RE
1399 .\}
1400
1401 .PP
1402 \fBExample\ \&3.\ \&Create B partitions in an A/B Verity setup, if missing\fR
1403 .PP
1404 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\&.
1405 .PP
1406 .if n \{\
1407 .RS 4
1408 .\}
1409 .nf
1410 # /usr/lib/repart\&.d/50\-root\&.conf
1411 [Partition]
1412 Type=root
1413 SizeMinBytes=512M
1414 SizeMaxBytes=512M
1415 .fi
1416 .if n \{\
1417 .RE
1418 .\}
1419 .PP
1420 .if n \{\
1421 .RS 4
1422 .\}
1423 .nf
1424 # /usr/lib/repart\&.d/60\-root\-verity\&.conf
1425 [Partition]
1426 Type=root\-verity
1427 SizeMinBytes=64M
1428 SizeMaxBytes=64M
1429 .fi
1430 .if n \{\
1431 .RE
1432 .\}
1433 .PP
1434 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\&.
1435 .PP
1436 .if n \{\
1437 .RS 4
1438 .\}
1439 .nf
1440 # ln \-s 50\-root\&.conf /usr/lib/repart\&.d/70\-root\-b\&.conf
1441 # ln \-s 60\-root\-verity\&.conf /usr/lib/repart\&.d/80\-root\-verity\-b\&.conf
1442 .fi
1443 .if n \{\
1444 .RE
1445 .\}
1446
1447 .PP
1448 \fBExample\ \&4.\ \&Create a data partition and corresponding verity partitions from a OS tree\fR
1449 .PP
1450 Assuming we have an OS tree at
1451 /var/tmp/os\-tree
1452 that we want to package in a root partition together with matching verity partitions, we can do so as follows:
1453 .PP
1454 .if n \{\
1455 .RS 4
1456 .\}
1457 .nf
1458 # 50\-root\&.conf
1459 [Partition]
1460 Type=root
1461 CopyFiles=/var/tmp/os\-tree
1462 Verity=data
1463 VerityMatchKey=root
1464 Minimize=guess
1465 .fi
1466 .if n \{\
1467 .RE
1468 .\}
1469 .PP
1470 .if n \{\
1471 .RS 4
1472 .\}
1473 .nf
1474 # 60\-root\-verity\&.conf
1475 [Partition]
1476 Type=root\-verity
1477 Verity=hash
1478 VerityMatchKey=root
1479 # Explicitly set the hash and data block size to 4K
1480 VerityDataBlockSizeBytes=4096
1481 VerityHashBlockSizeBytes=4096
1482 Minimize=best
1483 .fi
1484 .if n \{\
1485 .RE
1486 .\}
1487 .PP
1488 .if n \{\
1489 .RS 4
1490 .\}
1491 .nf
1492 # 70\-root\-verity\-sig\&.conf
1493 [Partition]
1494 Type=root\-verity\-sig
1495 Verity=signature
1496 VerityMatchKey=root
1497 .fi
1498 .if n \{\
1499 .RE
1500 .\}
1501
1502 .SH "SEE ALSO"
1503 .PP
1504 \fBsystemd\fR(1), \fBsystemd-repart\fR(8), \fBsfdisk\fR(8), \fBsystemd-cryptenroll\fR(1)
1505 .SH "NOTES"
1506 .IP " 1." 4
1507 UAPI.2 Discoverable Partitions Specification
1508 .RS 4
1509 \%https://uapi-group.org/specifications/specs/discoverable_partitions_specification
1510 .RE
1511 .IP " 2." 4
1512 UAPI.1 Boot Loader Specification
1513 .RS 4
1514 \%https://uapi-group.org/specifications/specs/boot_loader_specification/
1515 .RE