REPART.D(5) repart.d REPART.D(5) repart.d - /etc/repart.d/*.conf /run/repart.d/*.conf /usr/local/lib/repart.d/*.conf /usr/lib/repart.d/*.conf repart.d/*.conf . . systemd-repart(8) . . ( ) . GPT. : ( ) (UUID) . UUID UUID UUID UUID . . . . . systemd-growfs(8) . GrowFileSystem= . . [PARTITION] Type= (UUID) GPT . UUID GPT 4f68bce3-e8cd-4db1-96e7-fbcaf984b709 . : 1. GPT +--------------------------+-----------------------------+ | | | +--------------------------+-----------------------------+ |esp | EFI | +--------------------------+-----------------------------+ |xbootldr | | | | | | | | +--------------------------+-----------------------------+ |swap | | | | | | | | | | (Swap) | +--------------------------+-----------------------------+ |home | | | | (/home/) | +--------------------------+-----------------------------+ |srv | | | | | | | | | | (/srv/) | +--------------------------+-----------------------------+ |var | | | | | | | | | | (/var/) | +--------------------------+-----------------------------+ |tmp | | | | | | | | | | (/var/tmp/) | +--------------------------+-----------------------------+ |linux-generic | | | | | | | | +--------------------------+-----------------------------+ |root | | | | | | | | | | | | | | | | | | | | | | | | | ( | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | root-x86-64) | +--------------------------+-----------------------------+ |root-verity | Verity | | | | | | | | | | | | | | | | | | | +--------------------------+-----------------------------+ |root-verity-sig | | | | Verity | | | | | | | | | | | | | | | | | | | +--------------------------+-----------------------------+ |root-secondary | | | | | | | | | | | | | | | | | | | | | | | | | | | | ( | | | | | | | | | 32 | | | | | | | | | 64 ) | +--------------------------+-----------------------------+ |root-secondary-verity | Verity | | | | | | | | | | | | | | | | | | | +--------------------------+-----------------------------+ |root-secondary-verity-sig | | | | Verity | | | | | | | | | | | | | | | | | | | +--------------------------+-----------------------------+ |root-{arch} | | | | | | | | | | | | | | | | | | | ( root-x86-64 | | | root-riscv64) | +--------------------------+-----------------------------+ |root-{arch}-verity | Verity | | | | | | | | | | | | | | | | | | | +--------------------------+-----------------------------+ |root-{arch}-verity-sig | | | | Verity | | | | | | | | | | | | | | | | | | | +--------------------------+-----------------------------+ |usr | | | | | | | /usr/ | | | | | | | | | | | | | | | ( | | | | | | | | | | | | /usr/ | | | | | | | | | | | | | | | usr-x86-64) | +--------------------------+-----------------------------+ |usr-verity | Verity | | | | | | /usr/ | | | | | | | | | | +--------------------------+-----------------------------+ |usr-verity-sig | | | | Verity | | | | | | /usr/ | | | | | | | | | | +--------------------------+-----------------------------+ |usr-secondary | | | | /usr/ | | | | | | | | | | | | | | | | | | | | | ( | | | | | | | | | 32 | | | | | | | | | 64 ) | +--------------------------+-----------------------------+ |usr-secondary-verity | Verity | | | | | | /usr/ | | | | | | | | | | +--------------------------+-----------------------------+ |usr-secondary-verity-sig | | | | Verity | | | | | | /usr/ | | | | | | | | | | +--------------------------+-----------------------------+ |usr-{arch} | | | | /usr/ | | | | | | | | | | +--------------------------+-----------------------------+ |usr-{arch}-verity | Verity | | | | | | /usr/ | | | | | | | | | | +--------------------------+-----------------------------+ |usr-{arch}-verity-sig | | | | Verity | | | | | | /usr/ | | | | | | | | | | +--------------------------+-----------------------------+ : alpha arc arm (32 ) arm64 (64 aarch64) ia64 loongarch64 mips-le mips64-le parisc ppc ppc64 ppc64-le riscv32 riscv64 s390 s390x tilegx x86 (32 i386) x86-64 (64 amd64). UUID UAPI.2[1]. 245. Label= . . . (: ). . . 245. VolumeLabel= LUKS (superblock) . ( Label= ) "luks-". . 259. UUID= UUID . . UUID . UUID . "null" UUID . UUID . 246. Priority= -2147483648...2147483647 . . ( ). . . 0 . 0 . . 0. 245. Weight= 0...1000000. ( SizeMinBytes= SizeMaxBytes=) 2000 1000 333 . 1000. Weight= "" . SizeMinBytes= SizeMaxBytes= . 245. PaddingWeight= Weight= ( ""). . 0 . . 245. SizeMinBytes=, SizeMaxBytes= . K M G T ... ( 1024). SizeMinBytes= . SizeMaxBytes= . Weight= . SizeMinBytes= SizeMaxBytes= . 4096 ( ) . 4096 ( SizeMinBytes=) ( SizeMaxBytes=) . . Priority= ( ) . 10M . Format= . ESP/XBOOTLDR 100M ( 512 ) 260M ( 4 ) . 245. PaddingMinBytes=, PaddingMaxBytes= ( ""). SizeMinBytes= SizeMaxBytes= . PaddingWeight= . 245. CopyBlocks= "auto". . . -- . /dev/urandom . "auto" ( --image= -- ). ( Type= ) . "root" (/) -- "root" . "usr" /usr/ -- "usr" . Verity. "CopyBlocks=auto" " " . 512 . : SizeMinBytes= . . . : . Format= CopyFiles=. 246. Format= "ext4" "btrfs" "xfs" "vfat" "erofs" "squashfs" "swap". ( ). UUID UUID . : ( 4KiB ). (meta) "empty". "Label=_empty" "NoAuto=1". . CopyBlocks= . CopyBlocks=. 247. CopyFiles= "source[:target[:options]]". source . target . options "key[=value]". Format=. CopyFiles= Format= "Format=" ( "vfat" "ESP" "XBOOTLDR" "ext4" ). . target source ( ). . options : fsverity= "off" ( ) "copy". "off" fs-verity . "copy" fs-verity . 258. : . . CopyFiles= ( fifo vfat). systemd-repart . systemd-repart / (UIDs/GIDs) . systemd-repart systemd-repart (root) . CopyBlocks=. systemd-repart(8) --copy-source= . --copy-source= --image= --root= . CopyFiles= Format=xfs xfsprogs 6.17 . 247. ExcludeFiles=, ExcludeFilesTarget= . CopyFiles=. . "/" . "/" . ExcludeFilesTarget= ExcludeFiles= . systemd-repart(8) --image= --root= . 254. MakeDirectories= . CopyFiles= 0755 (root) ( ). CopyFiles= / . . CopyFiles= MakeDirectories= . ( / ). . /usr/ "usr" . systemd-tmpfiles(8) --image= ( inodes ) . 249. MakeSymlinks= . . . CopyFiles= MakeSymlinks= . systemd-tmpfiles(8). systemd-confext(8) /var/lib/extensions.mutable confexts . systemd-tmpfiles(8) --image= ( inodes ) . 257. Subvolumes= (subvolume) . . : 2. +------------+--------------------------+ | | | +------------+--------------------------+ |"ro" | | | | | | | | | | | | | . | +------------+--------------------------+ |"nodatacow" | | | | | | | | | | | | | (CoW) | | | | | | . | +------------+--------------------------+ MakeDirectories= CopyFiles=. btrfs(8). --offline=yes btrfs-progs 6.12 . 255. DefaultSubvolume= . Subvolumes=. btrfs(8). --offline=yes btrfs-progs 6.12 . 256. Encrypt= : "off" "key-file" "tpm2" "key-file+tpm2" ( "off" "key-file" ). "off". "off" LUKS2 CopyBlocks= Format=. LUKS2 UUID UUID . "key-file" "key-file+tpm2" LUKS2 --key-file= systemd-repart. "tpm2" "key-file+tpm2" LUKS2 TPM2 --tpm2-device= --tpm2-pcrs= systemd-repart. Format= CopyBlocks= LUKS2 ( ). . 247. Verity= : "off" "data" "hash" "signature". "off". "off" "data" CopyBlocks= CopyFiles=. "hash" verity verity . "signature" JSON verity verity . verity verity ( VerityMatchKey=). UUID 128 verity. UUID 128 verity. verity systemd-repart. . Encrypt= . VerityMatchKey= verity ("Verity=data") verity ("Verity=hash"). 252. VerityMatchKey= . verity verity . Verity=. 252. VerityDataBlockSizeBytes= verity . 512 4096 2. 4K systemd-repart . 255. VerityHashBlockSizeBytes= verity . 512 4096 2. 4K systemd-repart . 255. FactoryReset= . . . (off). 245. Flags= GPT 64- . . NoAuto= ReadOnly= GrowFileSystem= . ( "0x") ( "0b") ( ). 249. NoAuto=, ReadOnly=, GrowFileSystem= - (No-Auto) (Read-Only) (Grow-File-System) ( 63 60 59) UAPI.2[1]. . 63 60 59 Flags= . Flags= NoAuto=/ReadOnly=/GrowFileSystem= NoAuto=/ReadOnly=/GrowFileSystem= Flags=. systemd-gpt-auto-generator(8) --image= ( systemd-nspawn(1)). mount(8) fstab(5). 60 59 ( ) : . NoAuto= (off). ReadOnly= (on) Verity (off) . GrowFileSystem= (on) ( Verity). 249. SplitName= (split artifacts) --split systemd-repart(8). . "%t". SplitName= "-". 252. Minimize= : "off" "best" "guess" ( "off" "best" ). "off". "best" CopyFiles=. "best" btrfs. "guess" CopyFiles=. btrfs systemd-repart repart . 253. MountPoint= . (":"). . . fstab(5). . : MountPoint="/path/with:colon":"zstd:1,noatime,lazytime" . btrfs(8) btrfs . --generate-fstab= systemd-repart. 256. EncryptedVolume= . (":"). /dev/mapper/. "luks-UUID" "UUID" LUKS UUID. (keyfile) crypttab. crypttab. crypttab(5). crypttab. fixate-volume-key. LUKS crypttab fixate-volume-key=expected-hash crypttab . --generate-crypttab= systemd-repart. crypttab LUKS crypttab . 256. TPM2PCRs= PCR LUKS2 Encrypt=tpm2 . systemd-cryptenroll(1) TPM2. --tpm2-pcrs= . 259. KeyFile= . . LUKS2 Encrypt=key-file . --key-file= . --key-file= . 259. Integrity= . Integrity=inline LUKS2. Encrypt= (online). "off" . : (EXPERIMENTAL) cryptsetup. 260. IntegrityAlgorithm= . Integrity=inline : "hmac-sha1" "hmac-sha256" () "hmac-sha512". 260. Compression= Format=. . Format= ( btrfs(8) squashfs erofs(5)). systemd-repart: 3. +----------------------+-----------------------------+-----------------------+ | | | | | | | | +----------------------+-----------------------------+-----------------------+ |squashfs | gzip, lzo, lz4, xz, zstd, | mksquashfs(1) | | | lzma | | +----------------------+-----------------------------+-----------------------+ |erofs | lz4, lz4hc, lzma, deflate, | mkfs.erofs(1) | | | libdeflate, zstd | | +----------------------+-----------------------------+-----------------------+ |btrfs | zlib, lzo, zstd | mkfs.btrfs(8) | +----------------------+-----------------------------+-----------------------+ 257. CompressionLevel= Format=. . ( ). Format= Compression= . 257. SupplementFor= "10-esp". systemd-repart . systemd-repart . systemd-repart . : Weight= PaddingWeight= SizeMinBytes= PaddingMinBytes= SizeMaxBytes= PaddingMaxBytes= CopyFiles= ExcludeFiles= ExcludeFilesTarget= MakeDirectories= Subvolumes= . CopyBlocks= Encrypt= Verity= . . . . $BOOT UAPI.1[2]. ESP $BOOT XBOOTLDR . : ESP XBOOTLDR ESP. systemd-repart(8) ESP ESP XBOOTLDR . /home /home . /home : . ( systemd-homed.service(8)). : /home . systemd-repart /home . . 257. AddValidateFS= . user.validatefs.gpt_label user.validatefs.gpt_type_uuid user.validatefs.mount_point UUID . Format= "swap" "vfat". systemd-validatefs@.service(8) . systemd-gpt-auto-generator(8) GPT. ( LUKS dm-verity) . 258. FileSystemSectorSize= LUKS Verity . 2 512 . 4096 512 ( ) . . . 4096. . 258. Label= CopyBlocks= CopyFiles= MakeDirectories= SplitName=. : 4. +-------------------+-----------------------------+--------------------------------+ | | | | +-------------------+-----------------------------+--------------------------------+ |"%a" | | | | | | | | | | | | | | | | | | . | | | | x86 | | | | x86-64 arm64. | | | | | | | | | | | | | | | | ConditionArchitecture= | | | | systemd.unit(5) | | | | | | | | | | | | . | +-------------------+-----------------------------+--------------------------------+ |"%A" | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IMAGE_VERSION= | | | | /etc/os-release. | | | | | | | | | | | | | | | | . | | | | os-release(5) | | | | | | | | . | +-------------------+-----------------------------+--------------------------------+ |"%b" | | | | | | | | | | | | | | | | | | | | | | | | | | . | | | | random(4) | | | | | | | | . | +-------------------+-----------------------------+--------------------------------+ |"%B" | | | | | | | | | | | | | | | | | | | | | | | | | | BUILD_ID= | | | | /etc/os-release. | | | | | | | | | | | | | | | | | | | | . | | | | os-release(5) | | | | | | | | . | +-------------------+-----------------------------+--------------------------------+ |"%H" | | | | | | | | | | . | +-------------------+-----------------------------+--------------------------------+ |"%l" | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | . | +-------------------+-----------------------------+--------------------------------+ |"%m" | | | | | | | | | | | | | | | | | | | | | | | | | | . | | | | machine-id(5) | | | | | | | | . | +-------------------+-----------------------------+--------------------------------+ |"%M" | | | | | | | | | | | | | | | | | | | | | | | | | | IMAGE_ID= | | | | /etc/os-release. | | | | | | | | | | | | | | | | | | | | . | | | | os-release(5) | | | | | | | | . | +-------------------+-----------------------------+--------------------------------+ |"%o" | | | | | | | | | | | | | | | | | | | | | | ID= | | | | /etc/os-release. | | | | os-release(5) | | | | | | | | . | +-------------------+-----------------------------+--------------------------------+ |"%q" | | | | | | | | | | | | | | | | | | | | | | | | | | PRETTY_HOSTNAME= | | | | /etc/machine-info. | | | | | | | | | | | | | | | | . | | | | machine-info(5) | | | | | | | | . | +-------------------+-----------------------------+--------------------------------+ |"%v" | | | | | | uname | | | | -r. | +-------------------+-----------------------------+--------------------------------+ |"%w" | | | | | | | | | | | | | | | | | | | | | | | | | | VERSION_ID= | | | | /etc/os-release. | | | | | | | | | | | | | | | | | | | | . | | | | os-release(5) | | | | | | | | . | +-------------------+-----------------------------+--------------------------------+ |"%W" | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VARIANT_ID= | | | | /etc/os-release. | | | | | | | | | | | | | | | | | | | | . | | | | os-release(5) | | | | | | | | . | +-------------------+-----------------------------+--------------------------------+ |"%T" | | /tmp | | | | | | | | | | | | "$TMPDIR" | | | | "$TEMP" "$TMP". | | | | ( | | | | | | | | | | | | | | | | .) | +-------------------+-----------------------------+--------------------------------+ |"%V" | | /var/tmp | | | | | | | | | | | | "$TMPDIR" | | | | "$TEMP" "$TMP". | | | | ( | | | | | | | | | | | | | | | | .) | +-------------------+-----------------------------+--------------------------------+ |"%%" | | "%%" | | | | "%" | | | | | | | | | | | | | | | | . | +-------------------+-----------------------------+--------------------------------+ SplitName= : 5. +-------------------+---------------------+--------------------------+ | | | | +-------------------+---------------------+--------------------------+ |"%T" | Partition Type UUID | UUID | | | | | | | | | | | | | | | | | | | | Type= | +-------------------+---------------------+--------------------------+ |"%t" | | | | | | | | | | | | | | | | | | UUID | | | | | | | | | +-------------------+---------------------+--------------------------+ |"%U" | Partition UUID | UUID | | | | | | | | | | | | | | | | UUID= | +-------------------+---------------------+--------------------------+ |"%n" | Partition Number | | | | | | | | | | | | | | +-------------------+---------------------+--------------------------+ : $SYSTEMD_REPART_MKFS_OPTIONS_BTRFS $SYSTEMD_REPART_MKFS_OPTIONS_XFS $SYSTEMD_REPART_MKFS_OPTIONS_VFAT $SYSTEMD_REPART_MKFS_OPTIONS_EROFS $SYSTEMD_REPART_MKFS_OPTIONS_SQUASHFS. mkfs.filesystem. . 1. . # /usr/lib/repart.d/50-root.conf [Partition] Type=root 2. (swap) (home) 1 64 . > 0 . . # /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 3. B A/B Verity A/B ( Verity ) . Verity ( "A") Verity ( "B") . # /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 "A" ( 512 ) Verity ( 64 ). "B" "A". # 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 4. verity /var/tmp/os-tree verity : # 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 systemd(1), systemd-repart(8), sfdisk(8), systemd-cryptenroll(1) 1. UAPI.2 https://uapi-group.org/specifications/specs/discoverable_partitions_specification 2. UAPI.1 https://uapi-group.org/specifications/specs/boot_loader_specification/ 3 . . : . systemd 260.2 REPART.D(5)