Systemd-Repart: Automating Partition Growth and Security for Scalable Image-Based Deployments
September 6, 2026
Systemd-repart reads partition definitions and targets GPT disks, growing partitions to fit size constraints while avoiding data loss, with optional formatting, copying files, encryption, or verity to protect security and integrity.
The approach replaces manual partitioning by declaratively defining GPT partitions via repart.d/*.conf, enabling automatic, incremental growth on boot without shrinking or deleting existing data.
Practical labs guide learners through building a minimal GPT image, creating a disk image with ESP/root/swap, and testing growth on larger disks using dry-runs and real runs with verification steps.
A three-stage model covers first-boot takeover to create partitions, offline image builds to prepare DPIs, and filesystem growth as disks enlarge, leveraging GrowFileSystem and systemd-growfs.
Examples show ESP, root, and swap configurations with SizeMinBytes, SizeMaxBytes, and Label, plus notes on how Type=root maps to architecture-specific root types and how CopyFiles and GrowFileSystem influence behavior.
Emphasis on idempotency and reproducibility, with seed-based UUIDs for repeatable builds and verification checks of partition layouts, DPS types, and filesystem growth to ensure disks match declarative configs on re-runs.
Overall, systemd-repart is presented as a scalable, race-condition-resistant workflow for image-based deployments, VMs and bare-metal fleets, and lab environments where partitioning is defined as code and growth is controlled.
Production patterns show adding encrypted state partitions (swap, home, srv) and using GPT auto-generation to mount them automatically, avoiding manual fstab edits, plus a factory-reset mechanism for explicit destructive resets.
Prerequisites include a GPT disk, the systemd-repart package, root privileges, and sufficient free space since repart only adds or grows partitions, not defragmentation or shrinking.
Summary based on 1 source
Get a daily email with more Tech stories
Source

DEV Community • Sep 6, 2026
Stop Hand-Partitioning Disks: Practical systemd-repart on Linux