If you are owner of a mainboard with an onboard RAID controller, it's most probably just a normal IDE controller with a BIOS to support some RAID functionality. Some of these controllers also come as a PCI extension card. These FAKE-RAID controllers are just fantastic to dualboot more than one OS from the RAID, while beining able to use exactly the same array in both OS'es. (just like hardware raid)
The dmraid tool can create device-mapper nodes which correspond to the partitions on an array. It reads the metadata the BIOS wrote to the disks and uses it to create the RAID devices.
The following controllers (metadata formats) are supported*:
Highpoint HPT37X
Highpoint HPT45X
Intel Software RAID
Promise FastTrack
Silicon Image Medley
Nvidia Nforce
*Supported doesn't mean it will work in all circomstances
Remember if you are a owner of a BIOS raid controller, the RAID is (in 32bit OS'es) just software based. There is no (remarkable) difference in performace between a dmraid setup or a normal DM/MD setup. Dmraid just enables you to have the same array in Linux as other OS'es like MSDOS, Windows or FreeBSD. People who are not interested in having a dualboot should (in fact) not be interested in this howto.
Warning to all users
Dmraid isn't quite ready yet and could destroy your data (although very unlikely if it maps the RAID correctly). In the future I'll expect more controllers (in fact: metadata formats) to be supported by the tool and some improvements in the detection code which decreases risks test it.
Prerequisites
* Partitioning is already done
* You have Windows installed on the second partition o/t raid
* You have a bootpartition which is allways wise when dualbooting
* The bootpartition is the first partition on the raid (The first partition is going to be used for /boot
Why a bootpartition?:
* People having a bootpartition can leave their MBR to the one MSWindows installs (this one searches for the active partition).
* It's very easy to recover the dualboot after re-installing Windows (which allways fucks up your bootloader setup). You just have to make the first partition active and the Microsoft MBR will load GRUB.
* After formatting the root partition (in case you want to ged rid of Gentoo
[step 1]Download the Gen2dmraid LiveCD and boot it
http://tienstra4.flatnet.tudelft.nl/~ge ... d-0.99.iso
[step 2]Load the device driver for your SATA controller, IDE users can skip it.
Code: Select all
modprobe sata_sil
#OR
modprobe sata_promise
#OR
modprobe sata_nv
Code: Select all
dmraid -ay
ls -la /dev/mapper/[step 4]Format and mount partitions (think twice)
Code: Select all
mkfs.ext3 /dev/mapper/${your_boot_partition}
mkfs.reiser4 /dev/mapper/${your_root_partition}
#reiser4 users should know what they are doing, this ain't a reiser4 howto
mount /dev/mapper/${your_root_partition} /mnt/gentoo
mount /dev/mapper/${your_boot_partition} /mnt/gentoo/bootCode: Select all
cd /mnt/gentoo
wget ${url-stage-tarball}
tar -jpxvf ${the_stage3_tarball}
rm ${the_stage3_tarball}
mount -o bind /dev/ /mnt/gentoo/dev
mount -t proc proc /mnt/gentoo/proc
chroot . /bin/bash --login
Code: Select all
emerge --sync
emerge grub -pv
emerge grubCode: Select all
emerge development-sources -pv
emerge development-sources
cd /usr/src/linux
zcat /proc/config.gz >./.config
make oldconfig
make menuconfig
# compile-in dm-mod and The MD core of the RAID flavour you use!!!
# reiser4 needs a patched kernel
make
make modules_install
cp arch/i386/boot/bzImage /boot/vmlinuz[step 8] Creating the initrd like on: http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/
Code: Select all
cd /root
wget http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/dmraidinitrd-0.93
wget http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/linuxrc-0.93
chmod +x dmraidinitrd-0.93
./dmraidinitrd-0.93 linuxrc-0.93 initrd
cp initrd /boot/initrd
Code: Select all
# Grub should not detect bios device names itself! Do this or be a fool!:
/sbin/grub --device-map=/dev/null
grub> device (hd0,0) /dev/mapper/${devicename_of_your_bootpartition}
grub> device (hd0) /dev/mapper/${devicename_of_your_raid}
grub> root (hd0,0)
grub> setup (hd0,0)
[step 10] Configuring the bootloader
Edit /boot/grub/grub.conf
Code: Select all
timeout 30
default 0
title GNU/Linux
root (hd0,0)
kernel /vmlinuz root=/dev/ram0 real_root=/dev/mapper/${your_root_partition} init=/linuxrc
initrd /initrd
title Windows
root (hd0,1)
rootnoverify
chainloader +1
update: People are talking about Devfs. Don't do that, use UDEV instead!
To use udev make sure you have a recent and stable version of udev and baselayout >= sys-apps/baselayout-1.11.7-r2 (~x86 at moment of writing)
Code: Select all
emerge udev -pv
emerge udev
mkdir -p /etc/portage
echo 'app-shells/bash ~x86' >>/etc/portage/package.keywords
echo 'sys-apps/sysvinit ~x86'>>/etc/portage/package.keywords
echo 'sys-libs/readline ~x86'>>/etc/portage/package.keywords
echo 'sys-apps/baselayout ~x86'>>/etc/portage/package.keywords
emerge baselayout -pv
emerge baselayoutCode: Select all
emerge device-mapper -pv
emerge device-mapper
Code: Select all
#change /etc/conf.d/rc to set RC_DEVICE_TARBALL="no"
sed -e "s:RC_DEVICE_TARBALL=\"yes\":RC_DEVICE_TARBALL=\"no\":" </etc/conf.d/rc >/etc/conf.d/rc.new
mv /etc/conf.d/rc.new /etc/conf.d/rc
Don't forget to make the /boot partition active (Fdisk in Linux or somewhere in "control panel" under MS Windows XP)
Your raid can be 0x81 to your bios. In that case grub will fail to load. Repeat steps 9 and 10 and use hd1 instead! You can discover this by testing it with a grub floppy before following the steps described in the howto. Make it your [step0] OR [step11] and hope you'll never have to use it.



