1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta content="text/html; charset=ISO-8859-1"
5
http-equiv="content-type">
6
<title>Gentoo - SoftRaid</title>
9
<span class="postbody"><span style="font-weight: bold;">Inportant
10
information about BIOS raid and the dmraid tool</span>
12
If you are owner of a mainboard with an onboard RAID controller, it's
13
most probably just a normal IDE controller with a BIOS to support some
14
RAID functionality. Some of these controllers also come as a PCI
15
extension card. These FAKE-RAID controllers are just fantastic to
16
dualboot more than one OS from the RAID, while beining able to use
17
exactly the same array in both OS'es. (just like hardware raid)
20
The dmraid tool can create device-mapper nodes which correspond to
21
the partitions on an array. It reads the metadata the BIOS wrote to the
22
disks and uses it to create the RAID devices.
25
The following controllers (metadata formats) are supported*:
40
*<span style="font-style: italic;">Supported doesn't mean it will work
41
in all circomstances</span>
44
Remember if you are a owner of a BIOS raid controller, the RAID is
45
(in 32bit OS'es) just software based. There is no (remarkable)
46
difference in performace between a dmraid setup or a normal DM/MD
47
setup. Dmraid just enables you to have the same array in Linux as other
48
OS'es like MSDOS, Windows or FreeBSD. People who are not interested in
49
having a dualboot should (in fact) not be interested in this howto.
52
<span style="font-weight: bold;">Warning to all users</span>
54
Dmraid isn't quite ready yet and could destroy your data (although
55
very unlikely if it maps the RAID correctly). In the future I'll expect
56
more controllers (in fact: metadata formats) to be supported by the
57
tool and some improvements in the detection code which decreases risks
61
<span style="font-weight: bold;">Prerequisites</span>
63
* Partitioning is already done
65
* You have Windows installed on the second partition o/t raid
67
* You have a bootpartition which is allways wise when dualbooting
69
* The bootpartition is the first partition on the raid (The first
70
partition is going to be used for /boot <img
71
src="http://forums.gentoo.org/images/smiles/icon_smile.gif" alt=":)"
72
title="Smile" border="0"> )
77
* People having a bootpartition can leave their MBR to the one
78
MSWindows installs (this one searches for the active partition).
80
* It's very easy to recover the dualboot after re-installing Windows
81
(which allways fucks up your bootloader setup). <span
82
style="font-style: italic;">You just have to make the first partition
83
active and the Microsoft MBR will load GRUB. </span>
85
* After formatting the root partition (in case you want to ged rid of
86
Gentoo <img src="http://forums.gentoo.org/images/smiles/icon_wink.gif"
87
alt=";)" title="Wink" border="0"> ) you bootloader setup will still
88
work an so will Windows!!
91
<span style="font-weight: bold;">[step 1]</span>Download the Gen2dmraid
95
href="http://tienstra4.flatnet.tudelft.nl/%7Egerte/gen2dmraid/gen2dmraid-0.99.iso"
96
target="_blank">http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/gen2dmraid-0.99.iso</a>
99
<span style="font-weight: bold;">[step 2]</span>Load the device driver
100
for your SATA controller, IDE users can skip it.
103
<table align="center" border="0" cellpadding="3" cellspacing="1"
107
<td><span class="genmed"><b>Code:</b></span></td>
110
<td class="code">modprobe sata_sil
114
modprobe sata_promise
124
<span class="postbody"><br>
125
<span style="font-weight: bold;">[step 3]</span>Run dmraid and watch
129
<table align="center" border="0" cellpadding="3" cellspacing="1"
133
<td><span class="genmed"><b>Code:</b></span></td>
136
<td class="code">dmraid -ay
138
ls -la /dev/mapper/</td>
142
<span class="postbody"><br>
143
Device nodes should be created for all partitions. You should be
144
able to mount the windows partition and check things are correct.
147
<span style="font-weight: bold;">[step 4]</span>Format and mount
148
partitions (think twice)
151
<table align="center" border="0" cellpadding="3" cellspacing="1"
155
<td><span class="genmed"><b>Code:</b></span></td>
158
<td class="code">mkfs.ext3 /dev/mapper/${your_boot_partition}
160
mkfs.reiser4 /dev/mapper/${your_root_partition}
162
#reiser4 users should know what they are doing, this ain't a reiser4
166
mount /dev/mapper/${your_root_partition} /mnt/gentoo
168
mount /dev/mapper/${your_boot_partition} /mnt/gentoo/boot</td>
172
<span class="postbody"><br>
174
<span style="font-weight: bold;">[step 5]</span> Downloading and
175
extracting stage tarball and chroot
178
<table align="center" border="0" cellpadding="3" cellspacing="1"
182
<td><span class="genmed"><b>Code:</b></span></td>
185
<td class="code">cd /mnt/gentoo
187
wget ${url-stage-tarball}
190
tar -jpxvf ${the_stage3_tarball}
192
rm ${the_stage3_tarball}
195
mount -o bind /dev/ /mnt/gentoo/dev
197
mount -t proc proc /mnt/gentoo/proc
200
chroot . /bin/bash --login
206
<span class="postbody"><br>
208
<span style="font-weight: bold;">[step 6]</span> Syncing portage tree
212
<table align="center" border="0" cellpadding="3" cellspacing="1"
216
<td><span class="genmed"><b>Code:</b></span></td>
219
<td class="code">emerge --sync
227
<span class="postbody"><br>
229
<span style="font-weight: bold;">[step 7]</span> Installing and
230
building a kernel (sata users: dont' forget to compile-in the sata
234
<table align="center" border="0" cellpadding="3" cellspacing="1"
238
<td><span class="genmed"><b>Code:</b></span></td>
241
<td class="code">emerge development-sources -pv
243
emerge development-sources
247
zcat /proc/config.gz >./.config
253
# compile-in dm-mod and The MD core of the RAID flavour you use!!!
255
# reiser4 needs a patched kernel
261
cp arch/i386/boot/bzImage /boot/vmlinuz</td>
265
<span class="postbody"><br>
268
<span style="font-weight: bold;">[step 8]</span> Creating the initrd
270
href="http://tienstra4.flatnet.tudelft.nl/%7Egerte/gen2dmraid/"
271
target="_blank">http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/</a>
274
<table align="center" border="0" cellpadding="3" cellspacing="1"
278
<td><span class="genmed"><b>Code:</b></span></td>
281
<td class="code">cd /root
284
http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/dmraidinitrd-0.93
286
wget http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/linuxrc-0.93
288
chmod +x dmraidinitrd-0.93
290
./dmraidinitrd-0.93 linuxrc-0.93 initrd
292
cp initrd /boot/initrd
298
<span class="postbody"><br>
300
<span style="font-weight: bold;">[step 9]</span> Installing the
301
bootloader like on: <a
302
href="http://tienstra4.flatnet.tudelft.nl/%7Egerte/gen2dmraid/"
303
target="_blank">http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/</a>
306
<table align="center" border="0" cellpadding="3" cellspacing="1"
310
<td><span class="genmed"><b>Code:</b></span></td>
313
<td class="code"># Grub should not detect bios device names
314
itself! Do this or be a fool!:
316
/sbin/grub --device-map=/dev/null
318
grub> device (hd0,0) /dev/mapper/${devicename_of_your_bootpartition}
320
grub> device (hd0) /dev/mapper/${devicename_of_your_raid}
322
grub> root (hd0,0)
324
grub> setup (hd0,0)
330
<span class="postbody"><br>
333
<span style="font-weight: bold;">[step 10]</span> Configuring the
336
Edit /boot/grub/grub.conf
339
<table align="center" border="0" cellpadding="3" cellspacing="1"
343
<td><span class="genmed"><b>Code:</b></span></td>
346
<td class="code">timeout 30
351
title GNU/Linux
355
kernel /vmlinuz root=/dev/ram0
356
real_root=/dev/mapper/${your_root_partition} init=/linuxrc
373
<span class="postbody"><br>
375
<span style="font-weight: bold;">Last words:</span>
377
<span style="font-style: italic;">update: People are talking about
378
Devfs. Don't do that, use UDEV instead!</span>
380
To use udev make sure you have a recent and stable version of udev
381
and baselayout >= sys-apps/baselayout-1.11.7-r2 (~x86 at moment of
386
<table align="center" border="0" cellpadding="3" cellspacing="1"
390
<td><span class="genmed"><b>Code:</b></span></td>
393
<td class="code">emerge udev -pv
397
mkdir -p /etc/portage
399
echo 'app-shells/bash ~x86' >>/etc/portage/package.keywords
401
echo 'sys-apps/sysvinit ~x86'>>/etc/portage/package.keywords
403
echo 'sys-libs/readline ~x86'>>/etc/portage/package.keywords
405
echo 'sys-apps/baselayout ~x86'>>/etc/portage/package.keywords
407
emerge baselayout -pv
409
emerge baselayout</td>
413
<span class="postbody"><br>
414
update: baselayout expects dm users (and thus dmraid users) to have
415
/sbin/dmsetup in order to have UDEV working correctly. To use this
416
feature, we need to emerge the device-mapper package:
419
<table align="center" border="0" cellpadding="3" cellspacing="1"
423
<td><span class="genmed"><b>Code:</b></span></td>
426
<td class="code">emerge device-mapper -pv
434
<span class="postbody"><br>
436
Don't use a device tarball! Your dmraid created devices will disappear
437
and bootup will fail!
440
<table align="center" border="0" cellpadding="3" cellspacing="1"
444
<td><span class="genmed"><b>Code:</b></span></td>
447
<td class="code">#change /etc/conf.d/rc to set
448
RC_DEVICE_TARBALL="no"
450
sed -e "s:RC_DEVICE_TARBALL=\"yes\":RC_DEVICE_TARBALL=\"no\":"
451
</etc/conf.d/rc >/etc/conf.d/rc.new
453
mv /etc/conf.d/rc.new /etc/conf.d/rc
459
<span class="postbody"><br>
461
After this you must edit /etc/fstab, leave the chroot, unmount the
462
partitions, reboot and cross your fingers that it works.
465
Don't forget to make the /boot partition active (Fdisk in Linux or
466
somewhere in "control panel" under MS Windows XP)
469
Your raid can be 0x81 to your bios. In that case grub will fail to
470
load. Repeat steps 9 and 10 and use hd1 instead! You can discover this
471
by testing it with a grub floppy before following the steps described
472
in the howto. Make it your <span style="font-weight: bold;">[step0]</span>
473
OR <span style="font-weight: bold;">[step11]</span> and hope you'll
474
never have to use it.</span>