[CLUE-Tech] RAID 1 on Linux

Jim Ockers ockers at ockers.net
Tue Oct 19 22:24:45 MDT 2004


Hi Carl,

> A little background first. I'm mainly a Solaris guy.
> I've installed RAIDs on Sun boxes many times. The
> procedure is simple. Create the raid using the
> existing slices and add the new slices to the new
> raid. They syncronize and it's working.
> 
> In a misguided attempt, and because I didn't see the
> RAID option the previous times I've installed Mandrake
> (under the expert menu), I installed Mandrake 9.1 on
> an 80 gig seagate.
> 
> After futzing around with mdadm and raidtools, the
> second disk was so fscked up, I had to use dd to fix
> it (I dd'd the good hda over hdc). Finally I was able
> to do a fresh install and found the RAID options under
> the expert menu.
> 
> All of the documentation I've seen appear to show that
> the only way to make an existing system in to RAID 1,
> is to back it off, install to RAID and restore the
> data.

Unfortunately this is the best way to do it.  The md driver
needs to be able to write its stripes (or whatever the right
word is) for the RAID array across the disks.  The existing
filesystem on the disk is not usable by the md block device
driver.

Since it has to blow away the filesystem on the disk to write
the RAID array stripes, you would also lose your data that
was contained in that filesystem.

> Does anyone have a pointer to a document that debunks
> this? Can I in fact, add a second disk and make the
> system RAID 1 or do I have to back it off and
> reinstall?

OK, you could try to make a bogus RAID1 array using only the
second disk.  I'm not sure if the md driver will let you 
make an array that starts out with a missing member or not.

Then make a filesystem on the new "RAID1" array.  Once you 
get the files copied over to the new RAID1 filesystem, you
could hot-add the first disk to the array and then the md
driver will automatically write the stripes over the 
first disk.

If the automatic tools won't let you create a RAID1 array
with only one member, you can try to make the kernel manage
the array using kernel command lines like md=0,/dev/hdb,/dev/hdc
or something like that.  Read the linux/Documentation/md.txt for
more information.  For RAID1 it appears you'll have to figure
out how to make a persistent superblock to use the kernel
command line.

Hope this helps,
Jim

-- 
Jim Ockers, P.Eng. (ockers at ockers.net)
Contact info: please see http://www.ockers.net/



More information about the clue-tech mailing list