LinuxCommandLibrary

repart.d

TLDR

Apply partition definitions

$ sudo systemd-repart --dry-run
copy
Run repart
$ sudo systemd-repart
copy
Show changes without applying
$ systemd-repart --dry-run --no-pager
copy

SYNOPSIS

**/etc/repart.d/*.conf** configuration files

DESCRIPTION

repart.d contains configuration files for systemd-repart, which declaratively manages GPT partition tables. It can grow, create, or modify partitions on disk.

OPTIONS

$ [Partition]
Type=home
Format=ext4
Label=home
SizeMinBytes=1G
SizeMaxBytes=50G
CopyFiles=/source:/dest
MakeDirectories=/home
copy

EXAMPLES

$ # Dry run
systemd-repart --dry-run

# Apply changes
systemd-repart

# Create partition config
cat > /etc/repart.d/50-home.conf << EOF
[Partition]
Type=home
Format=ext4
Label=home
SizeMinBytes=20G
EOF
copy

CONFIGURATION

$ # /etc/repart.d/50-root.conf
[Partition]
Type=root
Format=ext4
Label=root
SizeMinBytes=10G
SizeMaxBytes=50G
copy

PARTITION TYPES

$ root          - Root partition
home          - Home partition
srv           - Server data
var           - Variable data
tmp           - Temporary files
swap          - Swap space
esp           - EFI System Partition
copy

CAVEATS

systemd 245+. Requires careful planning. Dry-run first. Used in image-based deployments.

HISTORY

systemd-repart was introduced in systemd 245 for declarative partition management in image-based Linux systems.

SEE ALSO

Copied to clipboard