[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: raid0 initialization



On Tuesday 15 June 2004 08:56, Harland Christofferson wrote:
> *snip*
>
> >
> >What is the partition type on /dev/hda1 and /dev/hdc1?  If they
> >are not both
> >FD (Linux raid autodetect), your raid array won't work.
>
> the partition type? okay ... new territory for me. they are ext2
> w/ ID of 83. they are the boot partitions.
>
You will need to change them to ID of FD using a program like cfdisk in 
order to use them in a raid array.

> >Note that, if you have data on /dev/hda1 that you want to keep,
> >you should
> >mark that disk as a failed disk.  Then, when you make your raid
> >array, data
> >won't get erased from /dev/hda1.  You can then mount the disk and
> >the raid
> >and copy the data from one to the other.  Once your data is on the
> >raid,
> >mark the /dev/hda1 disk as a live disk, and the raid will re-sync,
> >and your
> >data will be intact.
>
> i am really glad this did not work the first time. i DO want to keep
> the data intact on /dev/hda. should i mount each partition of /dev/hdc?
> what i want to have occur is all partitions on /dev/hda be mirrored
> on /dev/hdc.
>
This is pretty standard.  You need to partition /dev/hdc to match /dev/hda 
with respect to partition sizes, but make the partition types FD.  For each 
partition, create an md device with the /dev/hdcx partition as disk 0 
and /dev/hdax partition as disk 1, and be sure to mark disk 1 as a failed 
disk.  Then, use mkraid to build the array.  Note that if you 
have /dev/hdax mounted and you don't properly have the partition labeled as 
a failed disk, building the raid will fail and you won't lose data.

After you build the array, format it with whatever file system type you're 
going to use.  Then mount the array somewhere, and begin to copy your data 
over to the array.

When all your data is copied, modify your boot loader to point to the raid 
that contains /boot and /, and reboot.  Now, you should be able to unmount 
all partitions from /dev/hda.  Once you have done that, change the 
partition ID to FD, remove the failed marker from the raid config, and the 
drives will sync.  At that point, you're done.

It sounds simple, but if you get into trouble, you might want to search the 
archives for problems other people have had, or you might want to check out 
this link:
http://rootraiddoc.alioth.debian.org/

It's quite complete, very recent, and a good resource.  I recommend reading 
it, unless you want to test your backup strategy.  ;-)

Good luck,

Justin Guerin



Reply to: