how to remove a raid array in linux
While working on my homelab today I ran into an issue when swapping to a new operating system (NAS provider) wherein my drives couldn't be overwritten by TrueNAS due to them existing in a RAID array already.
To remedy the issue I removed the RAID array manually using the console, which allowed me to provision my drives into a "storage pool" inside TrueNAS.
Steps
- Checking the raid configuration
cat /proc/mdstat
- Shows the active RAID arrays
- Checking the details of which drives are included
mdadm --detail /dev/<your raid array name>
- Removing the RAID itself first requires the drives to not be mounted (if they are)
umount /<your raid array disk>
sed -i '/<your raid array>/d' /etc/fstab
- Now we can stop the RAID array. For the TrueNAS distribution the RAID array
is already deleted which saves some effort for us
1. mdadm --stop /dev/<your raid array here>
1. mdadm --remove /dev/<your raid array here>