Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Stop Partitioning Disks by Hand: Practical systemd-repart on Linux

Every hand-built Linux image eventually grows the same wart: a shell script that pipes commands into sfdisk , calls partprobe , runs resize2fs , and hopes the device really was /dev/sda . It works exactly once. Change the disk, add a partition, or boot the same image on a board that enumerates storage differently, and the script either fails halfway or, worse, succeeds against the wrong device.…

Systemd-repart is a tool that helps in managing disk partitions declaratively. It uses .conf files to define the desired partitions and their properties, such as type, size, and filesystem. The tool reads these files, matches them against existing partitions, and adjusts the partition table accordingly. It is designed to be incremental, leaving existing partitions unchanged unless a matching definition is found.

The tool is GPT only and does not support MBR/DOS partition tables, shrinking, moving, or deleting partitions. It does not perform filesystem growth or content migration. The partition allocation is based on SizeMinBytes, SizeMaxBytes, and Weight settings, with defaults that can lead to unexpected results, such as a root partition taking up the entire disk. The tool provides a dry-run mode to preview changes before making them.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

ThreadPoolExecutor result(timeout=1) Left 4 Calls Running

future.result(timeout=1) raises TimeoutError after one second, but the thread keeps running the call to the end, and future.cancel() returns False because the work already started; if a tool call must…

  • ThreadPoolExecutor result(timeout=1) raises TimeoutError after 1 second
  • Associated thread continues running call after timeout
  • Recommended solution: execute function in separate process or include internal timeout

Stop Hand-Partitioning Disks: Practical systemd-repart on Linux

Stop Hand-Partitioning Disks: Practical systemd-repart on Linux You ship a minimal OS image. The target disk is 64 GB, 256 GB, or 2 TB. Root is still 8 GB. Swap does not exist.

  • systemd-repart simplifies disk partitioning for Linux OS images
  • Configurations defined in repart.d/.conf files, no fragile installer hooks
  • Incremental and idempotent tool, operates on GPT disks

More from Saturday 21 November →