Deleting an Array
To destroy an array, including all data contained within, begin by following the process we used to stop an array.
First, unmount the filesystem:
Next, stop the array:
Afterwards, delete the array itself with the --remove command targeting the RAID device:
Once the array itself is removed, you should use mdadm --zero-superblock on each of the component devices. This will erase the md superblock, a header used by mdadm to assemble and manage the component devices as part of an array. If this is still present, it may cause problems when trying to reuse the disk for other purposes.
You can see that the superblock is still present in the array by checking out the FSTYPE column in the lsblk --fs output:
In this example, /dev/sda
, /dev/sdb
, and /dev/sdc
were all part of the array and are still labeled as such.
Remove the labels by typing:
Next, make sure you remove or comment out any references to the array in the /etc/fstab file:
Save and close the file when you are finished.
Remove or comment out any references to the array from the /etc/mdadm/mdadm.conf file as well:
Save and close the file when you are finished.
Update the initramfs by typing:
This should remove the device from the early boot environment.
Last updated