Clearing Disks in Rescue Environment

February 17, 2026

There are a few things to consider. First, RAID and LVM may have been set up automatically. Second, we are not sure how many drives are present.

Stopping RAID arrays:

for i in /dev/md?; do mdadm -S $i; done
rm /etc/mdadm/mdadm.conf

If you need to wipe the MBR:

for i in /dev/sd?; do dd if=/dev/zero of=$i bs=1024 count=409600; done

This zeros out the first 400MB of each disk, which clears partition tables, boot sectors, and any leftover metadata from previous configurations.