[CentOS] Add RAID after install in one disk

Wed Feb 28 13:02:24 UTC 2007
Haakon Gjersvik Eriksen <haakon at basefarm.no>

Mário Gamito wrote:
> Hi,
> 
> I had this hard time installing a server with RAID 1 by software.
> I always got an error from GRUB and no booting.
> 
> So, i've installed CentOS 4.4 normally in only one disk.
> 
> Question is: is it possible now to make a RAID 1 by software with the 
> other disk ?
> 
> If so, how ?
> 
> I'm completely lost here.
> 
> Any help would be appreciated.

Yeah, but it's potentially a bit tricky. I don't remember the command 
lines off the top of my head, but here's basically how to do it:

Let's assume you have installed and booted from hda now and want a raid1 
with hda and hdb.

Make a sw raid on hdb with one drive marked as failed.
Copy everything over from hda onto the raid drives
Install Grub on hdb
Boot from the raid1 and then hot-add hda as the disk which had 
previously failed.

IIRC, you also have to do some special magic with the grub config to 
make the machine boot nicely even if you have to reboot with one drive 
down. Unfortunately, it's been a while since last time I did this, so I 
can't remember.

-- 
  Haakon Gjersvik Eriksen     --                  Basefarm AS