Debian Codegraph @

upstream/debian-unstable/man5/repart.d.5

raw
1 '\" t
2 .TH "REPART\&.D" "5" "" "systemd 261~rc3" "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 \fISizeMinBytes=\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 This option cannot be combined with
506 \fICopyBlocks=\fR\&.
507 .sp
508 When
509 \fBsystemd-repart\fR(8)
510 is invoked with the
511 \fB\-\-copy\-source=\fR
512 command line switch the file paths are taken relative to the specified directory\&. If
513 \fB\-\-copy\-source=\fR
514 is not used, but the
515 \fB\-\-image=\fR
516 or
517 \fB\-\-root=\fR
518 switches are used, the source paths are taken relative to the specified root directory or disk image root\&.
519 .sp
520 Note that when
521 \fICopyFiles=\fR
522 is used with
523 \fIFormat=xfs\fR,
524 \fBxfsprogs\fR
525 6\&.17 or newer is required\&.
526 .sp
527 Added in version 247\&.
528 .RE
529 .PP
530 \fIExcludeFiles=\fR, \fIExcludeFilesTarget=\fR
531 .RS 4
532 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
533 \fICopyFiles=\fR
534 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\&.
535 .sp
536 If the path is a directory and ends with
537 "/", only the directory\*(Aqs contents are excluded but not the directory itself\&. If the path is a directory and does not end with
538 "/", both the directory and its contents are excluded\&.
539 .sp
540 \fIExcludeFilesTarget=\fR
541 is like
542 \fIExcludeFiles=\fR
543 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\&.
544 .sp
545 When
546 \fBsystemd-repart\fR(8)
547 is invoked with the
548 \fB\-\-image=\fR
549 or
550 \fB\-\-root=\fR
551 command line switches the paths specified are taken relative to the specified root directory or disk image root\&.
552 .sp
553 Added in version 254\&.
554 .RE
555 .PP
556 \fIMakeDirectories=\fR
557 .RS 4
558 Takes one or more absolute paths, separated by whitespace, each declaring a directory to create within the new file system\&. Behaviour is similar to
559 \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
560 \fICopyFiles=\fR
561 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
562 \fICopyFiles=\fR
563 and
564 \fIMakeDirectories=\fR
565 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)\&.
566 .sp
567 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
568 /usr/
569 in it this way, so that the
570 "usr"
571 partition may over\-mount it\&.
572 .sp
573 Consider using
574 \fBsystemd-tmpfiles\fR(8)
575 with its
576 \fB\-\-image=\fR
577 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\&.
578 .sp
579 Added in version 249\&.
580 .RE
581 .PP
582 \fIMakeSymlinks=\fR
583 .RS 4
584 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
585 \fICopyFiles=\fR
586 and
587 \fIMakeSymlinks=\fR
588 are used together the former is applied first\&.
589 .sp
590 The primary use case for this option is to create symlinks that need to exist before
591 \fBsystemd-tmpfiles\fR(8)
592 is executed\&. For example, when using
593 \fBsystemd-confext\fR(8), this setting can be used to create symlinks in
594 /var/lib/extensions\&.mutable
595 to redirect writes to mutable confexts to a custom location\&.
596 .sp
597 Consider using
598 \fBsystemd-tmpfiles\fR(8)
599 with its
600 \fB\-\-image=\fR
601 option to pre\-create other symlinks (as well as other inodes) with fine\-grained control of ownership, access modes and other file attributes\&.
602 .sp
603 Added in version 257\&.
604 .RE
605 .PP
606 \fISubvolumes=\fR
607 .RS 4
608 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:
609 .sp
610 .it 1 an-trap
611 .nr an-no-space-flag 1
612 .nr an-break-flag 1
613 .br
614 .B Table\ \&2.\ \&Subvolume Flags
615 .TS
616 allbox tab(:);
617 lB lB.
618 T{
619 Flag
620 T}:T{
621 Purpose
622 T}
623 .T&
624 l l
625 l l.
626 T{
627 "ro"
628 T}:T{
629 Make this subvolume read\-only\&.
630 T}
631 T{
632 "nodatacow"
633 T}:T{
634 Disable data CoW for this subvolume\&.
635 T}
636 .TE
637 .sp 1
638 Note that this option does not create the directories themselves, that can be configured with
639 \fIMakeDirectories=\fR
640 and
641 \fICopyFiles=\fR\&.
642 .sp
643 Note that this option only takes effect if the target filesystem supports subvolumes, such as
644 \fBbtrfs\fR(8)\&.
645 .sp
646 Note that this option is only supported in combination with
647 \fB\-\-offline=yes\fR
648 since
649 btrfs\-progs
650 6\&.12 or newer\&.
651 .sp
652 Added in version 255\&.
653 .RE
654 .PP
655 \fIDefaultSubvolume=\fR
656 .RS 4
657 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
658 \fISubvolumes=\fR\&.
659 .sp
660 Note that this option only takes effect if the target filesystem supports subvolumes, such as
661 \fBbtrfs\fR(8)\&.
662 .sp
663 Note that this option is only supported in combination with
664 \fB\-\-offline=yes\fR
665 since
666 btrfs\-progs
667 6\&.12 or newer\&.
668 .sp
669 Added in version 256\&.
670 .RE
671 .PP
672 \fIBlockDeviceReplace=\fR
673 .RS 4
674 Takes a path to a mountpoint\&. Its filesystem\*(Aqs backing device will be replaced with the newly created partition\&. This works only for btrfs filesystems\&. This option is ignored for already existing partitions\&.
675 .sp
676 If after moving the filesystem, an error happens before the writing of the partition table is finished, there will be an attempt to move the filesystem back to its original device\&. But if that attempt also fails, the filesystem might be living on a partition that does not exist in the partition table and will be lost on reboot\&. This feature is intended to save initially volatile mounted filesystems into the new disk with no important data, like a live boot system\&. They might need to be recreated after a failure writing the partition table\&.
677 .sp
678 This option is not compatible with
679 \fB\-\-offline=yes\fR\&.
680 .sp
681 Added in version 261\&.
682 .RE
683 .PP
684 \fIVolumeName=\fR
685 .RS 4
686 If an encrypted partition is created through
687 \fIEncrypt=\fR, and it will stay activated after
688 \fBsystemd\-repart\fR
689 is done (using
690 \fIBlockDeviceReplace=\fR), then the name of the device mapper volume created will use the name specified by
691 \fIVolumeName=\fR\&.
692 .sp
693 The value must be a valid filename\&. If not specified, it will default to the value of
694 \fIVolumeLabel=\fR
695 (which could be derived from
696 \fILabel=\fR) if valid\&.
697 .sp
698 Added in version 261\&.
699 .RE
700 .PP
701 \fIEncrypt=\fR
702 .RS 4
703 Takes one of
704 "off",
705 "key\-file",
706 "tpm2"
707 and
708 "key\-file+tpm2"
709 (alternatively, also accepts a boolean value, which is mapped to
710 "off"
711 when false, and
712 "key\-file"
713 when true)\&. Defaults to
714 "off"\&. If not
715 "off"
716 the partition will be formatted with a LUKS2 superblock, before the blocks configured with
717 \fICopyBlocks=\fR
718 are copied in or the file system configured with
719 \fIFormat=\fR
720 is created\&.
721 .sp
722 The LUKS2 UUID is automatically derived from the partition UUID in a stable fashion\&. If
723 "key\-file"
724 or
725 "key\-file+tpm2"
726 is used, a key is added to the LUKS2 superblock, configurable with the
727 \fB\-\-key\-file=\fR
728 option to
729 \fBsystemd\-repart\fR\&. If
730 "tpm2"
731 or
732 "key\-file+tpm2"
733 is used, a key is added to the LUKS2 superblock that is enrolled to the local TPM2 chip, as configured with the
734 \fB\-\-tpm2\-device=\fR
735 and
736 \fB\-\-tpm2\-pcrs=\fR
737 options to
738 \fBsystemd\-repart\fR\&.
739 .sp
740 When used this slightly alters the size allocation logic as the implicit, minimal size limits of
741 \fIFormat=\fR
742 and
743 \fICopyBlocks=\fR
744 are increased by the space necessary for the LUKS2 superblock (see above)\&.
745 .sp
746 This option has no effect if the partition already exists\&.
747 .sp
748 Added in version 247\&.
749 .RE
750 .PP
751 \fIDiscard=\fR
752 .RS 4
753 Takes a boolean argument\&. The default is
754 "no"
755 if
756 \fB\-\-discard=no\fR
757 is used for the invocation of
758 \fBsystemd\-repart\fR
759 or if
760 \fIIntegrity=inline\fR
761 is set\&. It is
762 "yes"
763 otherwise\&.
764 .sp
765 If set to
766 "yes", when creating the LUKS2 superblock for the partition, the
767 "allow\-discards"
768 activation flag will be set so that future activations will allow discards by default\&.
769 .sp
770 This option has no effect if the partition already exists or if
771 \fIEncrypt=off\fR
772 is used\&.
773 .sp
774 Added in version 261\&.
775 .RE
776 .PP
777 \fIEncryptKDF=\fR
778 .RS 4
779 Specifies the key derivation function (KDF) to use for LUKS2 encryption keyslots\&. Takes one of
780 "argon2id",
781 "pbkdf2", or
782 "minimal"\&. If not specified, the default is determined by the cryptsetup library (typically
783 "argon2id")\&. This option has no effect if
784 \fIEncrypt=\fR
785 is
786 "off"\&.
787 .sp
788 When set to
789 "argon2id"
790 or
791 "pbkdf2", the specified KDF is used with parameters benchmarked by the cryptsetup library\&. When set to
792 "minimal", PBKDF2 is used with SHA\-512, 1000 iterations, and no benchmarking \(em this is appropriate for high\-entropy keys (e\&.g\&. generated by a hardware key manager or sealed to a TPM) where the KDF only needs to satisfy the LUKS2 format requirement, not strengthen a weak passphrase\&.
793 .sp
794 Note that Argon2\-based KDFs may require significant memory (up to 1GB) during key derivation\&. In memory\-constrained environments such as kdump with limited crashkernel memory,
795 "minimal"
796 or
797 "pbkdf2"
798 may be more appropriate\&. When
799 \fIEncrypt=\fR
800 includes
801 "tpm2", the TPM2 keyslot always uses a minimal PBKDF2 configuration regardless of this setting\&.
802 .sp
803 Added in version 261\&.
804 .RE
805 .PP
806 \fIVerity=\fR
807 .RS 4
808 Takes one of
809 "off",
810 "data",
811 "hash"
812 or
813 "signature"\&. Defaults to
814 "off"\&. If set to
815 "off"
816 or
817 "data", the partition is populated with content as specified by
818 \fICopyBlocks=\fR
819 or
820 \fICopyFiles=\fR\&. If set to
821 "hash", the partition will be populated with verity hashes from the matching verity data partition\&. If set to
822 "signature", the partition will be populated with a JSON object containing a signature of the verity root hash of the matching verity hash partition\&.
823 .sp
824 A matching verity partition is a partition with the same verity match key (as configured with
825 \fIVerityMatchKey=\fR)\&.
826 .sp
827 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
828 \fBsystemd\-repart\fR\&.
829 .sp
830 This option has no effect if the partition already exists\&.
831 .sp
832 Usage of this option in combination with
833 \fIEncrypt=\fR
834 is not supported\&.
835 .sp
836 For each unique
837 \fIVerityMatchKey=\fR
838 value, a single verity data partition ("Verity=data") and a single verity hash partition ("Verity=hash") must be defined\&.
839 .sp
840 Added in version 252\&.
841 .RE
842 .PP
843 \fIVerityMatchKey=\fR
844 .RS 4
845 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
846 \fIVerity=\fR\&.
847 .sp
848 Added in version 252\&.
849 .RE
850 .PP
851 \fIVerityDataBlockSizeBytes=\fR
852 .RS 4
853 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
854 \fBsystemd\-repart\fR
855 is not operating on a block device\&.
856 .sp
857 Added in version 255\&.
858 .RE
859 .PP
860 \fIVerityHashBlockSizeBytes=\fR
861 .RS 4
862 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
863 \fBsystemd\-repart\fR
864 is not operating on a block device\&.
865 .sp
866 Added in version 255\&.
867 .RE
868 .PP
869 \fIFactoryReset=\fR
870 .RS 4
871 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\&.
872 .sp
873 Added in version 245\&.
874 .RE
875 .PP
876 \fIFlags=\fR
877 .RS 4
878 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
879 \fINoAuto=\fR,
880 \fIReadOnly=\fR
881 and
882 \fIGrowFileSystem=\fR; see below for details on the defaults for these three flags\&. Specify the flags value in hexadecimal (by prefixing it with
883 "0x"), binary (prefix
884 "0b") or decimal (no prefix)\&.
885 .sp
886 Added in version 249\&.
887 .RE
888 .PP
889 \fINoAuto=\fR, \fIReadOnly=\fR, \fIGrowFileSystem=\fR
890 .RS 4
891 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
892 \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
893 \fIFlags=\fR
894 too, see above\&.
895 .sp
896 If
897 \fIFlags=\fR
898 is used in conjunction with one or more of
899 \fINoAuto=\fR/\fIReadOnly=\fR/\fIGrowFileSystem=\fR
900 the latter control the value of the relevant flags, i\&.e\&. the high\-level settings
901 \fINoAuto=\fR/\fIReadOnly=\fR/\fIGrowFileSystem=\fR
902 override the relevant bits of the low\-level setting
903 \fIFlags=\fR\&.
904 .sp
905 Note that the three flags affect only automatic partition mounting, as implemented by
906 \fBsystemd-gpt-auto-generator\fR(8)
907 or the
908 \fB\-\-image=\fR
909 option of various commands (such as
910 \fBsystemd-nspawn\fR(1))\&. It has no effect on explicit mounts, such as those done via
911 \fBmount\fR(8)
912 or
913 \fBfstab\fR(5)\&.
914 .sp
915 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\&.
916 .sp
917 \fINoAuto=\fR
918 defaults to off\&.
919 \fIReadOnly=\fR
920 defaults to on for Verity partition types, and off for all others\&.
921 \fIGrowFileSystem=\fR
922 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)\&.
923 .sp
924 Added in version 249\&.
925 .RE
926 .PP
927 \fISplitName=\fR
928 .RS 4
929 Configures the suffix to append to split artifacts when the
930 \fB\-\-split\fR
931 option of
932 \fBsystemd-repart\fR(8)
933 is used\&. Simple specifier expansion is supported, see below\&. Defaults to
934 "%t"\&. To disable split artifact generation for a partition, set
935 \fISplitName=\fR
936 to
937 "\-"\&.
938 .sp
939 Added in version 252\&.
940 .RE
941 .PP
942 \fIMinimize=\fR
943 .RS 4
944 Takes one of
945 "off",
946 "best", and
947 "guess"
948 (alternatively, also accepts a boolean value, which is mapped to
949 "off"
950 when false, and
951 "best"
952 when true)\&. Defaults to
953 "off"\&. If set to
954 "best", the partition will have the minimal size required to store the sources configured with
955 \fICopyFiles=\fR\&.
956 "best"
957 is currently only supported for read\-only filesystems and btrfs\&. If set to
958 "guess", the partition is created at least as big as required to store the sources configured with
959 \fICopyFiles=\fR\&. Note that unless the filesystem is a read\-only filesystem or btrfs,
960 \fBsystemd\-repart\fR
961 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\&.
962 .sp
963 Added in version 253\&.
964 .RE
965 .PP
966 \fIMountPoint=\fR
967 .RS 4
968 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
969 \fBfstab\fR(5)
970 format\&. As a colon is used for separating fields, each field needs to be quoted when it contains colons\&. E\&.g\&.
971 .sp
972 .if n \{\
973 .RS 4
974 .\}
975 .nf
976 MountPoint="/path/with:colon":"zstd:1,noatime,lazytime"
977 .fi
978 .if n \{\
979 .RE
980 .\}
981 .sp
982 This setting may be specified multiple times to mount the partition multiple times\&. This can be used to add mounts for different
983 \fBbtrfs\fR(8)
984 subvolumes located on the same btrfs partition\&.
985 .sp
986 Note that this setting is only taken into account when
987 \fB\-\-generate\-fstab=\fR
988 is specified on the
989 \fBsystemd\-repart\fR
990 command line\&.
991 .sp
992 Added in version 256\&.
993 .RE
994 .PP
995 \fIEncryptedVolume=\fR
996 .RS 4
997 Specifies how the encrypted partition should be set up\&. Takes at least one and at most four fields separated with a colon (":")\&. The first field specifies the encrypted volume name under
998 /dev/mapper/\&. If not specified,
999 "luks\-UUID"
1000 will be used where
1001 "UUID"
1002 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 three fields correspond to the first, third and fourth column of the
1003 \fBcrypttab\fR(5)
1004 format\&. The fourth field contains extra options, which are not directly reflected to crypttab options\&. Currently, the only supported extra option is
1005 \fIfixate\-volume\-key\fR\&. When specified, the volume key hash will be taken upon LUKS volume formatting and the result will be added to the list of crypttab options, i\&.e\&.
1006 \fIfixate\-volume\-key=expected\-hash\fR
1007 will be added to the fourth column of the generated crypttab\&.
1008 .sp
1009 Note that this setting is only taken into account when
1010 \fB\-\-generate\-crypttab=\fR
1011 is specified on the
1012 \fBsystemd\-repart\fR
1013 command line\&. As the crypttab with the expected hashes can only be generated after LUKS volumes are formatted, the crypttab itself cannot be put to the generated volume\&.
1014 .sp
1015 Added in version 256\&.
1016 .RE
1017 .PP
1018 \fITPM2PCRs=\fR
1019 .RS 4
1020 Configures the list of PCRs to use for LUKS2 volumes configured with the
1021 \fIEncrypt=tpm2\fR
1022 setting in partition files\&. This option take the same parameters as the similarly named options to
1023 \fBsystemd-cryptenroll\fR(1)
1024 and have the same effect on partitions where TPM2 enrollment is requested\&. This option will be overridden by the global
1025 \fI\-\-tpm2\-pcrs=\fR
1026 option\&.
1027 .sp
1028 Added in version 259\&.
1029 .RE
1030 .PP
1031 \fIKeyFile=\fR
1032 .RS 4
1033 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
1034 \fIEncrypt=key\-file\fR
1035 setting in partition files\&. Please refer to the documentation of
1036 \fI\-\-key\-file=\fR
1037 for more details\&. This option will be overridden by the global
1038 \fI\-\-key\-file=\fR
1039 option\&.
1040 .sp
1041 Added in version 259\&.
1042 .RE
1043 .PP
1044 \fIIntegrity=\fR
1045 .RS 4
1046 Enable integrity checking for the partition\&. Currently, the only supported option is
1047 \fIIntegrity=inline\fR
1048 which enables authenticated disk encryption for LUKS2 devices\&. The option requires
1049 \fIEncrypt=\fR
1050 setting and can only be used in online image build\&. Defaults to
1051 "off", i\&.e\&. integrity protection is disabled\&.
1052 .sp
1053 Note: authenticated disk encryption is considered EXPERIMENTAL by cryptsetup\&.
1054 .sp
1055 Added in version 260\&.
1056 .RE
1057 .PP
1058 \fIIntegrityAlgorithm=\fR
1059 .RS 4
1060 Specify the integrity algorithm to be used for integrity verification\&. For
1061 \fIIntegrity=inline\fR
1062 the supported values are:
1063 "hmac\-sha1",
1064 "hmac\-sha256"(default), and
1065 "hmac\-sha512"\&.
1066 .sp
1067 Added in version 260\&.
1068 .RE
1069 .PP
1070 \fICompression=\fR
1071 .RS 4
1072 Specifies the compression algorithm to use for the filesystem configured with
1073 \fIFormat=\fR\&. Takes a single argument specifying the compression algorithm\&.
1074 .sp
1075 Note that this setting is only taken into account when the filesystem configured with
1076 \fIFormat=\fR
1077 supports compression (
1078 \fBbtrfs\fR(8), squashfs,
1079 \fBerofs\fR(5))\&. Here\*(Aqs an incomplete list of compression algorithms supported by the filesystems known to
1080 \fBsystemd\-repart\fR:
1081 .sp
1082 .it 1 an-trap
1083 .nr an-no-space-flag 1
1084 .nr an-break-flag 1
1085 .br
1086 .B Table\ \&3.\ \&File System Compression Algorithms
1087 .TS
1088 allbox tab(:);
1089 lB lB lB.
1090 T{
1091 File System
1092 T}:T{
1093 Compression Algorithms
1094 T}:T{
1095 Documentation
1096 T}
1097 .T&
1098 l l l
1099 l l l
1100 l l l.
1101 T{
1102 \fBsquashfs\fR
1103 T}:T{
1104 gzip, lzo, lz4, xz, zstd, lzma
1105 T}:T{
1106 \fBmksquashfs\fR(1)
1107 T}
1108 T{
1109 \fBerofs\fR
1110 T}:T{
1111 lz4, lz4hc, lzma, deflate, libdeflate, zstd
1112 T}:T{
1113 \fBmkfs.erofs\fR(1)
1114 T}
1115 T{
1116 \fBbtrfs\fR
1117 T}:T{
1118 zlib, lzo, zstd
1119 T}:T{
1120 \fBmkfs.btrfs\fR(8)
1121 T}
1122 .TE
1123 .sp 1
1124 Added in version 257\&.
1125 .RE
1126 .PP
1127 \fICompressionLevel=\fR
1128 .RS 4
1129 Specifies the compression level to use for the filesystem configured with
1130 \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)\&.
1131 .sp
1132 Note that this setting is only taken into account when the filesystem configured with
1133 \fIFormat=\fR
1134 supports compression and the
1135 \fICompression=\fR
1136 setting is configured explicitly\&.
1137 .sp
1138 Added in version 257\&.
1139 .RE
1140 .PP
1141 \fISupplementFor=\fR
1142 .RS 4
1143 Takes a partition definition name, such as
1144 "10\-esp"\&. If specified,
1145 \fBsystemd\-repart\fR
1146 will avoid creating this partition and instead prefer to partially merge the two definitions\&. However, depending on the existing layout of partitions on disk,
1147 \fBsystemd\-repart\fR
1148 may be forced to fall back onto un\-merging the definitions and using them as originally written, potentially creating this partition\&. Specifically,
1149 \fBsystemd\-repart\fR
1150 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\&.
1151 .sp
1152 The following fields are merged into the target definition in the specified ways:
1153 \fIWeight=\fR
1154 and
1155 \fIPaddingWeight=\fR
1156 are simply overwritten;
1157 \fISizeMinBytes=\fR
1158 and
1159 \fIPaddingMinBytes=\fR
1160 use the larger of the two values;
1161 \fISizeMaxBytes=\fR
1162 and
1163 \fIPaddingMaxBytes=\fR
1164 use the smaller value; and
1165 \fICopyFiles=\fR,
1166 \fIExcludeFiles=\fR,
1167 \fIExcludeFilesTarget=\fR,
1168 \fIMakeDirectories=\fR, and
1169 \fISubvolumes=\fR
1170 are concatenated\&.
1171 .sp
1172 Usage of this option in combination with
1173 \fICopyBlocks=\fR,
1174 \fIEncrypt=\fR, or
1175 \fIVerity=\fR
1176 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\&.
1177 .sp
1178 For example, distributions can use this to implement
1179 \fI$BOOT\fR
1180 as defined in the
1181 \m[blue]\fBUAPI\&.1 Boot Loader Specification\fR\m[]\&\s-2\u[2]\d\s+2\&. Distributions may prefer to use the ESP as
1182 \fI$BOOT\fR
1183 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,
1184 \fBsystemd-repart\fR(8)
1185 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\&.
1186 .sp
1187 As another example, distributions can also use this to seamlessly share a single
1188 /home
1189 partition in a multi\-boot scenario, while preferring to keep
1190 /home
1191 on the root partition by default\&. Having a
1192 /home
1193 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
1194 \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
1195 /home
1196 partition that takes up all the remaining free space\&. On first boot, if
1197 \fBsystemd\-repart\fR
1198 finds an existing
1199 /home
1200 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\&.
1201 .sp
1202 Added in version 257\&.
1203 .RE
1204 .PP
1205 \fIAddValidateFS=\fR
1206 .RS 4
1207 Takes a boolean argument\&. If enabled will set the
1208 \fIuser\&.validatefs\&.gpt_label\fR,
1209 \fIuser\&.validatefs\&.gpt_type_uuid\fR
1210 and
1211 \fIuser\&.validatefs\&.mount_point\fR
1212 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
1213 \fIFormat=\fR
1214 is used and the specified argument is neither
1215 "swap"
1216 nor
1217 "vfat"\&.
1218 .sp
1219 These extended attributes are read by
1220 \[email protected]\fR(8)
1221 and may encode constraints on mounted file systems that must be fulfilled for the system to successfully boot\&. This is particular important in
1222 \fBsystemd-gpt-auto-generator\fR(8)
1223 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\&.
1224 .sp
1225 Added in version 258\&.
1226 .RE
1227 .PP
1228 \fIFileSystemSectorSize=\fR
1229 .RS 4
1230 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\&.
1231 .sp
1232 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\&.
1233 .sp
1234 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\&.
1235 .sp
1236 Added in version 258\&.
1237 .RE
1238 .SH "SPECIFIERS"
1239 .PP
1240 Specifiers may be used in the
1241 \fILabel=\fR,
1242 \fICopyBlocks=\fR,
1243 \fICopyFiles=\fR,
1244 \fIMakeDirectories=\fR,
1245 \fISplitName=\fR
1246 settings\&. The following expansions are 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\ \&4.\ \&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 l l l
1269 l l l
1270 l l l
1271 l l l
1272 l l l
1273 l l l
1274 l l l
1275 l l l
1276 l l l
1277 l l l
1278 l l l
1279 l l l.
1280 T{
1281 "%a"
1282 T}:T{
1283 Architecture
1284 T}:T{
1285 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\&.
1286 T}
1287 T{
1288 "%A"
1289 T}:T{
1290 Operating system image version
1291 T}:T{
1292 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\&.
1293 T}
1294 T{
1295 "%b"
1296 T}:T{
1297 Boot ID
1298 T}:T{
1299 The boot ID of the running system, formatted as string\&. See \fBrandom\fR(4) for more information\&.
1300 T}
1301 T{
1302 "%B"
1303 T}:T{
1304 Operating system build ID
1305 T}:T{
1306 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\&.
1307 T}
1308 T{
1309 "%H"
1310 T}:T{
1311 Host name
1312 T}:T{
1313 The hostname of the running system\&.
1314 T}
1315 T{
1316 "%l"
1317 T}:T{
1318 Short host name
1319 T}:T{
1320 The hostname of the running system, truncated at the first dot to remove any domain component\&.
1321 T}
1322 T{
1323 "%m"
1324 T}:T{
1325 Machine ID
1326 T}:T{
1327 The machine ID of the running system, formatted as string\&. See \fBmachine-id\fR(5) for more information\&.
1328 T}
1329 T{
1330 "%M"
1331 T}:T{
1332 Operating system image identifier
1333 T}:T{
1334 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\&.
1335 T}
1336 T{
1337 "%o"
1338 T}:T{
1339 Operating system ID
1340 T}:T{
1341 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\&.
1342 T}
1343 T{
1344 "%q"
1345 T}:T{
1346 Pretty host name
1347 T}:T{
1348 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\&.
1349 T}
1350 T{
1351 "%v"
1352 T}:T{
1353 Kernel release
1354 T}:T{
1355 Identical to \fBuname \-r\fR output\&.
1356 T}
1357 T{
1358 "%w"
1359 T}:T{
1360 Operating system version ID
1361 T}:T{
1362 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\&.
1363 T}
1364 T{
1365 "%W"
1366 T}:T{
1367 Operating system variant ID
1368 T}:T{
1369 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\&.
1370 T}
1371 T{
1372 "%T"
1373 T}:T{
1374 Directory for temporary files
1375 T}:T{
1376 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\&.)
1377 T}
1378 T{
1379 "%V"
1380 T}:T{
1381 Directory for larger and persistent temporary files
1382 T}:T{
1383 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\&.)
1384 T}
1385 T{
1386 "%%"
1387 T}:T{
1388 Single percent sign
1389 T}:T{
1390 Use "%%" in place of "%" to specify a single percent sign\&.
1391 T}
1392 .TE
1393 .sp 1
1394 .PP
1395 Additionally, for the
1396 \fISplitName=\fR
1397 setting, the following specifiers are also understood:
1398 .sp
1399 .it 1 an-trap
1400 .nr an-no-space-flag 1
1401 .nr an-break-flag 1
1402 .br
1403 .B Table\ \&5.\ \&Specifiers available
1404 .TS
1405 allbox tab(:);
1406 lB lB lB.
1407 T{
1408 Specifier
1409 T}:T{
1410 Meaning
1411 T}:T{
1412 Details
1413 T}
1414 .T&
1415 l l l
1416 l l l
1417 l l l
1418 l l l.
1419 T{
1420 "%T"
1421 T}:T{
1422 Partition Type UUID
1423 T}:T{
1424 The partition type UUID, as configured with \fIType=\fR
1425 T}
1426 T{
1427 "%t"
1428 T}:T{
1429 Partition Type Identifier
1430 T}:T{
1431 The partition type identifier corresponding to the partition type UUID
1432 T}
1433 T{
1434 "%U"
1435 T}:T{
1436 Partition UUID
1437 T}:T{
1438 The partition UUID, as configured with \fIUUID=\fR
1439 T}
1440 T{
1441 "%n"
1442 T}:T{
1443 Partition Number
1444 T}:T{
1445 The partition number assigned to the partition
1446 T}
1447 .TE
1448 .sp 1
1449 .SH "ENVIRONMENT"
1450 .PP
1451 Extra filesystem formatting options can be provided using filesystem\-specific environment variables:
1452 \fI$SYSTEMD_REPART_MKFS_OPTIONS_BTRFS\fR,
1453 \fI$SYSTEMD_REPART_MKFS_OPTIONS_XFS\fR,
1454 \fI$SYSTEMD_REPART_MKFS_OPTIONS_VFAT\fR,
1455 \fI$SYSTEMD_REPART_MKFS_OPTIONS_EROFS\fR, and
1456 \fI$SYSTEMD_REPART_MKFS_OPTIONS_SQUASHFS\fR\&. Each variable accepts valid
1457 \fBmkfs\&.\fR\fB\fIfilesystem\fR\fR
1458 command\-line arguments\&. The content of those variables is passed as\-is to the command, without any verification\&.
1459 .SH "EXAMPLES"
1460 .PP
1461 \fBExample\ \&1.\ \&Grow the root partition to the full disk size at first boot\fR
1462 .PP
1463 With the following file the root partition is automatically grown to the full disk if possible during boot\&.
1464 .PP
1465 .if n \{\
1466 .RS 4
1467 .\}
1468 .nf
1469 # /usr/lib/repart\&.d/50\-root\&.conf
1470 [Partition]
1471 Type=root
1472 .fi
1473 .if n \{\
1474 .RE
1475 .\}
1476
1477 .PP
1478 \fBExample\ \&2.\ \&Create a swap and home partition automatically on boot, if missing\fR
1479 .PP
1480 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\&.
1481 .PP
1482 .if n \{\
1483 .RS 4
1484 .\}
1485 .nf
1486 # /usr/lib/repart\&.d/60\-home\&.conf
1487 [Partition]
1488 Type=home
1489 .fi
1490 .if n \{\
1491 .RE
1492 .\}
1493 .PP
1494 .if n \{\
1495 .RS 4
1496 .\}
1497 .nf
1498 # /usr/lib/repart\&.d/70\-swap\&.conf
1499 [Partition]
1500 Type=swap
1501 SizeMinBytes=64M
1502 SizeMaxBytes=1G
1503 Priority=1
1504 Weight=333
1505 .fi
1506 .if n \{\
1507 .RE
1508 .\}
1509
1510 .PP
1511 \fBExample\ \&3.\ \&Create B partitions in an A/B Verity setup, if missing\fR
1512 .PP
1513 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\&.
1514 .PP
1515 .if n \{\
1516 .RS 4
1517 .\}
1518 .nf
1519 # /usr/lib/repart\&.d/50\-root\&.conf
1520 [Partition]
1521 Type=root
1522 SizeMinBytes=512M
1523 SizeMaxBytes=512M
1524 .fi
1525 .if n \{\
1526 .RE
1527 .\}
1528 .PP
1529 .if n \{\
1530 .RS 4
1531 .\}
1532 .nf
1533 # /usr/lib/repart\&.d/60\-root\-verity\&.conf
1534 [Partition]
1535 Type=root\-verity
1536 SizeMinBytes=64M
1537 SizeMaxBytes=64M
1538 .fi
1539 .if n \{\
1540 .RE
1541 .\}
1542 .PP
1543 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\&.
1544 .PP
1545 .if n \{\
1546 .RS 4
1547 .\}
1548 .nf
1549 # ln \-s 50\-root\&.conf /usr/lib/repart\&.d/70\-root\-b\&.conf
1550 # ln \-s 60\-root\-verity\&.conf /usr/lib/repart\&.d/80\-root\-verity\-b\&.conf
1551 .fi
1552 .if n \{\
1553 .RE
1554 .\}
1555
1556 .PP
1557 \fBExample\ \&4.\ \&Create a data partition and corresponding verity partitions from a OS tree\fR
1558 .PP
1559 Assuming we have an OS tree at
1560 /var/tmp/os\-tree
1561 that we want to package in a root partition together with matching verity partitions, we can do so as follows:
1562 .PP
1563 .if n \{\
1564 .RS 4
1565 .\}
1566 .nf
1567 # 50\-root\&.conf
1568 [Partition]
1569 Type=root
1570 CopyFiles=/var/tmp/os\-tree
1571 Verity=data
1572 VerityMatchKey=root
1573 Minimize=guess
1574 .fi
1575 .if n \{\
1576 .RE
1577 .\}
1578 .PP
1579 .if n \{\
1580 .RS 4
1581 .\}
1582 .nf
1583 # 60\-root\-verity\&.conf
1584 [Partition]
1585 Type=root\-verity
1586 Verity=hash
1587 VerityMatchKey=root
1588 # Explicitly set the hash and data block size to 4K
1589 VerityDataBlockSizeBytes=4096
1590 VerityHashBlockSizeBytes=4096
1591 Minimize=best
1592 .fi
1593 .if n \{\
1594 .RE
1595 .\}
1596 .PP
1597 .if n \{\
1598 .RS 4
1599 .\}
1600 .nf
1601 # 70\-root\-verity\-sig\&.conf
1602 [Partition]
1603 Type=root\-verity\-sig
1604 Verity=signature
1605 VerityMatchKey=root
1606 .fi
1607 .if n \{\
1608 .RE
1609 .\}
1610
1611 .SH "SEE ALSO"
1612 .PP
1613 \fBsystemd\fR(1), \fBsystemd-repart\fR(8), \fBsfdisk\fR(8), \fBsystemd-cryptenroll\fR(1)
1614 .SH "NOTES"
1615 .IP " 1." 4
1616 UAPI.2 Discoverable Partitions Specification
1617 .RS 4
1618 \%https://uapi-group.org/specifications/specs/discoverable_partitions_specification
1619 .RE
1620 .IP " 2." 4
1621 UAPI.1 Boot Loader Specification
1622 .RS 4
1623 \%https://uapi-group.org/specifications/specs/boot_loader_specification/
1624 .RE