2

What's the best way to convert a Linux software (that is, mdadm) RAID1 array to a RAID5 array? If the procedure is different for the cases of 3-disk RAID5 vs. 4-disk RAID5, how is it different?

2 Answers 2

5

Before doing anything of this sort back up your data to separate media and verify the backup via sha1sum.

The general procedure from there would look like:

  • Add the third drive to your system.
  • Create a degraded RAID5 out of the new drive and the one freed from the RAID1.
  • Copy the data over to the RAID5 volume.
  • Add the RAID1 disk to the RAID5 volume, and give it plenty of time to synchronize itself properly.
  • Verify that the data on the new volume matches the backup.

Also refer to kernel.org's Wiki page on mdadm, and, for the opposite direction (RAID6 to RAID1, at least), there's a question on serverfault.com, where one of the answer also mentions a blog post about mdadm level changes.

5
  • 4
    You may also want to make offerings to whatever deity you believe in before beginning this process. Commented Aug 11, 2010 at 2:10
  • So it's possible to do without a 4th hard drive, thanks. Commented Aug 15, 2010 at 7:22
  • 1
    Didn't realise you could create a degraded raid5 with only 2 drives!
    – barrymac
    Commented Nov 1, 2011 at 1:32
  • I'd feel better about upvoting if you could provide the mdadm commands for each step.
    – Sixtyfive
    Commented Jun 13, 2021 at 10:35
  • Also, come to think of it, it's completely unneccessary (and dangerous) nowadays to break the RAID1 mirroring. Removed that point of the answer.
    – Sixtyfive
    Commented Jun 13, 2021 at 16:18
2

Many nice RAID controllers can take a RAID 1 array, and when you add another drive, allow you to convert it on the fly to RAID5, of course, now twice the size.

The AMI/LSI based controllers have been doing this for a few years (is it a decade yet?). Dell PERC's, Compaq/HP's Smart Array controllers have often used these chipsets.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .