RAID/Onboard

Many mainboards have some Raid functions on board. Mostly that is not a "real" raid controller. The raid functions are mainly done by the (windows) driver. So linux won't see the raid combo, only the single drives. This is a howto get Gentoo on a Raid Combo with dual boot system with Windows XP and Gentoo together on a stripeset.

Test Linux Driver
Boot from a Gentoo Live CD. Use the kernel option: dodmraid

gentoo dodmraid

Look for devices in /dev/mapper

crw-rw 1 root root  10, 62 Aug 22 01:35 control brw--- 1 root root 254,  0 Aug 21 21:46 sil_afaidcaafaci

If you can see only the device called "control", then the Live Kernel failed to detect your raid set, and you can stop reading. If you use the LiveCD 2006.1 and don't see the raid set: there is a bug in the build - use the LiveCD 2006.0 and it should work fine. If you see another device, then this is your raid set. Lets call it your_raid_set from now on. your_raid_set is the whole "disk" your_raid_set1 is the first partition.

Partitions
You need a boot partition and it must be the first partition on your raid set, because Grub won't understand our raid set, and our Bios can only boot from the Cylinder 0-1024. A boot partition can be very small 50 mb is really enough.

If your Windows is already installed use a tool like partition magic to make some room for a little boot partition.

If not, use fdisk or cfdisk to create:


 * 1) A boot partition --> Type 1B Hidden Fat32 (this prevents Windows setup from calling this Drive c:) With Vista this should be a Hidden NTFS and although you will see it during install it will still work.
 * 2) Your windows partition (NTFS) --> Type 07 NTFS
 * 3) your root partition --> Type 83 Linux (can be logical)
 * 4) Your swap partition --> Type 82 swap (can be logical)
 * 5) Whatever you want

Installing Windows
I always install Windows first because its Setup routine overwrites the MBR, deleting the Boot manager. I don't help you here :-)

Installing Gentoo
Use fdisk or cfdisk again to change the type of your boot partition to 83

It is possible, that fdisk is not able to re-read the partition table afterwards, so you have to restart your system and continue from this point on.

Now you can use the "Gentoo Installation Handbook" make sure you are using the correct devices /dev/mapper/your_raid_set* and not /dev/sda*. Come back here when it comes to the kernel.

Configure kernel
We need a initial ram disk to boot, I suggest to use Genkernel. I can't help you with gentoo-sources or vanilla-sources. You may need to emerge dmraid (below) before you can emerge genkernel.

This will take some time.

Install dmraid
now continue with handbook until it comes to the boot manager

Update the chrooted /dev
If the chrooted /dev does not have the mapper directory, it has to be built otherwise grub complains about unknown devices.

Install Grub in MBR
In some cases, you will have to specify "drive" geometry (it was my case with nvraid). Run fdisk on the raid drive, and note C/H/S informations for later usage in grub.

We have to set the devices for grub manualy, grub can't do this for us. We use the --device-map option and input nothing:

Now we are in Grub shell mode, we tell grub which "linux device" becomes which "bios device" on boot. If your boot partition is /dev/mapper/your_raid_set1 then it becomes (hd0,0) on boot the last bios nr is the linux partition nr -1.

First tell grub where your partitions are:

Note that partitions are identified in the order in which they are numbered on the partition table. In other words, if your boot partition is not labeled your_raid_set1, it will not be (hd0,0).

If you have problems with your partitions in grub, tell grub what your drive geometry is now. But don't forget to set the devices first or grub doesn't know what you are talking about.

replace C H S with cylinders, heads and sectors.

Now Grub knows where the boot partition is, and where to write the MBR. Next step is Grub install, type root (hd0, and press tab, if you did nothing wrong grub should show you a list of possible partitions, if not you did something wrong.

Edit grub.conf
create a file grub.conf in /boot/grub/.

Reboot your System
This is also described in the handbook.

Tested Hardware
If you use this howto please add your Hardware to This list: 1* Gentoo LiveCD can't detect, however using knoppix and compile dmraid manually works. From there I continue to bootstrap it. During kernel compile I must enable 'Enable controller even if BIOS is disabled' however, else it can't detect. (Tested during late 2004, havn't tried on the latest livecd. ) --202.156.6.3 05:15, 14 December 2005 (GMT)e 2* I'm actually too lazy to check up, but since it's not an onboard chipset but a pci controller it should not be that important. 6:53, 28 March 2008 (GMT+1)

Links
"BIOS RAID support on Linux 2.6.x with dmraid"

If You Already Have Gentoo Installed on Another Drive
You can see your devices with:

name  : hpt45x_cidedgihfd size  : 468883200 stride : 128 type  : stripe status : ok subsets: 0 devs  : 2 spares : 0
 * Active Set

Make the devices file appear:

Then, to see if they appeared:

control hpt45x_cidedgihfd  hpt45x_cidedgihfd1

Finally, mount them:

Hardware Compatibility List
This list is by no means exhaustive. If your hardware works, or doesn't work, add it to the list.