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
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.
-
4You may also want to make offerings to whatever deity you believe in before beginning this process. Aug 11, 2010 at 2:10
-
-
1
-
I'd feel better about upvoting if you could provide the
mdadm
commands for each step. 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. Jun 13, 2021 at 16:18
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.