3

I have a RAID5 consisting of 3 disks, one of which is broken. I was wondering if it is possible to convert those two disks to a RAID1 without data loss and without having to back-up the data elsewhere.

1
  • Do you mean, to half a RAID-1?
    – MadHatter
    Apr 19, 2015 at 13:20

2 Answers 2

10

You'd be left with only half the capacity, so if the file system was more than half full already, it would be impossible. Even if there is sufficiently free space, the operation involves resizing the file system, which requires intimate knowledge of the file system.

Moreover applying ordinary resizing tools to a degraded RAID5 before converting it to RAID1 means that for a large part of the operation you will be performing lots of writes to a degraded RAID5. Another disk failure during that operation would leave you with practically no chance to recover your data (even if you somehow managed to get the first failed disk alive again).

Performing the operation safely would have to first identify those areas of the RAID5 where both data disks had free blocks. All of those free blocks as well as the parity of two free blocks can be used as scratch space during a conversion operation.

If enough such scratch space can be identified, it is in principle possible to first perform a sequence of "safe" writes in order to regain redundancy and then from that point start a conversion to RAID1.

Software to perform that task would be complicated and rarely used hence not well tested. Even if we could find such software, I wouldn't trust it with any important data.

My conclusion from this is that if the data is important you get a new disk ASAP.

1

Absolutely do not try a similar thing without having a proper backup. I even discourage you to replace the broken disk without first taking a complete backup: if a second disk fails during reconstruction, you will be in troubles.

So, first thing to do is to take a coherent backup of all your data. Then, if you really want RAID1 over RAID5, the safer bet is to destroy the array, recreate is as RAID1 and restore here your data.

1
  • 1
    Whether performing a backup from the degraded RAID or reconstructing to a new disk is safest depends on multiple factors including how full the file system is. If the file system is almost full, then reconstructing the RAID can be done much faster than a full backup. If the file system is almost empty, the backup can be done much faster than RAID reconstruction.
    – kasperd
    Apr 20, 2015 at 10:31

You must log in to answer this question.

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