/docs/MyDocs

To get this branch, use:
bzr branch http://darksoft.org/webbzr/docs/MyDocs

« back to all changes in this revision

Viewing changes to Administration/Linux/system/softraid/Gentoo-SoftRaid.html

  • Committer: Suren A. Chilingaryan
  • Date: 2009-04-09 03:21:08 UTC
  • Revision ID: csa@dside.dyndns.org-20090409032108-w4edamdh4adrgdu3
import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
2
<html>
 
3
<head>
 
4
  <meta content="text/html; charset=ISO-8859-1"
 
5
 http-equiv="content-type">
 
6
  <title>Gentoo - SoftRaid</title>
 
7
</head>
 
8
<body>
 
9
<span class="postbody"><span style="font-weight: bold;">Inportant
 
10
information about BIOS raid and the dmraid tool</span>
 
11
<br>
 
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)
 
18
<br>
 
19
<br>
 
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.
 
23
<br>
 
24
<br>
 
25
The following controllers (metadata formats) are supported*:
 
26
<br>
 
27
Highpoint HPT37X
 
28
<br>
 
29
Highpoint HPT45X
 
30
<br>
 
31
Intel Software RAID
 
32
<br>
 
33
Promise FastTrack
 
34
<br>
 
35
Silicon Image Medley
 
36
<br>
 
37
Nvidia Nforce
 
38
<br>
 
39
<br>
 
40
*<span style="font-style: italic;">Supported doesn't mean it will work
 
41
in all circomstances</span>
 
42
<br>
 
43
<br>
 
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.
 
50
<br>
 
51
<br>
 
52
<span style="font-weight: bold;">Warning to all users</span>
 
53
<br>
 
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
 
58
test it.
 
59
<br>
 
60
<br>
 
61
<span style="font-weight: bold;">Prerequisites</span>
 
62
<br>
 
63
* Partitioning is already done
 
64
<br>
 
65
* You have Windows installed on the second partition o/t raid
 
66
<br>
 
67
* You have a bootpartition which is allways wise when dualbooting
 
68
<br>
 
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"> )
 
73
<br>
 
74
<br>
 
75
Why a bootpartition?:
 
76
<br>
 
77
* People having a bootpartition can leave their MBR to the one
 
78
MSWindows installs (this one searches for the active partition).
 
79
<br>
 
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>
 
84
<br>
 
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!!
 
89
<br>
 
90
<br>
 
91
<span style="font-weight: bold;">[step 1]</span>Download the Gen2dmraid
 
92
LiveCD and boot it
 
93
<br>
 
94
<a
 
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>
 
97
<br>
 
98
<br>
 
99
<span style="font-weight: bold;">[step 2]</span>Load the device driver
 
100
for your SATA controller, IDE users can skip it.
 
101
<br>
 
102
</span>
 
103
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
104
 width="90%">
 
105
  <tbody>
 
106
    <tr>
 
107
      <td><span class="genmed"><b>Code:</b></span></td>
 
108
    </tr>
 
109
    <tr>
 
110
      <td class="code">modprobe sata_sil
 
111
      <br>
 
112
#OR
 
113
      <br>
 
114
modprobe sata_promise
 
115
      <br>
 
116
#OR
 
117
      <br>
 
118
modprobe sata_nv
 
119
      <br>
 
120
      </td>
 
121
    </tr>
 
122
  </tbody>
 
123
</table>
 
124
<span class="postbody"><br>
 
125
<span style="font-weight: bold;">[step 3]</span>Run dmraid and watch
 
126
the results
 
127
<br>
 
128
</span>
 
129
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
130
 width="90%">
 
131
  <tbody>
 
132
    <tr>
 
133
      <td><span class="genmed"><b>Code:</b></span></td>
 
134
    </tr>
 
135
    <tr>
 
136
      <td class="code">dmraid -ay
 
137
      <br>
 
138
ls -la /dev/mapper/</td>
 
139
    </tr>
 
140
  </tbody>
 
141
</table>
 
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.
 
145
<br>
 
146
<br>
 
147
<span style="font-weight: bold;">[step 4]</span>Format and mount
 
148
partitions (think twice)
 
149
<br>
 
150
</span>
 
151
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
152
 width="90%">
 
153
  <tbody>
 
154
    <tr>
 
155
      <td><span class="genmed"><b>Code:</b></span></td>
 
156
    </tr>
 
157
    <tr>
 
158
      <td class="code">mkfs.ext3 /dev/mapper/${your_boot_partition}
 
159
      <br>
 
160
mkfs.reiser4 /dev/mapper/${your_root_partition}
 
161
      <br>
 
162
#reiser4 users should know what they are doing, this ain't a reiser4
 
163
howto
 
164
      <br>
 
165
      <br>
 
166
mount&nbsp; /dev/mapper/${your_root_partition} /mnt/gentoo
 
167
      <br>
 
168
mount&nbsp; /dev/mapper/${your_boot_partition} /mnt/gentoo/boot</td>
 
169
    </tr>
 
170
  </tbody>
 
171
</table>
 
172
<span class="postbody"><br>
 
173
<br>
 
174
<span style="font-weight: bold;">[step 5]</span> Downloading and
 
175
extracting stage tarball and chroot
 
176
<br>
 
177
</span>
 
178
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
179
 width="90%">
 
180
  <tbody>
 
181
    <tr>
 
182
      <td><span class="genmed"><b>Code:</b></span></td>
 
183
    </tr>
 
184
    <tr>
 
185
      <td class="code">cd /mnt/gentoo
 
186
      <br>
 
187
wget ${url-stage-tarball}
 
188
      <br>
 
189
      <br>
 
190
tar -jpxvf ${the_stage3_tarball}
 
191
      <br>
 
192
rm ${the_stage3_tarball}
 
193
      <br>
 
194
      <br>
 
195
mount -o bind&nbsp; /dev/ /mnt/gentoo/dev
 
196
      <br>
 
197
mount -t proc proc /mnt/gentoo/proc
 
198
      <br>
 
199
      <br>
 
200
chroot . /bin/bash --login
 
201
      <br>
 
202
      </td>
 
203
    </tr>
 
204
  </tbody>
 
205
</table>
 
206
<span class="postbody"><br>
 
207
<br>
 
208
<span style="font-weight: bold;">[step 6]</span> Syncing portage tree
 
209
and installing grub
 
210
<br>
 
211
</span>
 
212
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
213
 width="90%">
 
214
  <tbody>
 
215
    <tr>
 
216
      <td><span class="genmed"><b>Code:</b></span></td>
 
217
    </tr>
 
218
    <tr>
 
219
      <td class="code">emerge --sync
 
220
      <br>
 
221
emerge grub -pv
 
222
      <br>
 
223
emerge grub</td>
 
224
    </tr>
 
225
  </tbody>
 
226
</table>
 
227
<span class="postbody"><br>
 
228
<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
 
231
modules)
 
232
<br>
 
233
</span>
 
234
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
235
 width="90%">
 
236
  <tbody>
 
237
    <tr>
 
238
      <td><span class="genmed"><b>Code:</b></span></td>
 
239
    </tr>
 
240
    <tr>
 
241
      <td class="code">emerge development-sources -pv
 
242
      <br>
 
243
emerge development-sources
 
244
      <br>
 
245
cd /usr/src/linux
 
246
      <br>
 
247
zcat /proc/config.gz &gt;./.config
 
248
      <br>
 
249
make oldconfig
 
250
      <br>
 
251
make menuconfig
 
252
      <br>
 
253
# compile-in dm-mod and The MD core of the RAID flavour you use!!!
 
254
      <br>
 
255
# reiser4 needs a patched kernel
 
256
      <br>
 
257
make
 
258
      <br>
 
259
make modules_install
 
260
      <br>
 
261
cp arch/i386/boot/bzImage /boot/vmlinuz</td>
 
262
    </tr>
 
263
  </tbody>
 
264
</table>
 
265
<span class="postbody"><br>
 
266
<br>
 
267
<br>
 
268
<span style="font-weight: bold;">[step 8]</span> Creating the initrd
 
269
like on: <a
 
270
 href="http://tienstra4.flatnet.tudelft.nl/%7Egerte/gen2dmraid/"
 
271
 target="_blank">http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/</a>
 
272
<br>
 
273
</span>
 
274
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
275
 width="90%">
 
276
  <tbody>
 
277
    <tr>
 
278
      <td><span class="genmed"><b>Code:</b></span></td>
 
279
    </tr>
 
280
    <tr>
 
281
      <td class="code">cd /root
 
282
      <br>
 
283
wget
 
284
http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/dmraidinitrd-0.93
 
285
      <br>
 
286
wget http://tienstra4.flatnet.tudelft.nl/~gerte/gen2dmraid/linuxrc-0.93
 
287
      <br>
 
288
chmod +x dmraidinitrd-0.93
 
289
      <br>
 
290
./dmraidinitrd-0.93 linuxrc-0.93 initrd
 
291
      <br>
 
292
cp initrd /boot/initrd
 
293
      <br>
 
294
      </td>
 
295
    </tr>
 
296
  </tbody>
 
297
</table>
 
298
<span class="postbody"><br>
 
299
<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>
 
304
<br>
 
305
</span>
 
306
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
307
 width="90%">
 
308
  <tbody>
 
309
    <tr>
 
310
      <td><span class="genmed"><b>Code:</b></span></td>
 
311
    </tr>
 
312
    <tr>
 
313
      <td class="code"># Grub should not detect bios device names
 
314
itself! Do this or be a fool!:
 
315
      <br>
 
316
/sbin/grub --device-map=/dev/null
 
317
      <br>
 
318
grub&gt; device (hd0,0) /dev/mapper/${devicename_of_your_bootpartition}
 
319
      <br>
 
320
grub&gt; device (hd0) /dev/mapper/${devicename_of_your_raid}
 
321
      <br>
 
322
grub&gt; root (hd0,0)
 
323
      <br>
 
324
grub&gt; setup (hd0,0)
 
325
      <br>
 
326
      </td>
 
327
    </tr>
 
328
  </tbody>
 
329
</table>
 
330
<span class="postbody"><br>
 
331
<br>
 
332
<br>
 
333
<span style="font-weight: bold;">[step 10]</span> Configuring the
 
334
bootloader
 
335
<br>
 
336
Edit /boot/grub/grub.conf
 
337
<br>
 
338
</span>
 
339
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
340
 width="90%">
 
341
  <tbody>
 
342
    <tr>
 
343
      <td><span class="genmed"><b>Code:</b></span></td>
 
344
    </tr>
 
345
    <tr>
 
346
      <td class="code">timeout 30
 
347
      <br>
 
348
default 0
 
349
      <br>
 
350
      <br>
 
351
title&nbsp; GNU/Linux
 
352
      <br>
 
353
root (hd0,0)
 
354
      <br>
 
355
kernel /vmlinuz root=/dev/ram0
 
356
real_root=/dev/mapper/${your_root_partition} init=/linuxrc
 
357
      <br>
 
358
initrd /initrd
 
359
      <br>
 
360
      <br>
 
361
title Windows
 
362
      <br>
 
363
root (hd0,1)
 
364
      <br>
 
365
rootnoverify
 
366
      <br>
 
367
chainloader +1
 
368
      <br>
 
369
      </td>
 
370
    </tr>
 
371
  </tbody>
 
372
</table>
 
373
<span class="postbody"><br>
 
374
<br>
 
375
<span style="font-weight: bold;">Last words:</span>
 
376
<br>
 
377
<span style="font-style: italic;">update: People are talking about
 
378
Devfs. Don't do that, use UDEV instead!</span>
 
379
<br>
 
380
To use udev make sure you have a recent and stable version of udev
 
381
and baselayout &gt;= sys-apps/baselayout-1.11.7-r2 (~x86 at moment of
 
382
writing)
 
383
<br>
 
384
<br>
 
385
</span>
 
386
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
387
 width="90%">
 
388
  <tbody>
 
389
    <tr>
 
390
      <td><span class="genmed"><b>Code:</b></span></td>
 
391
    </tr>
 
392
    <tr>
 
393
      <td class="code">emerge udev -pv
 
394
      <br>
 
395
emerge udev
 
396
      <br>
 
397
mkdir -p /etc/portage
 
398
      <br>
 
399
echo 'app-shells/bash ~x86' &gt;&gt;/etc/portage/package.keywords
 
400
      <br>
 
401
echo 'sys-apps/sysvinit ~x86'&gt;&gt;/etc/portage/package.keywords
 
402
      <br>
 
403
echo 'sys-libs/readline ~x86'&gt;&gt;/etc/portage/package.keywords
 
404
      <br>
 
405
echo 'sys-apps/baselayout ~x86'&gt;&gt;/etc/portage/package.keywords
 
406
      <br>
 
407
emerge baselayout -pv
 
408
      <br>
 
409
emerge baselayout</td>
 
410
    </tr>
 
411
  </tbody>
 
412
</table>
 
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:
 
417
<br>
 
418
</span>
 
419
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
420
 width="90%">
 
421
  <tbody>
 
422
    <tr>
 
423
      <td><span class="genmed"><b>Code:</b></span></td>
 
424
    </tr>
 
425
    <tr>
 
426
      <td class="code">emerge device-mapper -pv
 
427
      <br>
 
428
emerge device-mapper
 
429
      <br>
 
430
      </td>
 
431
    </tr>
 
432
  </tbody>
 
433
</table>
 
434
<span class="postbody"><br>
 
435
<br>
 
436
Don't use a device tarball! Your dmraid created devices will disappear
 
437
and bootup will fail!
 
438
<br>
 
439
</span>
 
440
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
441
 width="90%">
 
442
  <tbody>
 
443
    <tr>
 
444
      <td><span class="genmed"><b>Code:</b></span></td>
 
445
    </tr>
 
446
    <tr>
 
447
      <td class="code">#change /etc/conf.d/rc to set
 
448
RC_DEVICE_TARBALL="no"
 
449
      <br>
 
450
sed -e "s:RC_DEVICE_TARBALL=\"yes\":RC_DEVICE_TARBALL=\"no\":"
 
451
&lt;/etc/conf.d/rc &gt;/etc/conf.d/rc.new
 
452
      <br>
 
453
mv /etc/conf.d/rc.new /etc/conf.d/rc
 
454
      <br>
 
455
      </td>
 
456
    </tr>
 
457
  </tbody>
 
458
</table>
 
459
<span class="postbody"><br>
 
460
<br>
 
461
After this you must edit /etc/fstab, leave the chroot, unmount the
 
462
partitions, reboot and cross your fingers that it works.
 
463
<br>
 
464
<br>
 
465
Don't forget to make the /boot partition active (Fdisk in Linux or
 
466
somewhere in "control panel" under MS Windows XP)
 
467
<br>
 
468
<br>
 
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>
 
475
</body>
 
476
</html>