create raid1 on a installed system

Rashkae ubuntu at tigershaunt.com
Mon Jul 20 01:55:06 UTC 2009


Brian McKee wrote:
> On Sun, Jul 19, 2009 at 6:29 PM, Asif Iqbal<vadud3 at gmail.com> wrote:
>> I have two disks on my x2100, sda and sdb, both are 80GB. I installed
>> jaunty server on sdb1.
>>
>> How do I now create software raid1 short of reinstalling the OS on
>> software raid disk md0  ?
> 
> Create the raid on sda1 with the other disk 'missing'
> Copy sdb1 to md0, remove sdb altogether and reboot to md0, and test to
> make sure you got it right, then reformat sdb and add it to the
> degraded array.
> 
> This might be helpful
> http://www.debian-administration.org/articles/238
> 
> Brian
> 

There is one huge gotcha with this process.

When you boot to md0 for the first time, the system will fail to detect
the raid array and after a long wait, dump you to busybox shell.

This is because when you built the raid array from a working system, the
array gets tagged with your system hostname.  When the system is booting
from initrd, mdadm (the program that is responsible for detecting and
assembling the array) by default will only assemble arrays that match
the current hostname (which in initrd environment is blank).

Be sure you have a print-out copy of the mdadm man page.  You should be
able to give it the appropriate incantation from busy-box that will
update the hostname in the array and all will thereafter be well.









More information about the ubuntu-users mailing list