RAID/Onboard

From Gentoo Linux Wiki

Jump to: navigation, search
Please format this article according to the Style Guidelines and Wikification suggestions, then remove this notice {{Wikify}} from the article.

Reason(s):

  • Uses first person (I, me, etc.)
  • Template Usage.
Note: I've found this article in the google-cache of gentoo-wiki

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. I wrote this for a dual boot system with Windows XP and Gentoo together on a stripeset.

Note: If you are planning to build a "Linux only system" think about Software-Raid Software RAID Install because it is much more flexible and can be used together with LVM.

Contents

[edit] Test Linux Driver

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

gentoo dodmraid

Look for devices in /dev/mapper

# ls -la /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.

[edit] 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.

Note: If you create your boot partition with Partition Magic the new partition is not your_raid_set1, it is the next free partition number, that is not a problem, but can be confusing.


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 / partition --> Type 83 Linux (can be logical)
  4. your swap partition --> Type 82 swap (can be logical)
  5. whatever you want 
# cfdisk /dev/mapper/your_raid_set

[edit] Installing Windows

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


[edit] Installing Gentoo

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

# cfdisk /dev/mapper/your_raid_set

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.

[edit] 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.

# emerge device-mapper # emerge genkernel # genkernel --dmraid all

This will take some time.

Note: Could someone please write here how to do this step without using genkernel? RAID/NVRAID_with_dmraid#Building_the_Kernel

[edit] Install dmraid

# emerge dmraid

now continue with handbook until it comes to the boot manager

[edit] Install Grub

[edit] 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.

# dmsetup mknodes
[edit] emerge Grub
# emerge grub
[edit] 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:

# grub --device-map=/dev/null

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:

grub> device (hd0) /dev/mapper/your_raid_set

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.

grub> geometry (hd0) C H S

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.

grub> root (hd0,0) grub> setup (hd0) grub> quit
[edit] Edit grub.conf

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

File: # nano /boot/grub/grub.conf
default 0
timeout 10
splashimage (hd0,0)/grub/splash.xpm.gz

title Gentoo Linux
kernel (hd0,0)/your_kernel_image root=/dev/ram0 real_root=/dev/mapper/your_raid_set* init=/linuxrc ramdisk=8192 dodmraid udev
#(change your_raid_set* to your root partition)
#init=/linuxrc may be needed if you get errors after the ramdrive loading
#udev is needed on some newer boards, add this if during boot it fails to find root
initrd (hd0,0)/your_initrd_image

title Windows XP SP2
rootnoverify (hd0,1)
makeactive
chainloader +1

[edit] Reboot your System

This is also described in the handbook.

[edit] 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)

[edit] Links

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

[edit] if you already have gentoo installed on an other hdd

you could see your devices with:

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

and then make the devices file appear:

# dmraid -a

then see if they appeared:

# ls /dev/mapper/
control  hpt45x_cidedgihfd  hpt45x_cidedgihfd1

then mount them:

# mount /dev/mapper/hpt45x_cidedgihfd1 /mnt/somewhere
Mainboard Raid chip works? Remarks
Gigabyte GA-8N-SLI Quad Royal nForce 4 SLI  :-)
Gigabyte GA-K8NF-9 nForce4  :-) 2007.0 kernel 2.6.22-gentoo-r9 dodmraid
Asus Maximus Formula X38 ICH9R 1004 bios  :-) Works fine but needs udev at the end of the boot line in grub.conf, tested on 2008.0, kernel 2.6.24-gentoo-r4.
Asus M2N32-SLI Deluxe nForce 590 SLI AMD  :-) Works fine, tested on 2007.0, kernel 2.6.22-gentoo-r5.
Asus A8N-E nForce 4  :-)
Asus A8N SLI nForce 4  :-)
Asus A8N-32 SLI Deluxe nForce 4  :-)
Asus A8N5X nForce 4  :-)
Asus A8V DELUXE VIA VT6420  :-)
Asus A8V DELUXE PDC20378 Promise Fastrack 378  :-)
Asus K8N nVidia nForce 3 250GB  :-)
Asus P5B Deluxe With Wifi Jmicron / Intel  :-) I had to use the kernel-of-death cd as the 2006.1 does not support the jmicron controller for boot.
Asus A8N SLI Silicon Image sil3114  :-)
Asus A8N SLI Premium nForce 4  :-) faster than sil3114
Asus A7N8X  :-)
ASUS K8V Deluxe Promise FastTrak 2300  :-) Not an onboard RAID Chip but compareable to these and so it worked fine. I already had an installed gentoo on one of the future RAID1- HDDs, it was not a problem to backup the data and reinstall it after setting up the RAID- system. Notice: After chroot my system mounted root from sda instead of the device mapper, the reason was possible a typo in fstab, but nevertheless after correcting it, the system synched the HDDs automatically. Really good word.
Asus K8V SE Deluxe VIA VT6420  :-)
Asus P5BP-E/4L Intel ICH7R  :-)
Asus P5GDC Deluxe Intel ICH6R  :-)
Asus P5K-E Wifi AP Intel ICH9R  :-) working fine,partitions are linked against /dev/dm-1,/dev/dm-2,/dev/dm-x
Asus P5Q-E Intel ICH10R  :-) Gentoo 2008.0 Beta 2, 2.6.5-gentoo-r6
Asus K8N-DL nForce 4 pro  :-)
Asus A7N8X Deluxe Silicon Image sil3112  :-( only 30Mbits/sec whith 2 WD raptor10k
Asus P4P800 Deluxe Intel ICH5  :-)
Asus P5AD2-E Deluxe Intel ICH6R  :-)
Asus A7V600 VIA VT6420  :-) up to kernel 2.6.17 with dmraid 1.0.0.rc13 and device-mapper 1.02.12
Asus A7V Promise FastTrak 133 PDC20276  :-) This guide worked word for word!
Asus P5N32 SLI deluxe nForce4 SATA =) dodmraid does the trick
Asus PC-DL Deluxe Promise Fastrak 378  :-) 2007.0
Asus M2NPV-MX nForce4 SATA =)
MSI K8N Neo2 Platinum nForce 3  :-)
MSI K7N2 Delta2 nForce 2  :-)
MSI K8N Diamond nForce 4  :-) Easy installation and no problem even with ntfs.
MSI KT3 Ultra  :-) 1*
MSI K9NU Neo-V ALi M1997  :( RAID Array not found.
GIGABYTE GA-K8NE nForce4 SATA =/ worked fine with unupdated Gentoo 2006.0 with kernel 2.6.15, but now i have updated/emerged glibc,dodmraid and udev to new versions, and it stopped working...
Gigabyte 7VAXP =) Well, dmdoraid worked perfect for the device (2 WD80JDB RAID0) to be visible on the livecd. When i tried to make the installation using the installer (by defining manually the partitions, skipping the partitions creation part), i always got a failure message during grub install. I had to go with the installer all the way until kernel install, then reinstall using the guide here, chroot, install devicemapper, compile, install grub etc. Perhaps using the installer is not recommended. Anyhow this guide worked like a charm :))
Gigabyte GA-M57SLI-S4 nForce5  :-)
Gigabyte GA-965P-DQ6 ICH8R  ;) Used different partition scheme, but it doesn't matter. Just configured grub in different way. I use Intel Matrix RAID technology and it there is no difference between Matrix RAID and usual RAID0, RAID1 (Gentoo 2007.0 Filesystem used - XFS)
Gigabyte 965P-S3 Raid onboard chip: jmicron  ;) Very nice, install, boot, work! (2007.0 was used). _Don't_use_ReiserFS_!_, that will cause problems copying files >200MB
Gigabyte GA-G33M-DSR2 ICH9R / Intel Matrix Storage  :-) Works fine
Gigabyte P35-DS4 ICH9R / Intel Matrix Storage  :-) Works fine
Abit NF7-S v2 Silicon Image sil3112  :-( 30Mb/sec two WD5000AAKS(500Gb each). Only with patched bios. Unpatched bios run 70Mb/sec, but produced severe data corruption, when copying files directly in nonraid mode. Same for sil3152.
Abit KV8-MAX3 Silicon Image sil3112  :-)
Abit IP35-pro ICH9R / Intel Matrix Storage  :-) Kernel 2.6.23-gentoo-r3. Instead of pure genkernel, I used make menuconfig to make a custom kernel config, then did cp /usr/src/linux/.config then genkernel --dmraid --kernel-config=/.config all
ASUS P5K Deluxe/WiFi-AP ICH9R / Intel Matrix Storage  :-) Works fine. Just as above: Kernel 2.6.23-gentoo-r3. Instead of pure genkernel, I used make menuconfig to make a custom kernel config, then did cp /usr/src/linux/.config then genkernel --dmraid --kernel-config=/.config all
EPoX EP-8KDA3+ PRO nForce 3 250Gb  :-)
EPoX EP-8RDA3+ Silicon Image sil3112  :-)
Foxconn N68S7AA-8EKRS2H Nvidia 680i sata?  :-)
Shuttle SN25P nForce 4  :-)
Shuttle SN95G5 nForce 3 250Gb  :-) Like a champ!
DFI Lanparty UT nForce 4  :-)
Intel 82801FB? ICH6R/ICHR6RW  :-)
Silicon Image Sil3114 PCI Card Sil3114  :-) Works like a charm.
HP ProLiant ML310 Generation 4 HP Smart Array Controller  :< RAID Array not found.
Asus P5N32-E SLI Nvidia 680i  :-) With dodmraid works really smooth.
MSI P35 Neo2-FR ICH9R  :-) Had to use Ubuntu 7.10 LiveCD (because my CDRom wasn't found on gentoo 2007.0 LiveCD) installed dmraid and chrooted. Had to change the id for /boot back to 82 after installing XP otherwise grub won't install. Now everything woks fine on my Raid-0.
Dell XPS M2010 Intel ICH7-M DH  :-) No problems...
Asus P5LD2 ICH7R(fakeraid)  :-) Works fine ...
don't know 2* Promise FastTrack 100TX2 PCI  :3 Runs flawlessly!
- highpoint HPT 374 PCI card  :-) The card broke...so i needed a way to recover the data...so i used dmraid in order to do it(and now i have theses data available under Gentoo)
Gigabyte GA-Q35M-S2 ICH9R  :-) Used 4×750G (Samsung HD753LJ) as RAID5 array size capped to 2000GB, because Intel Matrix Storage BIOS can't mark >2000GB arrays as bootable (wasted 96GB)
ASUS P6T ICH10R  :-) cheers mate!!!
ASUS M4A79T Deluxe SB750  :-) Works fine.
Personal tools