2002-01-18 16:40:51

by Alok K. Dhir

[permalink] [raw]
Subject: Autostart RAID 1+0 (root)


Hey all - I may be trying to do the impossible here, but here goes:

I want to test using a software RAID 1+0 partition as root: md0 and md1
set up as mirrors between two disks each, and md2 set up as a stripe
between md0 and md1. However, the RedHat 7.2 installer doesn't allow
creating nested RAID partitions.

Being stubborn, I installed the OS onto a separate 4 gig disk, installed
all the latest patches+fixes to the OS, including the RH2.4.9-13 kernel,
then created md0, md1, and md2. I formatted md2 with reiserfs. No
problem so far.

Next, I copied the entire contents of the root partition onto md2,
changed the relevant line of /boot/grub/grub.conf from:

kernel /vmlinuz-2.4.9-13 ro root=/dev/sda2

To:

kernel /vmlinuz-2.4.9-13 ro root=/dev/md2

Changed fstab so "/" points to /dev/md2 as well, crossed my fingers, and
rebooted.

No luck. I get a "cannot mount root" error.

Attempting to speed read the boot messages before I get the panic, it
appears that md0 and md1 are autostarted, but it doesn't look like md2
is.

Does the kernel support autostarting nested RAID partitions?

Is doing software 1+0 a bad idea anyway due to performance issues?

Any ideas?

Thanks!


2002-01-19 00:11:46

by Tim Moore

[permalink] [raw]
Subject: Re: Autostart RAID 1+0 (root)

"Alok K. Dhir" wrote:
>
> Hey all - I may be trying to do the impossible here, but here goes:
>
> I want to test using a software RAID 1+0 partition as root: md0 and md1
> set up as mirrors between two disks each, and md2 set up as a stripe
> ...

http://www.linuxdoc.org/HOWTO/Boot+Root+Raid+LILO.html , appendix C & D.

May also be useful:
http://www.redhat.com/support/resources/tips/raid/RAID-INDEX.html
--

2002-01-22 17:16:15

by Bill Davidsen

[permalink] [raw]
Subject: Re: Autostart RAID 1+0 (root)

On Fri, 18 Jan 2002, Alok K. Dhir wrote:

> I want to test using a software RAID 1+0 partition as root: md0 and md1
> set up as mirrors between two disks each, and md2 set up as a stripe
> between md0 and md1. However, the RedHat 7.2 installer doesn't allow
> creating nested RAID partitions.

Here's my understanding. If you are using hardware RAID you can do
anything your controller supports, and it looks like a single drive to the
CPU. But if you are looking for reliable boot, you need to use /boot as a
RAID-1 partition on the first two drives, and make that partition the
active partition (that may not be needed with your BIOS).

This is because if the first disk fails totally, the 2nd will be used to
boot. You also should use an initrd image to be sure all you need to get
up is on that small mirrored partition. After that your other partitions
can be whatever pleases you.

> Being stubborn, I installed the OS onto a separate 4 gig disk, installed
> all the latest patches+fixes to the OS, including the RH2.4.9-13 kernel,
> then created md0, md1, and md2. I formatted md2 with reiserfs. No
> problem so far.
>
> Next, I copied the entire contents of the root partition onto md2,
> changed the relevant line of /boot/grub/grub.conf from:
>
> kernel /vmlinuz-2.4.9-13 ro root=/dev/sda2
>
> To:
>
> kernel /vmlinuz-2.4.9-13 ro root=/dev/md2
>
> Changed fstab so "/" points to /dev/md2 as well, crossed my fingers, and
> rebooted.
>
> No luck. I get a "cannot mount root" error.
>
> Attempting to speed read the boot messages before I get the panic, it
> appears that md0 and md1 are autostarted, but it doesn't look like md2
> is.
>
> Does the kernel support autostarting nested RAID partitions?
>
> Is doing software 1+0 a bad idea anyway due to performance issues?

It should outperform most other RAID configs under heavy load, but in most
cases RAID-5 is fine for system which don't need the absolute highest
performance. Note that the extra writes are queued and there are no extra
reads unless it is in recovery mode. RAID-1 can be faster, because there
are two copies of the data, if one drive is busy the other can be used. I
haven't checked to see that software RAID does that correctly and gets the
benefit.

--
bill davidsen <[email protected]>
CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.

2002-01-22 17:46:19

by Jakob Oestergaard

[permalink] [raw]
Subject: Re: Autostart RAID 1+0 (root)

On Tue, Jan 22, 2002 at 12:15:28PM -0500, Bill Davidsen wrote:
> On Fri, 18 Jan 2002, Alok K. Dhir wrote:
>
> > I want to test using a software RAID 1+0 partition as root: md0 and md1
> > set up as mirrors between two disks each, and md2 set up as a stripe
> > between md0 and md1. However, the RedHat 7.2 installer doesn't allow
> > creating nested RAID partitions.
>
> Here's my understanding. If you are using hardware RAID you can do
> anything your controller supports, and it looks like a single drive to the
> CPU. But if you are looking for reliable boot, you need to use /boot as a
> RAID-1 partition on the first two drives, and make that partition the
> active partition (that may not be needed with your BIOS).

I think he is referring to software RAID. And yes, it is indeed a problem
that the RedHat installer cannot create nested RAIDs (at least, I too was
unable to do that, so either it's impossible, or I'm equally blind).

> This is because if the first disk fails totally, the 2nd will be used to
> boot. You also should use an initrd image to be sure all you need to get
> up is on that small mirrored partition. After that your other partitions
> can be whatever pleases you.

Also, GRUB/LILO only support booting from RAID-1 (or no RAID).

...
> >
> > Does the kernel support autostarting nested RAID partitions?
> >

Yes it does. If you have persistent superblocks on all arrays, they
*should* autostart.

If you boot from the 4G disk, does the array start properly ? Does
it start properly even if you remove your /etc/raidtab ?

Please check that you have the correct RAID levels either compiled
into your kernel, or on an initrd.

> > Is doing software 1+0 a bad idea anyway due to performance issues?
>
> It should outperform most other RAID configs under heavy load, but in most
> cases RAID-5 is fine for system which don't need the absolute highest
> performance. Note that the extra writes are queued and there are no extra
> reads unless it is in recovery mode. RAID-1 can be faster, because there
> are two copies of the data, if one drive is busy the other can be used. I
> haven't checked to see that software RAID does that correctly and gets the
> benefit.

A performance improvement went into 2.4 at some stage - all newer 2.4 kernels
will schedule reads to the mirror which has it's head nearest to where the
read should occur. This works very well in my experience.

--
................................................................
: [email protected] : And I see the elder races, :
:.........................: putrid forms of man :
: Jakob ?stergaard : See him rise and claim the earth, :
: OZ9ABN : his downfall is at hand. :
:.........................:............{Konkhra}...............:

2002-01-22 18:07:09

by Alok K. Dhir

[permalink] [raw]
Subject: RE: Autostart RAID 1+0 (root)

> > >
> > > Does the kernel support autostarting nested RAID partitions?
> > >
>
> Yes it does. If you have persistent superblocks on all arrays, they
> *should* autostart.
>
> If you boot from the 4G disk, does the array start properly ?
> Does it start properly even if you remove your /etc/raidtab ?
>
> Please check that you have the correct RAID levels either
> compiled into your kernel, or on an initrd.

1. I have persistent superblocks on all arrays.
2. Booting from the 4G does allow the arrays to start properly.
3. The first two arrays (md0 and md1, the mirrors) start properly
without raidtab. The third, the stripe between md0 and md1, does not.
4. All raid levels are compiled as modules, along with reiserfs, and my
scsi card driver in an initrd. I also tried compiling a monolithic
kernel with all of these without success.

I did, in fact, get it working. The only way I was able to do boot with
my nested array autostarted and mounted as root was to create an initrd
with a statically compiled raidstart and a copy of my raidtab in the
initrd's etc dir. I then issue "raidstart mdx" commands for each of the
arrays in linuxrc. I actually just modified the mkinitrd genereated
initrd image.

I can only conclude that autostarting nested arrays either doesn't work,
or is broken in RH-2.4.9-13. I have not tried a more recent kernel with
this machine.

Thanks

Al

2002-01-22 20:13:25

by Bill Davidsen

[permalink] [raw]
Subject: Re: Autostart RAID 1+0 (root)

On Tue, 22 Jan 2002, [iso-8859-1] Jakob ?stergaard wrote:

> On Tue, Jan 22, 2002 at 12:15:28PM -0500, Bill Davidsen wrote:

> I think he is referring to software RAID. And yes, it is indeed a problem
> that the RedHat installer cannot create nested RAIDs (at least, I too was
> unable to do that, so either it's impossible, or I'm equally blind).

The RH installer also won't do RAID from a text install, so if you lack
memory or the right graphic card you just can't do the install at all
(unless I miss something). What good is install from serial console if you
can't use any setup but the big blob?

>
> > This is because if the first disk fails totally, the 2nd will be used to
> > boot. You also should use an initrd image to be sure all you need to get
> > up is on that small mirrored partition. After that your other partitions
> > can be whatever pleases you.
>
> Also, GRUB/LILO only support booting from RAID-1 (or no RAID).

Another factor, for sure. Fortunately I believe only the boot partition
needs to be RAID-1, after that the kernel should take over.

--
bill davidsen <[email protected]>
CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.

2002-01-22 21:53:11

by Jakob Oestergaard

[permalink] [raw]
Subject: Re: Autostart RAID 1+0 (root)

On Tue, Jan 22, 2002 at 03:12:07PM -0500, Bill Davidsen wrote:
> On Tue, 22 Jan 2002, [iso-8859-1] Jakob ?stergaard wrote:
>
> > On Tue, Jan 22, 2002 at 12:15:28PM -0500, Bill Davidsen wrote:
>
> > I think he is referring to software RAID. And yes, it is indeed a problem
> > that the RedHat installer cannot create nested RAIDs (at least, I too was
> > unable to do that, so either it's impossible, or I'm equally blind).
>
> The RH installer also won't do RAID from a text install, so if you lack
> memory or the right graphic card you just can't do the install at all
> (unless I miss something). What good is install from serial console if you
> can't use any setup but the big blob?

I was able to set up RAID in text-mode from bootnet.img on a low-end pentium
yesterday. But that was RedHat 7.2, and I think that earlier versions didn't
allow that. Are you sure you tried this with 7.2 ?

>
> >
> > > This is because if the first disk fails totally, the 2nd will be used to
> > > boot. You also should use an initrd image to be sure all you need to get
> > > up is on that small mirrored partition. After that your other partitions
> > > can be whatever pleases you.
> >
> > Also, GRUB/LILO only support booting from RAID-1 (or no RAID).
>
> Another factor, for sure. Fortunately I believe only the boot partition
> needs to be RAID-1, after that the kernel should take over.

Yep.


--
................................................................
: [email protected] : And I see the elder races, :
:.........................: putrid forms of man :
: Jakob ?stergaard : See him rise and claim the earth, :
: OZ9ABN : his downfall is at hand. :
:.........................:............{Konkhra}...............: