From 669ca49ae4b1355e569db99dd3182d48c98979d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Wed, 8 Apr 2026 08:51:20 +0200 Subject: [PATCH] disk-deactivate: wipe raid arrays before stopping them Previously, the `disk-deactivate` script stopped mdadm arrays before wiping the underlying physical disks. This caused filesystems with backup superblocks (like BTRFS at 64 MiB and 256 GiB offsets) to survive the wipe, as the backups were striped across the physical disks and missed by `wipefs` on the raw block devices. When the array was reassembled during reprovisioning, the filesystem superblocks realigned. `disko` would detect the old filesystem via `blkid` and silently skip the `mkfs` step, leaving stale data intact. This commit adds a `wipefs --all` command against the assembled RAID device *before* stopping it, ensuring all filesystem signatures and backup superblocks are cleanly destroyed. --- disk-deactivate/disk-deactivate.jq | 1 + 1 file changed, 1 insertion(+) diff --git a/disk-deactivate/disk-deactivate.jq b/disk-deactivate/disk-deactivate.jq index 3e37b74..6a30375 100644 --- a/disk-deactivate/disk-deactivate.jq +++ b/disk-deactivate/disk-deactivate.jq @@ -60,6 +60,7 @@ def deactivate: ] elif (.type | contains("raid")) then [ + "wipefs --all -f \(.path | shellquote)", "mdadm --stop \(.name | shellquote)" ] else