Table of Contents

RAID - mdadm - Convert a RAID 5 to a RAID 6

Do the Conversion

mdadm --grow /dev/md0 --raid-devices 4 --level 6 --backup-file=/root/md0-backup-file.bak

NOTE: Additional disks can also be added if the original RAID 5 had less than 4 disks.

mdadm --add /dev/md0 /dev/sdd1
mdadm --grow /dev/md0 --raid-disks=4 --level 6 --backup-file=/root/md0-backup-file.bak
  • where –raid-disks=4: is the new number of disks.

Check that the conversion worked

mdadm --detail /dev/md0
cat /proc/mdstat

Update the mdadm configuraton file

Edit the /etc/mdadm/mdadm.conf file, such that the line spares=1 changed to spares=0.