# repart.d

## NAME



           repart.d - Partition Definition Files for Automatic Boot-Time
           Repartitioning
    


## SYNOPSIS



               /etc/repart.d/*.conf
               /run/repart.d/*.conf
               /usr/local/lib/repart.d/*.conf
               /usr/lib/repart.d/*.conf
    


## DESCRIPTION



           repart.d/*.conf 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
           systemd-repart(8) 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.
    
           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.
    
           Currently, support for partition definition files is only
           implemented for GPT partition tables.
    
           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.
    
           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 systemd-growfs(8) may be used to grow
           the file systems inside of these partitions. Partitions may also
           be marked for automatic growing via the _GrowFileSystem=_ setting,
           in which case the file system is grown on first mount by tools
           that respect this flag. See below for details.
    


## [PARTITION] SECTION OPTIONS



           _Type=_
               The GPT partition type UUID to match. This may be a GPT
               partition type UUID such as
               **4f68bce3-e8cd-4db1-96e7-fbcaf984b709** , or an identifier.
    
               The supported identifiers are:
    
               **Table 1. GPT partition type identifiers**
               ┌───────────────────────────┬──────────────────────────┐
               │ **Identifier** │ **Explanation** │
               ├───────────────────────────┼──────────────────────────┤
               │ **esp** │ EFI System Partition     │
               ├───────────────────────────┼──────────────────────────┤
               │ **xbootldr** │ Extended Boot Loader     │
               │                           │ Partition                │
               ├───────────────────────────┼──────────────────────────┤
               │ **swap** │ Swap partition           │
               ├───────────────────────────┼──────────────────────────┤
               │ **home** │ Home (/home/) partition  │
               ├───────────────────────────┼──────────────────────────┤
               │ **srv** │ Server data (/srv/)      │
               │                           │ partition                │
               ├───────────────────────────┼──────────────────────────┤
               │ **var** │ Variable data (/var/)    │
               │                           │ partition                │
               ├───────────────────────────┼──────────────────────────┤
               │ **tmp** │ Temporary data           │
               │                           │ (/var/tmp/) partition    │
               ├───────────────────────────┼──────────────────────────┤
               │ **linux-generic** │ Generic Linux file       │
               │                           │ system partition         │
               ├───────────────────────────┼──────────────────────────┤
               │ **root** │ Root file system         │
               │                           │ partition type           │
               │                           │ appropriate for the      │
               │                           │ local architecture (an   │
               │                           │ alias for an             │
               │                           │ architecture root file   │
               │                           │ system partition type    │
               │                           │ listed below, e.g.       │
               │                           │ **root-x86-64**)             │
               ├───────────────────────────┼──────────────────────────┤
               │ **root-verity** │ Verity data for the root │
               │                           │ file system partition    │
               │                           │ for the local            │
               │                           │ architecture             │
               ├───────────────────────────┼──────────────────────────┤
               │ **root-verity-sig** │ Verity signature data    │
               │                           │ for the root file system │
               │                           │ partition for the local  │
               │                           │ architecture             │
               ├───────────────────────────┼──────────────────────────┤
               │ **root-secondary** │ Root file system         │
               │                           │ partition of the         │
               │                           │ secondary architecture   │
               │                           │ of the local             │
               │                           │ architecture (usually    │
               │                           │ the matching 32-bit      │
               │                           │ architecture for the     │
               │                           │ local 64-bit             │
               │                           │ architecture)            │
               ├───────────────────────────┼──────────────────────────┤
               │ **root-secondary-verity** │ Verity data for the root │
               │                           │ file system partition of │
               │                           │ the secondary            │
               │                           │ architecture             │
               ├───────────────────────────┼──────────────────────────┤
               │ **root-secondary-verity-sig** │ Verity signature data    │
               │                           │ for the root file system │
               │                           │ partition of the         │
               │                           │ secondary architecture   │
               ├───────────────────────────┼──────────────────────────┤
               │ **root-{arch}** │ Root file system         │
               │                           │ partition of the given   │
               │                           │ architecture (such as    │
               │                           │ **root-x86-64** or           │
               │                           │ **root-riscv64**)            │
               ├───────────────────────────┼──────────────────────────┤
               │ **root-{arch}-verity** │ Verity data for the root │
               │                           │ file system partition of │
               │                           │ the given architecture   │
               ├───────────────────────────┼──────────────────────────┤
               │ **root-{arch}-verity-sig** │ Verity signature data    │
               │                           │ for the root file system │
               │                           │ partition of the given   │
               │                           │ architecture             │
               ├───────────────────────────┼──────────────────────────┤
               │ **usr** │ /usr/ file system        │
               │                           │ partition type           │
               │                           │ appropriate for the      │
               │                           │ local architecture (an   │
               │                           │ alias for an             │
               │                           │ architecture /usr/ file  │
               │                           │ system partition type    │
               │                           │ listed below, e.g.       │
               │                           │ **usr-x86-64**)              │
               ├───────────────────────────┼──────────────────────────┤
               │ **usr-verity** │ Verity data for the      │
               │                           │ /usr/ file system        │
               │                           │ partition for the local  │
               │                           │ architecture             │
               ├───────────────────────────┼──────────────────────────┤
               │ **usr-verity-sig** │ Verity signature data    │
               │                           │ for the /usr/ file       │
               │                           │ system partition for the │
               │                           │ local architecture       │
               ├───────────────────────────┼──────────────────────────┤
               │ **usr-secondary** │ /usr/ file system        │
               │                           │ partition of the         │
               │                           │ secondary architecture   │
               │                           │ of the local             │
               │                           │ architecture (usually    │
               │                           │ the matching 32-bit      │
               │                           │ architecture for the     │
               │                           │ local 64-bit             │
               │                           │ architecture)            │
               ├───────────────────────────┼──────────────────────────┤
               │ **usr-secondary-verity** │ Verity data for the      │
               │                           │ /usr/ file system        │
               │                           │ partition of the         │
               │                           │ secondary architecture   │
               ├───────────────────────────┼──────────────────────────┤
               │ **usr-secondary-verity-sig** │ Verity signature data    │
               │                           │ for the /usr/ file       │
               │                           │ system partition of the  │
               │                           │ secondary architecture   │
               ├───────────────────────────┼──────────────────────────┤
               │ **usr-{arch}** │ /usr/ file system        │
               │                           │ partition of the given   │
               │                           │ architecture             │
               ├───────────────────────────┼──────────────────────────┤
               │ **usr-{arch}-verity** │ Verity data for the      │
               │                           │ /usr/ file system        │
               │                           │ partition of the given   │
               │                           │ architecture             │
               ├───────────────────────────┼──────────────────────────┤
               │ **usr-{arch}-verity-sig** │ Verity signature data    │
               │                           │ for the /usr/ file       │
               │                           │ system partition of the  │
               │                           │ given architecture       │
               └───────────────────────────┴──────────────────────────┘
    
               Architecture specific partition types can use one of these
               architecture identifiers: **alpha** , **arc** , **arm**(32-bit), **arm64**
               (64-bit, aka aarch64), **ia64** , **loongarch64** , **mips-le** , **mips64-le** ,
               **parisc** , **ppc** , **ppc64** , **ppc64-le** , **riscv32** , **riscv64** , **s390** , **s390x** ,
               **tilegx** , **x86**(32-bit, aka i386) and **x86-64**(64-bit, aka amd64).
    
               Most of the partition type UUIDs listed above are defined in
               the **Discoverable Partitions Specification******[1].
    
               Added in version 245._Label=_
               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.
    
               Added in version 245.
    
           _UUID=_
               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 "null", the
               UUID is set to all zeroes. If not specified a UUID derived
               from the partition type is automatically used.
    
               Added in version 246.
    
           _Priority=_
               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.
    
               Added in version 245.
    
           _Weight=_
               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 _SizeMinBytes=_ ,
               _SizeMaxBytes=_), 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.
    
               The _Weight=_ 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
               _SizeMinBytes=_ and _SizeMaxBytes=_ with the same value in order
               to fixate the size to one value, in which case the weight has
               no effect.
    
               Added in version 245.
    
           _PaddingWeight=_
               Similar to _Weight=_ , 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.
    
               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.
    
               Added in version 245.
    
           _SizeMinBytes=_ , _SizeMaxBytes=_
               Specifies minimum and maximum size constraints in bytes. Takes
               the usual K, M, G, T, ... suffixes (to the base of 1024). If
               _SizeMinBytes=_ is specified the partition is created at or
               grown to at least the specified size. If _SizeMaxBytes=_ 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 _Weight=_ , see above. When
               _SizeMinBytes=_ is set equal to _SizeMaxBytes=_ 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 _SizeMinBytes=_)
               or downwards (in case of _SizeMaxBytes=_) 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 _Priority=_
               (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.
    
               If _Format=_ 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.
    
               Added in version 245.
    
           _PaddingMinBytes=_ , _PaddingMaxBytes=_
               Specifies minimum and maximum size constraints in bytes for
               the free space after the partition (the "padding"). Semantics
               are similar to _SizeMinBytes=_ and _SizeMaxBytes=_ , 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 _PaddingWeight=_ determines the size of the
               padding applied.
    
               Added in version 245.
    
           _CopyBlocks=_
               Takes a path to a regular file, block device node, char device
               node or directory, or the special value "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 — for example to build a
               simple OS installer or an OS image builder. Specify
               /dev/urandom as value to initialize a partition with random
               data.
    
               If the special value "auto" is specified, the source to copy
               from is automatically picked up from the running system (or
               the image specified with **--image=** — if used). A partition that
               matches both the configured partition type (as declared with
               _Type=_ described above), and the currently mounted directory
               appropriate for that partition type is determined. For
               example, if the partition type is set to "root" the partition
               backing the root directory (/) is used as source to copy from
               — if its partition type is set to "root" as well. If the
               declared type is "usr" the partition backing /usr/ is used as
               source to copy blocks from — if its partition type is set to
               "usr" too. The logic is capable of automatically tracking down
               the backing partitions for encrypted and Verity-enabled
               volumes.  "CopyBlocks=auto" is useful for implementing
               "self-replicating" systems, i.e. systems that are their own
               installer.
    
               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 _SizeMin=_ value configured
               above.
    
               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.
    
               This option cannot be combined with _Format=_ or _CopyFiles=_.
    
               Added in version 246.
    
           _Format=_
               Takes a file system name, such as "ext4", "btrfs", "xfs",
               "vfat", "erofs", "squashfs" or the special value "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).
    
               This also takes a special meta value "empty". If specified
               this is equivalent to specifying "Label=_empty" and
               "NoAuto=1".
    
               This option has no effect if the partition already exists.
    
               Similarly to the behaviour of _CopyBlocks=_ , the file system is
               formatted before the partition is created, ensuring that the
               partition only ever exists with a fully initialized file
               system.
    
               This option cannot be combined with _CopyBlocks=_.
    
               Added in version 247.
    
           _CopyFiles=_
               Takes a colon-separated triplet in the form
               "_source_[:_target_[:_options_]]".  _source_ is an absolute path which
               refers to a source file or directory on the host.  _target_ is
               an absolute path in the file system of the newly created
               partition and formatted file system.  _options_ is a
               comma-separated list of options where each option is in the
               form "_key_[=_value_]".
    
               This setting may be used to copy files or directories from the
               host into the file system that is created due to the _Format=_
               option. If _CopyFiles=_ is used without _Format=_ specified
               explicitly, "Format=" with a suitable default is implied
               (currently "vfat" for "ESP" and "XBOOTLDR" partitions, and
               "ext4" 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.
    
               The _target_ path may be omitted in which case the _source_ 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.
    
               The _options_ may contain the following values:
    
               _fsverity=_
                   May be set to the value "off" (the default if the option
                   is not present) or "copy". If set to "off" then no files
                   copied into the filesystem from this source will have
                   fs-verity enabled. If set to "copy" then the fs-verity
                   information for each file will be copied from the
                   corresponding source file.
    
                   Added in version 258.
    
               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.
    
               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.
    
               Note that _CopyFiles=_ 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, **systemd-repart** will skip copying this file and
               write a log message about it.
    
               Note that **systemd-repart** does not change the UIDs/GIDs of any
               copied files and directories. When running **systemd-repart** as
               an unprivileged user to build an image of files and
               directories owned by the same user, you can run **systemd-repart**
               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.
    
               Note that when populating XFS filesystems with **systemd-repart**
               and loop devices are not available, populating XFS filesystems
               with files containing spaces, tabs or newlines might fail on
               old versions of **mkfs.xfs**(8) due to limitations of its
               protofile format.
    
               Note that when populating XFS filesystems with **systemd-repart**
               and loop devices are not available, extended attributes will
               not be copied into generated XFS filesystems due to
               limitations **mkfs.xfs**(8)'s protofile format.
    
               This option cannot be combined with _CopyBlocks=_.
    
               When systemd-repart(8) is invoked with the **--copy-source=**
               command line switch the file paths are taken relative to the
               specified directory. If **--copy-source=** is not used, but the
               **--image=** or **--root=** switches are used, the source paths are
               taken relative to the specified root directory or disk image
               root.
    
               Added in version 247.
    
           _ExcludeFiles=_ , _ExcludeFilesTarget=_
               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 _CopyFiles=_ 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.
    
               If the path is a directory and ends with "/", only the
               directory's contents are excluded but not the directory
               itself. If the path is a directory and does not end with "/",
               both the directory and its contents are excluded.
    
               _ExcludeFilesTarget=_ is like _ExcludeFiles=_ 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.
    
               When systemd-repart(8) is invoked with the **--image=** or **--root=**
               command line switches the paths specified are taken relative
               to the specified root directory or disk image root.
    
               Added in version 254.
    
           _MakeDirectories=_
               Takes one or more absolute paths, separated by whitespace,
               each declaring a directory to create within the new file
               system. Behaviour is similar to _CopyFiles=_ , 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 _CopyFiles=_ 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 _CopyFiles=_ and
               _MakeDirectories=_ 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).
    
               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 /usr/ in it this
               way, so that the "usr" partition may over-mount it.
    
               Consider using systemd-tmpfiles(8) with its **--image=** 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.
    
               Added in version 249.
    
           _MakeSymlinks=_
               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 _CopyFiles=_ and _MakeSymlinks=_
               are used together the former is applied first.
    
               The primary use case for this option is to create symlinks
               that need to exist before systemd-tmpfiles(8) is executed. For
               example, when using systemd-confext(8), this setting can be
               used to create symlinks in /var/lib/extensions.mutable to
               redirect writes to mutable confexts to a custom location.
    
               Consider using systemd-tmpfiles(8) with its **--image=** option to
               pre-create other symlinks (as well as other inodes) with
               fine-grained control of ownership, access modes and other file
               attributes.
    
               Added in version 257.
    
           _Subvolumes=_
               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:
    
               **Table 2. Subvolume Flags**
               ┌──────┬─────────────────────┐
               │ **Flag** │ **Purpose** │
               ├──────┼─────────────────────┤
               │ "ro" │ Make this subvolume │
               │      │ read-only.          │
               └──────┴─────────────────────┘
    
               Note that this option does not create the directories
               themselves, that can be configured with _MakeDirectories=_ and
               _CopyFiles=_.
    
               Note that this option only takes effect if the target
               filesystem supports subvolumes, such as btrfs(8).
    
               Note that this option is only supported in combination with
               **--offline=yes** since btrfs-progs 6.12 or newer.
    
               Added in version 255.
    
           _DefaultSubvolume=_
               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 _Subvolumes=_.
    
               Note that this option only takes effect if the target
               filesystem supports subvolumes, such as btrfs(8).
    
               Note that this option is only supported in combination with
               **--offline=yes** since btrfs-progs 6.12 or newer.
    
               Added in version 256.
    
           _Encrypt=_
               Takes one of "off", "key-file", "tpm2" and "key-file+tpm2"
               (alternatively, also accepts a boolean value, which is mapped
               to "off" when false, and "key-file" when true). Defaults to
               "off". If not "off" the partition will be formatted with a
               LUKS2 superblock, before the blocks configured with
               _CopyBlocks=_ are copied in or the file system configured with
               _Format=_ is created.
    
               The LUKS2 UUID is automatically derived from the partition
               UUID in a stable fashion. If "key-file" or "key-file+tpm2" is
               used, a key is added to the LUKS2 superblock, configurable
               with the **--key-file=** option to **systemd-repart**. If "tpm2" or
               "key-file+tpm2" is used, a key is added to the LUKS2
               superblock that is enrolled to the local TPM2 chip, as
               configured with the **--tpm2-device=** and **--tpm2-pcrs=** options to
               **systemd-repart**.
    
               When used this slightly alters the size allocation logic as
               the implicit, minimal size limits of _Format=_ and _CopyBlocks=_
               are increased by the space necessary for the LUKS2 superblock
               (see above).
    
               This option has no effect if the partition already exists.
    
               Added in version 247.
    
           _Verity=_
               Takes one of "off", "data", "hash" or "signature". Defaults to
               "off". If set to "off" or "data", the partition is populated
               with content as specified by _CopyBlocks=_ or _CopyFiles=_. If set
               to "hash", the partition will be populated with verity hashes
               from the matching verity data partition. If set to
               "signature", the partition will be populated with a JSON
               object containing a signature of the verity root hash of the
               matching verity hash partition.
    
               A matching verity partition is a partition with the same
               verity match key (as configured with _VerityMatchKey=_).
    
               If not explicitly configured, the data partition's UUID will
               be set to the first 128 bits of the verity root hash.
               Similarly, if not configured, the hash partition's 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
               **systemd-repart**.
    
               This option has no effect if the partition already exists.
    
               Usage of this option in combination with _Encrypt=_ is not
               supported.
    
               For each unique _VerityMatchKey=_ value, a single verity data
               partition ("Verity=data") and a single verity hash partition
               ("Verity=hash") must be defined.
    
               Added in version 252.
    
           _VerityMatchKey=_
               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 _Verity=_.
    
               Added in version 252.
    
           _VerityDataBlockSizeBytes=_
               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 **systemd-repart** is not operating on a block device.
    
               Added in version 255.
    
           _VerityHashBlockSizeBytes=_
               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 **systemd-repart** is not operating on a block device.
    
               Added in version 255.
    
           _FactoryReset=_
               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.
    
               Added in version 245.
    
           _Flags=_
               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 _NoAuto=_ , _ReadOnly=_ and _GrowFileSystem=_ ; see
               below for details on the defaults for these three flags.
               Specify the flags value in hexadecimal (by prefixing it with
               "0x"), binary (prefix "0b") or decimal (no prefix).
    
               Added in version 249.
    
           _NoAuto=_ , _ReadOnly=_ , _GrowFileSystem=_
               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 **Discoverable Partitions**
               **Specification******[1]. 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 _Flags=_ too,
               see above.
    
               If _Flags=_ is used in conjunction with one or more of
               _NoAuto=_ /_ReadOnly=_ /_GrowFileSystem=_ the latter control the value
               of the relevant flags, i.e. the high-level settings
               _NoAuto=_ /_ReadOnly=_ /_GrowFileSystem=_ override the relevant bits
               of the low-level setting _Flags=_.
    
               Note that the three flags affect only automatic partition
               mounting, as implemented by systemd-gpt-auto-generator(8) or
               the **--image=** option of various commands (such as
               systemd-nspawn(1)). It has no effect on explicit mounts, such
               as those done via mount(8) or fstab(5).
    
               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.
    
               _NoAuto=_ defaults to off.  _ReadOnly=_ defaults to on for Verity
               partition types, and off for all others.  _GrowFileSystem=_
               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).
    
               Added in version 249.
    
           _SplitName=_
               Configures the suffix to append to split artifacts when the
               **--split** option of systemd-repart(8) is used. Simple specifier
               expansion is supported, see below. Defaults to "%t". To
               disable split artifact generation for a partition, set
               _SplitName=_ to "-".
    
               Added in version 252.
    
           _Minimize=_
               Takes one of "off", "best", and "guess" (alternatively, also
               accepts a boolean value, which is mapped to "off" when false,
               and "best" when true). Defaults to "off". If set to "best",
               the partition will have the minimal size required to store the
               sources configured with _CopyFiles=_.  "best" is currently only
               supported for read-only filesystems. If set to "guess", the
               partition is created at least as big as required to store the
               sources configured with _CopyFiles=_. Note that unless the
               filesystem is a read-only filesystem, **systemd-repart** 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.
    
               Added in version 253.
    
           _MountPoint=_
               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 fstab(5) format. This
               setting may be specified multiple times to mount the partition
               multiple times. This can be used to add mounts for different
               btrfs(8) subvolumes located on the same btrfs partition.
    
               Note that this setting is only taken into account when
               **--generate-fstab=** is specified on the **systemd-repart** command
               line.
    
               Added in version 256.
    
           _EncryptedVolume=_
               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 /dev/mapper/. If not specified, "luks-UUID" will be used
               where "UUID" 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 crypttab(5) format.
    
               Note that this setting is only taken into account when
               **--generate-crypttab=** is specified on the **systemd-repart**
               command line.
    
               Added in version 256.
    
           _Compression=_
               Specifies the compression algorithm to use for the filesystem
               configured with _Format=_. Takes a single argument specifying
               the compression algorithm.
    
               Note that this setting is only taken into account when the
               filesystem configured with _Format=_ supports compression (
               btrfs(8), squashfs, erofs(5)). Here's an incomplete list of
               compression algorithms supported by the filesystems known to
               **systemd-repart** :
    
               **Table 3. File System Compression Algorithms**
               ┌─────────────┬───────────────────┬───────────────┐
               │ **File System** │ **Compression** │ **Documentation** │
               │             │ **Algorithms** │               │
               ├─────────────┼───────────────────┼───────────────┤
               │ **squashfs** │ gzip, lzo, lz4,   │ **mksquashfs**(1) │
               │             │ xz, zstd, lzma    │               │
               ├─────────────┼───────────────────┼───────────────┤
               │ **erofs** │ lz4, lz4hc, lzma, │ **mkfs.erofs**(1) │
               │             │ deflate,          │               │
               │             │ libdeflate, zstd  │               │
               ├─────────────┼───────────────────┼───────────────┤
               │ **btrfs** │ zlib, lzo, zstd   │ mkfs.btrfs(8) │
               └─────────────┴───────────────────┴───────────────┘
    
               Added in version 257.
    
           _CompressionLevel=_
               Specifies the compression level to use for the filesystem
               configured with _Format=_. 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's
               documentation for the exact meaning of a particular
               compression level).
    
               Note that this setting is only taken into account when the
               filesystem configured with _Format=_ supports compression and
               the _Compression=_ setting is configured explicitly.
    
               Added in version 257.
    
           _SupplementFor=_
               Takes a partition definition name, such as "10-esp". If
               specified, **systemd-repart** will avoid creating this partition
               and instead prefer to partially merge the two definitions.
               However, depending on the existing layout of partitions on
               disk, **systemd-repart** may be forced to fall back onto
               un-merging the definitions and using them as originally
               written, potentially creating this partition. Specifically,
               **systemd-repart** 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.
    
               The following fields are merged into the target definition in
               the specified ways: _Weight=_ and _PaddingWeight=_ are simply
               overwritten; _SizeMinBytes=_ and _PaddingMinBytes=_ use the larger
               of the two values; _SizeMaxBytes=_ and _PaddingMaxBytes=_ use the
               smaller value; and _CopyFiles=_ , _ExcludeFiles=_ ,
               _ExcludeFilesTarget=_ , _MakeDirectories=_ , and _Subvolumes=_ are
               concatenated.
    
               Usage of this option in combination with _CopyBlocks=_ ,
               _Encrypt=_ , or _Verity=_ 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.
    
               For example, distributions can use this to implement _$BOOT_ as
               defined in the **Boot Loader Specification******[2]. Distributions may
               prefer to use the ESP as _$BOOT_ 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's sufficiently large to hold kernels and
               configured as a supplement for the ESP. Whenever possible,
               systemd-repart(8) will try to merge the two definitions to
               create one large ESP, but if that's not allowable due to the
               existing conditions on disk a small ESP and a large XBOOTLDR
               will be created instead.
    
               As another example, distributions can also use this to
               seamlessly share a single /home partition in a multi-boot
               scenario, while preferring to keep /home on the root partition
               by default. Having a /home 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 systemd-homed.service(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 /home partition that takes up all the remaining free
               space. On first boot, if **systemd-repart** finds an existing
               /home partition on disk, it'll 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.
    
               Added in version 257.
    
           _AddValidateFS=_
               Takes a boolean argument. If enabled will set the
               _user.validatefs.gpt_label_ , _user.validatefs.gpt_type_uuid_ and
               _user.validatefs.mount_point_ 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 _Format=_ is used and the specified
               argument is neither "swap" nor "vfat".
    
               These extended attributes are read by
               systemd-validatefs@.service(8) and may encode constraints on
               mounted file systems that must be fulfilled for the system to
               successfully boot. This is particular important in
               systemd-gpt-auto-generator(8) 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.
    
               Added in version 258.
    
           _FileSystemSectorSize=_
               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's 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.
    
               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.
    
               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.
    
               Added in version 258.
    


## SPECIFIERS



           Specifiers may be used in the _Label=_ , _CopyBlocks=_ , _CopyFiles=_ ,
           _MakeDirectories=_ , _SplitName=_ settings. The following expansions
           are understood:
    
           **Table 4. Specifiers available**
           ┌───────────┬──────────────────┬────────────────────────┐
           │ **Specifier** │ **Meaning** │ **Details** │
           ├───────────┼──────────────────┼────────────────────────┤
           │ "%a"      │ Architecture     │ A short string         │
           │           │                  │ identifying the        │
           │           │                  │ architecture of        │
           │           │                  │ the local system.      │
           │           │                  │ A string such as       │
           │           │                  │ **x86** , **x86-64** or         │
           │           │                  │ **arm64**. See the         │
           │           │                  │ architectures          │
           │           │                  │ defined for            │
           │           │                  │ _ConditionArchitecture=_ │
           │           │                  │ in systemd.unit(5)     │
           │           │                  │ for a full list.       │
           ├───────────┼──────────────────┼────────────────────────┤
           │ "%A"      │ Operating system │ The operating system   │
           │           │ image version    │ image version          │
           │           │                  │ identifier of the      │
           │           │                  │ running system, as     │
           │           │                  │ read from the          │
           │           │                  │ _IMAGE_VERSION=_ field   │
           │           │                  │ of /etc/os-release. If │
           │           │                  │ not set, resolves to   │
           │           │                  │ an empty string. See   │
           │           │                  │ os-release(5) for more │
           │           │                  │ information.           │
           ├───────────┼──────────────────┼────────────────────────┤
           │ "%b"      │ Boot ID          │ The boot ID of the     │
           │           │                  │ running system,        │
           │           │                  │ formatted as string.   │
           │           │                  │ See random(4) for more │
           │           │                  │ information.           │
           ├───────────┼──────────────────┼────────────────────────┤
           │ "%B"      │ Operating system │ The operating system   │
           │           │ build ID         │ build identifier of    │
           │           │                  │ the running system, as │
           │           │                  │ read from the          │
           │           │                  │ _BUILD_ID=_ field of     │
           │           │                  │ /etc/os-release. If    │
           │           │                  │ not set, resolves to   │
           │           │                  │ an empty string. See   │
           │           │                  │ os-release(5) for more │
           │           │                  │ information.           │
           ├───────────┼──────────────────┼────────────────────────┤
           │ "%H"      │ Host name        │ The hostname of the    │
           │           │                  │ running system.        │
           ├───────────┼──────────────────┼────────────────────────┤
           │ "%l"      │ Short host name  │ The hostname of the    │
           │           │                  │ running system,        │
           │           │                  │ truncated at the first │
           │           │                  │ dot to remove any      │
           │           │                  │ domain component.      │
           ├───────────┼──────────────────┼────────────────────────┤
           │ "%m"      │ Machine ID       │ The machine ID of the  │
           │           │                  │ running system,        │
           │           │                  │ formatted as string.   │
           │           │                  │ See machine-id(5) for  │
           │           │                  │ more information.      │
           ├───────────┼──────────────────┼────────────────────────┤
           │ "%M"      │ Operating system │ The operating system   │
           │           │ image identifier │ image identifier of    │
           │           │                  │ the running system, as │
           │           │                  │ read from the          │
           │           │                  │ _IMAGE_ID=_ field of     │
           │           │                  │ /etc/os-release. If    │
           │           │                  │ not set, resolves to   │
           │           │                  │ an empty string. See   │
           │           │                  │ os-release(5) for more │
           │           │                  │ information.           │
           ├───────────┼──────────────────┼────────────────────────┤
           │ "%o"      │ Operating system │ The operating system   │
           │           │ ID               │ identifier of the      │
           │           │                  │ running system, as     │
           │           │                  │ read from the _ID=_      │
           │           │                  │ field of               │
           │           │                  │ /etc/os-release. See   │
           │           │                  │ os-release(5) for more │
           │           │                  │ information.           │
           ├───────────┼──────────────────┼────────────────────────┤
           │ "%q"      │ Pretty host name │ The pretty hostname of │
           │           │                  │ the running system, as │
           │           │                  │ read from the          │
           │           │                  │ _PRETTY_HOSTNAME=_ field │
           │           │                  │ of /etc/machine-info.  │
           │           │                  │ If not set, resolves   │
           │           │                  │ to the short hostname. │
           │           │                  │ See machine-info(5)    │
           │           │                  │ for more information.  │
           ├───────────┼──────────────────┼────────────────────────┤
           │ "%v"      │ Kernel release   │ Identical to **uname -r** │
           │           │                  │ output.                │
           ├───────────┼──────────────────┼────────────────────────┤
           │ "%w"      │ Operating system │ The operating system   │
           │           │ version ID       │ version identifier of  │
           │           │                  │ the running system, as │
           │           │                  │ read from the          │
           │           │                  │ _VERSION_ID=_ field of   │
           │           │                  │ /etc/os-release. If    │
           │           │                  │ not set, resolves to   │
           │           │                  │ an empty string. See   │
           │           │                  │ os-release(5) for more │
           │           │                  │ information.           │
           ├───────────┼──────────────────┼────────────────────────┤
           │ "%W"      │ Operating system │ The operating system   │
           │           │ variant ID       │ variant identifier of  │
           │           │                  │ the running system, as │
           │           │                  │ read from the          │
           │           │                  │ _VARIANT_ID=_ field of   │
           │           │                  │ /etc/os-release. If    │
           │           │                  │ not set, resolves to   │
           │           │                  │ an empty string. See   │
           │           │                  │ os-release(5) for more │
           │           │                  │ information.           │
           ├───────────┼──────────────────┼────────────────────────┤
           │ "%T"      │ Directory for    │ This is either /tmp or │
           │           │ temporary files  │ the path "$TMPDIR",    │
           │           │                  │ "$TEMP" or "$TMP" are  │
           │           │                  │ set to. (Note that the │
           │           │                  │ directory may be       │
           │           │                  │ specified without a    │
           │           │                  │ trailing slash.)       │
           ├───────────┼──────────────────┼────────────────────────┤
           │ "%V"      │ Directory for    │ This is either         │
           │           │ larger and       │ /var/tmp or the path   │
           │           │ persistent       │ "$TMPDIR", "$TEMP" or  │
           │           │ temporary files  │ "$TMP" are set to.     │
           │           │                  │ (Note that the         │
           │           │                  │ directory may be       │
           │           │                  │ specified without a    │
           │           │                  │ trailing slash.)       │
           ├───────────┼──────────────────┼────────────────────────┤
           │ "%%"      │ Single percent   │ Use "%%" in place of   │
           │           │ sign             │ "%" to specify a       │
           │           │                  │ single percent sign.   │
           └───────────┴──────────────────┴────────────────────────┘
    
           Additionally, for the _SplitName=_ setting, the following specifiers
           are also understood:
    
           **Table 5. Specifiers available**
           ┌───────────┬──────────────────┬────────────────────┐
           │ **Specifier** │ **Meaning** │ **Details** │
           ├───────────┼──────────────────┼────────────────────┤
           │ "%T"      │ Partition Type   │ The partition type │
           │           │ UUID             │ UUID, as           │
           │           │                  │ configured with    │
           │           │                  │ _Type=_              │
           ├───────────┼──────────────────┼────────────────────┤
           │ "%t"      │ Partition Type   │ The partition type │
           │           │ Identifier       │ identifier         │
           │           │                  │ corresponding to   │
           │           │                  │ the partition type │
           │           │                  │ UUID               │
           ├───────────┼──────────────────┼────────────────────┤
           │ "%U"      │ Partition UUID   │ The partition      │
           │           │                  │ UUID, as           │
           │           │                  │ configured with    │
           │           │                  │ _UUID=_              │
           ├───────────┼──────────────────┼────────────────────┤
           │ "%n"      │ Partition Number │ The partition      │
           │           │                  │ number assigned to │
           │           │                  │ the partition      │
           └───────────┴──────────────────┴────────────────────┘
    


## ENVIRONMENT



           Extra filesystem formatting options can be provided using
           filesystem-specific environment variables:
           _$SYSTEMD_REPART_MKFS_OPTIONS_BTRFS_ ,
           _$SYSTEMD_REPART_MKFS_OPTIONS_XFS_ ,
           _$SYSTEMD_REPART_MKFS_OPTIONS_VFAT_ ,
           _$SYSTEMD_REPART_MKFS_OPTIONS_EROFS_ , and
           _$SYSTEMD_REPART_MKFS_OPTIONS_SQUASHFS_. Each variable accepts valid
           **mkfs.**_filesystem_ command-line arguments. The content of those
           variables is passed as-is to the command, without any
           verification.
    


## EXAMPLES



           **Example 1. Grow the root partition to the full disk size at first**
           **boot**
    
           With the following file the root partition is automatically grown
           to the full disk if possible during boot.
    
               # /usr/lib/repart.d/50-root.conf
               [Partition]
               Type=root
    
           **Example 2. Create a swap and home partition automatically on boot,**
           **if missing**
    
           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.
    
               # /usr/lib/repart.d/60-home.conf
               [Partition]
               Type=home
    
               # /usr/lib/repart.d/70-swap.conf
               [Partition]
               Type=swap
               SizeMinBytes=64M
               SizeMaxBytes=1G
               Priority=1
               Weight=333
    
           **Example 3. Create B partitions in an A/B Verity setup, if missing**
    
           Let's 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.
    
               # /usr/lib/repart.d/50-root.conf
               [Partition]
               Type=root
               SizeMinBytes=512M
               SizeMaxBytes=512M
    
               # /usr/lib/repart.d/60-root-verity.conf
               [Partition]
               Type=root-verity
               SizeMinBytes=64M
               SizeMaxBytes=64M
    
           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's use symlinks to create the "B" set of
           partitions, since after all they shall have the same properties
           and sizes as the "A" set.
    
               # ln -s 50-root.conf /usr/lib/repart.d/70-root-b.conf
               # ln -s 60-root-verity.conf /usr/lib/repart.d/80-root-verity-b.conf
    
           **Example 4. Create a data partition and corresponding verity**
           **partitions from a OS tree**
    
           Assuming we have an OS tree at /var/tmp/os-tree that we want to
           package in a root partition together with matching verity
           partitions, we can do so as follows:
    
               # 50-root.conf
               [Partition]
               Type=root
               CopyFiles=/var/tmp/os-tree
               Verity=data
               VerityMatchKey=root
               Minimize=guess
    
               # 60-root-verity.conf
               [Partition]
               Type=root-verity
               Verity=hash
               VerityMatchKey=root
               # Explicitly set the hash and data block size to 4K
               VerityDataBlockSizeBytes=4096
               VerityHashBlockSizeBytes=4096
               Minimize=best
    
               # 70-root-verity-sig.conf
               [Partition]
               Type=root-verity-sig
               Verity=signature
               VerityMatchKey=root
    


## NOTES



            1. Discoverable Partitions Specification
               https://uapi-group.org/specifications/specs/discoverable_partitions_specification
    
            2. Boot Loader Specification
               https://uapi-group.org/specifications/specs/boot_loader_specification/
    


* * *