Removing a linux software raid array

A few steps to dismantling a Linux software RAID array.

I’ve obviously been playing around with software RAID on Linux. Sometimes you have to do something several times before finally getting it right.

Volume groups that have been overlaid onto a RAID array need to be removed first.

Note: Remember, when making changes to disk configurations: if there’s any doubt, reboot.

1. Check all devices.

fdisk -l

2. Check the raid disk.

mdadm --detail /dev/md0

3. Unmount the raid device.

umount -l /dev/md0

4. Stop the raid device

mdadm --stop /dev/md0

5. Zero the superblocks on each raid volume.

mdadm --zero-superblock /dev/sdb
...

6. Remove the raid device.

mdadm --remove /dev/md0

7. Remove relevant lines from /etc/fstab.

8. Reboot.

This entry was posted in System Administration on by .

About phil

My name is Phil Lembo. In my day job I’m an enterprise IT architect for a leading distribution and services company. The rest of my time I try to maintain a semi-normal family life in the suburbs of Raleigh, NC. E-mail me at philipATlembobrothersDOTcom. The opinions expressed here are entirely my own and not those of my employers, past, present or future (except where I quote others, who will need to accept responsibility for their own rants).