3

I have a server with an LSI Megaraid raid controller which has a single disk for the OS configured in raid0

What i want to do, is add a second brand new disk for redundancy and convert the raid0 to raid1 without losing the data on the first disk

Is it possible to do this with the Megaraid Controller ? If yes, is it maybe possible to do it without downtime as well ?

Could someone provide me with the megacli commands involved to achieve this?

3
  • 1
    Whether you can do it automatically via the controller or now I think everyone on this site would recommend backing up the server, rebuilding the array and restoring anyway - it's the only way to be sure it'll function as you wish.
    – Chopper3
    Apr 25, 2016 at 8:42
  • 1
    @Chopper3 Why? The whole point with hardware RAID controllers is that they can do exactly these sorts of things. Yes, have a backup, but no need to rebuild and restore unless things go wrong. Mar 21, 2018 at 20:35
  • @Colin'tHart - because after over thirty years of doing this kind of work I've seen many 'RAID conversions' go badly wrong, and the problem isn not always immediately apparent. The user needs to act professionally so needs to backup the system anyway before trying this conversion - at which point there's only two ways forward - try the conversion or create the new R1 and restore. The only way to be absolutely sure that the new array is in a known good state is the latter option as your conversion may have introduced lost data without you knowing.
    – Chopper3
    Mar 22, 2018 at 9:34

1 Answer 1

6

To answer my own question, it is infact possible to migrate live from a single drive raid0 to raid1 (providing an extra disk) with Megaraid cards

The megacli command is as follows (it can also be done from within the WebBios configuration utility of the raid controller):

megacli -ldrecon -start -r1 -add -physdrv[e:s] -l0 -a0

where [e:s] is the enclosure:slot_number of the extra disk and -l0 is the logical disk ID of the raid0 disk.

Someone can monitor the progress of the reconstruction by issuing the command:

megacli -ldrecon -showprog -l0 -a0
2
  • I ended up with exactly same solution, but... Run "megacli -adpgetprop ReconRate -a0" and notice that you are doing a reshape at 30% speed. Sooo slooow. So I set the limit into 100% (the reshape was scheduled to a least-loaded time). Oct 3, 2017 at 9:44
  • Surprisingly enough, after I set the newly added disk to offline, it did immediately start to rebuild the disk, which is about twice as fast as migration. May 8, 2020 at 20:48

You must log in to answer this question.

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