Dismantle Linux md Software RAID Array

Saturday, May 10, 2014

I have used Linux md for software RAID for a long time. It has worked well and even saved my data once.

However, I recently needed to dismantle a healthy RAID array. I used the following steps to erase all traces of the RAID array from each hard drive.

Figure out the md device ID and what hard drives are part of that RAID array using the following command:

cat /proc/mdstat

Figure out what directory the RAID array is mounted to using df -h or mount.

Unmount the RAID array:

umount /mnt/raid

Remove the RAID array’s mount entry in /etc/fstab.

Remove the RAID array’s entry in /etc/mdadm.conf.

Stop the RAID Array (the md device ID will probably be different for you):

mdadm --stop /dev/md127

Zero the superblocks of each hard drive in the RAID array (there may be more hard drives to zero depending on the type of RAID array):

mdadm --zero-superblock /dev/sdd1

mdadm --zero-superblock /dev/sde1

Now you can repartition, format, and use each hard drive individually.



comments powered by Disqus