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!
Quoted 6 lines · Alok K. Dhir
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
--
Quoted 4 lines · Alok K. Dhir
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.
Quoted 19 lines
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.conffrom:kernel /vmlinuz-2.4.9-13 ro root=/dev/sda2To:
kernel /vmlinuz-2.4.9-13 ro root=/dev/md2Changed fstab so "/" points to
/dev/md2as well, crossed my fingers, and rebooted.No luck. I get a "cannot mount root" error.
Quoted 7 lines
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.
Signature · 3 lines
bill davidsen <[email protected]> CTO, TMR Associates, Inc Doing interesting things with little computers since 1979.
Quoted 7 lines · Bill Davidsen
Quoted 4 lines · Alok K. Dhir
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.
Quoted 5 lines
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).
Quoted 4 lines
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).
...
Quoted 3 lines
Quoted 3 lines
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.
Quoted 9 lines
Quoted 1 line
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.
Signature · 6 lines
................................................................ : [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}...............:
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Does the kernel support autostarting nested RAID partitions?
Quoted 8 lines
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
Quoted 5 lines · 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?
Quoted 7 lines
Quoted 5 lines
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.
Signature · 3 lines
bill davidsen <[email protected]> CTO, TMR Associates, Inc Doing interesting things with little computers since 1979.
Quoted 4 lines · Bill Davidsen
Quoted 1 line · On Tue, 22 Jan 2002, [iso-8859-1] Jakob Østergaard wrote:
On Tue, Jan 22, 2002 at 12:15:28PM -0500, Bill Davidsen wrote:
Quoted 8 lines
Quoted 3 lines
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 ?
Quoted 11 lines
Quoted 8 lines
Quoted 6 lines
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.
Signature · 6 lines
................................................................ : [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}...............: