Can I convert a 1 disk RAID 0 to RAID 1?

This is dangerously close to question 18957, but it isn't quite the same.

One of my logical drives on my P410i is a single disk RAID 0 (because I was short sighted at the time). It's now warning about imminent failure, and I'm looking for an easy way to fix it. (I have backups, but I want to avoid the downtime (don't troll, remember I said I was short sighted?) of doing this the "right way")

My plan, if possible, would be to make this RAID 0 into a RAID 1, add a matching drive to the RAID 1, let the controller rebuild it, pull the dead drive, and have a proper RAID 1 in the end. I'm just wondering if I can do step 1.

More Specs:

  • HP DL360
  • Smart Array P410i
  • Dead drive is a 146GB 10kRPM (also my / drive :( )
  • Installed OS is Ubuntu 10.04
  • hpacucli is installed and available.

Solution 1:

I'm not sure if you've completed this yet, but this is definitely possible, assuming your Smart Array controller has a battery or flash-back cache unit (needed for all RAID-level tranformations/expansions). The disk described in the original problem is a drive pre-failure (either from S.M.A.R.T. status or other detection method). It has not failed yet. You may even have a blinking amber light on the drive, versus the solid amber indicating failure.

I prefer doing expansions via the graphical HP Online Array Configuration utility enabled by (cpqacuxe -R and browsing to https://server.ip:2381) if you have the full set of HP Management Agents installed. But if that's not available, the hpacucli command-line utility will work as well.

You're basically going to run this in two steps. Add the new disk(s) to the existing logical drive, then optionally expand the logical drive. Going from RAID 0 to RAID 1 really only gives the option of adding a disk and changing the logical drive's redundancy level.

Enter hpacucli and run ctrl all show config

Grab the controller slot number and logical drive ID. Say it's the onboard controller, slot=0.

ctrl slot=0 ld 1 add drives=allunassigned

From there, you can modify the logical drive to change its redundancy level (although this may be automatic in this specific case).

ctrl slot=0 ld 1 modify raid=1

Solution 2:

I'm not 100% sure about doing this with that model of hardware controller, you'd have to RTM, but you can certainly do this with mdadm and make a software RAID 1 on the fly.

Alternatively, you can get two additional disks and make them into a hardware RAID 1 on the controller and just use dd to copy disk 1 on to the new array. Then you can remove the failing disk and have a hardware RAID 1.