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.
This commit is contained in:
@@ -60,6 +60,7 @@ def deactivate:
|
||||
]
|
||||
elif (.type | contains("raid")) then
|
||||
[
|
||||
"wipefs --all -f \(.path | shellquote)",
|
||||
"mdadm --stop \(.name | shellquote)"
|
||||
]
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user