Urgent.News

What's breaking now, across thousands of outlets.

Tech

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. /home is not a partition yet. The usual fix is a one-off parted / gdisk script, a fragile installer hook, or “remember to resize after first boot.” That does not scale across VMs, bare metal, and image-based fleets.…

Stop Partitioning Disks Manually, Use systemd-repart for Linux

Systemd-repart simplifies disk partitioning for minimal Linux OS images. The solution addresses challenges faced when shipping a minimal OS image to various targets, such as 64 GB, 256 GB, or 2 TB disks. Root remains at 8 GB, while swap is absent, and /home is not yet a partition. Instead of fragile installer hooks or one-off scripts, systemd-repart offers a declarative config using GPT definitions in repart.d/*.conf files.

Systemd-repart operates on a block device or image file, adding missing partitions and growing existing ones to meet size/weight constraints. It is incremental and idempotent, meaning it does nothing if the table matches the config. By default, it only changes the partition table, unless you set specific options like Format, CopyFiles, CopyBlocks, Encrypt, or Verity.

The tool works on GPT disks, ignoring MBR. Partitions are matched by GPT type UUID, not by partition number. Filenames determine the definition order. Once a partition type is found, the corresponding config is used for that partition.

Three jobs are involved: first-boot disk takeover, offline image build, and safe preview. The first-boot disk takeover is done using systemd-repart.service in initrd, while offline image build uses systemd-repart --image=... / --empty=create. Filesystem growth is a separate concern, requiring a GPT flag and systemd-growfs command.

Prerequisites for using systemd-repart include a GPT disk or a new GPT image. The package is available as systemd-repart for Debian/Ubuntu, and root is required for real devices. Unprivileged builds can use loop files and userns. Ensure there is enough free space after the last partition you care about.

To build a minimal GPT image without touching real disks, create a sparse file, declare ESP + root + swap, format them, and inspect the result. Drop partition definitions under a dedicated definitions directory, and run systemd-repart with various parameters to simulate disk growth and preview changes before applying 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

PKCE Downgrade Attack: When the Authorization Server Accepts Both Flows

Two CVEs against the same identity provider, filed six months apart. CVE-2023-48228 and CVE-2024-23647, both against authentik, describe the same failure: the server accepted PKCE in one request and…

  • CVE-2023-48228 vulnerability in authentik versions 2023.10.4 and 2023.8.5 allows PKCE downgrade.
  • CVE-2024-23647 vulnerability in authentik versions 2023.10.6 and 2023.8.6 permits PKCE bypass.

HMAC Proves Origin, Not Freshness: Replay Attacks Against Signed APIs

HMAC Proves Origin, Not Freshness: Replay Attacks Against Signed APIs The signature verified. The secret was correct. The payment processed for the fourth time, from a request captured three hours…

  • HMAC verifies request origin, not freshness
  • Signed APIs vulnerable to replay attacks
  • Timestamp inclusion prevents replay vulnerabilities

Subdomain Takeover Severity Comes From Security Context, Not the Exploit Mechanism

Subdomain Takeover Severity Comes From Security Context, Not the Exploit Mechanism saostatic.uber.com pointed to an unregistered CloudFront distribution.

  • Severity of subdomain takeover depends on security context, not exploit mechanism.
  • Dangling CNAME can lead to SSO bypass across all services for a domain.
  • 4-question framework aims to address triage failure in classification of critical bugs.

Binary Search Trees

Why should you care? Imagine you have thousands or millions of numbers and frequently need to: Search for a value Insert new values Delete existing values Keep values organized An unsorted array may…

More from Sunday 6 September →