Re: booting RAID partitions

Jeff Garzik (jgarzik@pobox.com)
Sat, 29 Aug 1998 16:03:53 -0400 (EDT)


You wrote:
> On 26 Aug 1998 17:43:19 -0700, MOLNAR Ingo <mingo@chiara.csoma.elte.hu>
> wrote:
> >there is a trick though: to allocate a large enough file and determine
> >where the contents map to, and pick out the blocks belonging to the target
> >disk(s). Then the image can be scattered across those blocks and fed to
> >lilo's chainloader. The image will only be on that disk. (the real image
> >file will be a big file, sparsely containing the real image)

[fmt'd accidentally]
> Actually, I'd suggest something slightly better: Instead of writing
> kernel chunks only on the first disk, those chunks may as well be
> written on each disk, and you'd end up with a complete bootable
> kernel on each disk. The advantage is that if you loose a disk in
> a Raid 4/5 configuration, you still have a working kernel on each
> of the other disks, and you can still boot in degraded mode.

This solution seems the best of all that I've heard so far. Reserve a
certain amount of space at the beginning of every partition included in a
metadisk; 2 MB? A kernel and initrd image (if any) are copied into each
component partition, in that first 1-2MB reserved space.

Then booting off a metadisk is simple. Just list the component partitions
on the kernel command line, line

append = "md-root=linear,/dev/sda1,/dev/sdb1,/dev/sdc1"
or
append = "md-root=raid1+0,/dev/sda1,/dev/sdb1,/dev/sdc1,/dev/sdd1"
or
append = "md-root=raid5,/dev/sda1,/dev/sdb1,/dev/sdc1"
or
append = "md-root=raid1,/dev/sda1,/dev/sdb1"
...

md yanks the kernel and initrd off the first partition it finds.

Installation is even easy... :)

cat vmlinux.gz initrd.img.gz > mdimage
dd if=mdimage of=/dev/sda1 bs=1024k # md part 1/3
dd if=mdimage of=/dev/sdb1 bs=1024k # md part 2/3
dd if=mdimage of=/dev/sdc1 bs=1024k # md part 3/3

You probably want to MD5-sum the 2MB kernel/initrd space and write disk
offsets, so the above example is a simplification.

How does that sound?

Jeff

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html