/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-SoftRaid2.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;">How to do a
 
10
gentoo install on a software RAID</span>
 
11
<br>
 
12
by Chris Atwood
 
13
<br>
 
14
<br>
 
15
<br>
 
16
<span style="font-weight: bold;">1.About the Install</span>
 
17
<br>
 
18
<br>
 
19
Before you start reading this how-to you should read the x86 install
 
20
instructions several times to become familiar with the gentoo install
 
21
process. Also note that as you install following these instructions you
 
22
should have easy access to the normal instructions, you will need to
 
23
refer back to them.
 
24
<br>
 
25
<br>
 
26
This how-to assumes that you are installing on two IDE drives, and
 
27
that both are masters on different IDE channels (thus they are /dev/hda
 
28
and /dev/hdc.) The CD-ROM you install off of could be /dev/hdb or
 
29
/dev/hdd (it doesn't matter).
 
30
<br>
 
31
<br>
 
32
I decided to partition my drives similarily to how the gentoo install
 
33
docs suggest.
 
34
<br>
 
35
<br>
 
36
</span>
 
37
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
38
 width="90%">
 
39
  <tbody>
 
40
    <tr>
 
41
      <td><span class="genmed"><b>Code:</b></span></td>
 
42
    </tr>
 
43
    <tr>
 
44
      <td class="code">device&nbsp; &nbsp; &nbsp; &nbsp;
 
45
&nbsp;mount&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;size
 
46
      <br>
 
47
/dev/hda1&nbsp; &nbsp; &nbsp; /boot&nbsp; &nbsp; &nbsp; &nbsp;
 
48
&nbsp;100MB
 
49
      <br>
 
50
/dev/hda2&nbsp; &nbsp; &nbsp; swap&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 
51
&gt;=2*RAM
 
52
      <br>
 
53
/dev/hda3&nbsp; &nbsp; &nbsp; /&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 
54
&nbsp; &nbsp;(big)
 
55
      <br>
 
56
/dev/hda4&nbsp; &nbsp; &nbsp; /home&nbsp; &nbsp; &nbsp; &nbsp;
 
57
&nbsp;(big) (this partiton is optional)</td>
 
58
    </tr>
 
59
  </tbody>
 
60
</table>
 
61
<span class="postbody"><br>
 
62
<br>
 
63
/boot and / will be a RAID 1 (mirror), /home will be a RAID 0, the
 
64
swap parition will be on both hda and hdc, but will not be a RAID (more
 
65
will be explained later).
 
66
<br>
 
67
<br>
 
68
At this point let me just explain the common RAID levels and their pro
 
69
and cons.
 
70
<br>
 
71
<br>
 
72
<span style="font-weight: bold;">RAID 0:</span> 2 or more hard drives
 
73
are combined into one big volume. The final volume size is the sum of
 
74
all the drives. When data is written to the RAID drive, the data is
 
75
written to all drives in the RAID 0. This means that drive reads and
 
76
writes are very fast, but if 1 drive dies you lose all your data.
 
77
<br>
 
78
<br>
 
79
<span style="font-weight: bold;">RAID 1:</span> 2 hard drives are
 
80
combined into one volume the size as the smallest of the physical
 
81
drives making it. The two hard drives in the RAID are always mirrors of
 
82
each other. Thus, if a drive dies you still have all your data and your
 
83
system operates as normal.
 
84
<br>
 
85
<br>
 
86
<span style="font-weight: bold;">RAID 5:</span> 3 or more hard drives
 
87
are combined into one larger volume. The volume size is (# of drives
 
88
-1) * drive size. You lose one drive of space because part of the space
 
89
on each drive is a backup of the other drives. Thus if one drive dies
 
90
you still have all your data, but if 2 die you lose everything. <br>
 
91
<br>
 
92
Some general RAID notes. Ideally, all drives in a RAID should be the
 
93
same size. Any difference in the drives makes it harder for the
 
94
computer to manage the RAID. Also, and IDE drive in a a RAID should be
 
95
on its own IDE channel. With IDE, a dead drive on a channel can bring
 
96
down the whole channel. In a RAID setup this means that if a drive
 
97
dies, two go down and your machine crashes.
 
98
<br>
 
99
<br>
 
100
<br>
 
101
<span style="font-weight: bold;">2. Booting</span>
 
102
<br>
 
103
<br>
 
104
Follow normal gentoo instructions in this section.
 
105
<br>
 
106
<br>
 
107
<br>
 
108
<span style="font-weight: bold;">3. Load kernel modules</span>
 
109
<br>
 
110
<br>
 
111
<br>
 
112
<br>
 
113
My machine uses a sis900 compatible network chip, so I use that
 
114
driver. You should, of course, use your own network driver name in its
 
115
place.
 
116
<br>
 
117
<br>
 
118
</span>
 
119
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
120
 width="90%">
 
121
  <tbody>
 
122
    <tr>
 
123
      <td><span class="genmed"><b>Code:</b></span></td>
 
124
    </tr>
 
125
    <tr>
 
126
      <td class="code">#modprobe sis900</td>
 
127
    </tr>
 
128
  </tbody>
 
129
</table>
 
130
<span class="postbody"><br>
 
131
<br>
 
132
We also have to load the module that allows for RAID support, so:
 
133
<br>
 
134
<br>
 
135
</span>
 
136
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
137
 width="90%">
 
138
  <tbody>
 
139
    <tr>
 
140
      <td><span class="genmed"><b>Code:</b></span></td>
 
141
    </tr>
 
142
    <tr>
 
143
      <td class="code">#modprobe md</td>
 
144
    </tr>
 
145
  </tbody>
 
146
</table>
 
147
<span class="postbody"><br>
 
148
<br>
 
149
<br>
 
150
<span style="font-weight: bold;">4. Loading PCMCIA kernel modules</span>
 
151
<br>
 
152
<br>
 
153
Follow normal gentoo instructions in this section.
 
154
<br>
 
155
<br>
 
156
<br>
 
157
<span style="font-weight: bold;">5. Configure installation networking</span>
 
158
<br>
 
159
<br>
 
160
Follow normal gentoo instructions in this section.
 
161
<br>
 
162
<br>
 
163
<br>
 
164
<span style="font-weight: bold;">6. Set up partitions</span>
 
165
<br>
 
166
<br>
 
167
You need to use fdisk to setup your partitions. There is nothing
 
168
different here except to make sure you fdisk both disks and that you
 
169
set all partitions (except swap) to partition type fd (linux raid
 
170
auto-detect). If you fail to do either of these steps you RAID will not
 
171
work. Swap should be set to linux swap type.
 
172
<br>
 
173
<br>
 
174
This might be a good time to play with the "hdparm" tool. It allows
 
175
you to change hard drive access parameters, which might speed up disk
 
176
access. There is a pretty good forum thread about hdparm, I suggest
 
177
doing a search for it.
 
178
<br>
 
179
<br>
 
180
Before we put any filesystem on the disks we need to create and
 
181
start the RAID drives. So, we need to create /etc/raidtab. This file
 
182
defines how the virtual RAID drives map to physical partitions. If you
 
183
have hard drives of different size in a RAID 1 (not suggested), the
 
184
smaller of the two should be raid-disk 0 in this file. My raidtab file
 
185
ended up looking like this:
 
186
<br>
 
187
<br>
 
188
</span>
 
189
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
190
 width="90%">
 
191
  <tbody>
 
192
    <tr>
 
193
      <td><span class="genmed"><b>Code:</b></span></td>
 
194
    </tr>
 
195
    <tr>
 
196
      <td class="code"># /boot (RAID 1)
 
197
      <br>
 
198
raiddev&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 
199
&nbsp;/dev/md0
 
200
      <br>
 
201
raid-level&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1
 
202
      <br>
 
203
nr-raid-disks&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2
 
204
      <br>
 
205
chunk-size&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 32
 
206
      <br>
 
207
persistent-superblock&nbsp; &nbsp;1
 
208
      <br>
 
209
device&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 
210
/dev/hda1
 
211
      <br>
 
212
raid-disk&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0
 
213
      <br>
 
214
device&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 
215
/dev/hdc1
 
216
      <br>
 
217
raid-disk&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1
 
218
      <br>
 
219
&nbsp; &nbsp;
 
220
      <br>
 
221
# / (RAID 1)
 
222
      <br>
 
223
raiddev&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 
224
&nbsp;/dev/md2
 
225
      <br>
 
226
raid-level&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1
 
227
      <br>
 
228
nr-raid-disks&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2
 
229
      <br>
 
230
chunk-size&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 32
 
231
      <br>
 
232
persistent-superblock&nbsp; &nbsp;1
 
233
      <br>
 
234
device&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 
235
/dev/hda3
 
236
      <br>
 
237
raid-disk&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0
 
238
      <br>
 
239
device&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 
240
/dev/hdc3
 
241
      <br>
 
242
raid-disk&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1
 
243
      <br>
 
244
&nbsp; &nbsp;
 
245
      <br>
 
246
# /home (RAID 0)
 
247
      <br>
 
248
raiddev&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 
249
&nbsp;/dev/md3
 
250
      <br>
 
251
raid-level&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0
 
252
      <br>
 
253
nr-raid-disks&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2
 
254
      <br>
 
255
chunk-size&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 32
 
256
      <br>
 
257
persistent-superblock&nbsp; &nbsp;1
 
258
      <br>
 
259
device&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 
260
/dev/hda4
 
261
      <br>
 
262
raid-disk&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0
 
263
      <br>
 
264
device&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 
265
/dev/hdc4
 
266
      <br>
 
267
raid-disk&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1</td>
 
268
    </tr>
 
269
  </tbody>
 
270
</table>
 
271
<span class="postbody"><br>
 
272
<br>
 
273
While I didn't have enought hard drives to do this, adding
 
274
hot-spares is often a good idea. This means if a drive in your RAID 1
 
275
goes down, you already have a spare drive in the machine that can be
 
276
used as a replacement. A raidtab with the hot spare option looks like
 
277
this:
 
278
<br>
 
279
<br>
 
280
</span>
 
281
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
282
 width="90%">
 
283
  <tbody>
 
284
    <tr>
 
285
      <td><span class="genmed"><b>Code:</b></span></td>
 
286
    </tr>
 
287
    <tr>
 
288
      <td class="code"># / (RAID 1 with hot-spare)
 
289
      <br>
 
290
raiddev&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 
291
&nbsp;/dev/md2
 
292
      <br>
 
293
raid-level&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1
 
294
      <br>
 
295
nr-raid-disks&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2
 
296
      <br>
 
297
nr-spare-disks 1
 
298
      <br>
 
299
chunk-size&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 32
 
300
      <br>
 
301
persistent-superblock&nbsp; &nbsp;1
 
302
      <br>
 
303
device&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 
304
/dev/hda3
 
305
      <br>
 
306
raid-disk&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0
 
307
      <br>
 
308
device&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 
309
/dev/hdc3
 
310
      <br>
 
311
raid-disk&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1
 
312
      <br>
 
313
device /dev/hdd1
 
314
      <br>
 
315
spare-disk 0</td>
 
316
    </tr>
 
317
  </tbody>
 
318
</table>
 
319
<span class="postbody"><br>
 
320
<br>
 
321
And a RAID 5 (with hot-spare) raidtab looks like this:
 
322
<br>
 
323
<br>
 
324
</span>
 
325
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
326
 width="90%">
 
327
  <tbody>
 
328
    <tr>
 
329
      <td><span class="genmed"><b>Code:</b></span></td>
 
330
    </tr>
 
331
    <tr>
 
332
      <td class="code">raiddev /dev/md4
 
333
      <br>
 
334
raid-level 5
 
335
      <br>
 
336
      <br>
 
337
nr-raid-disks 3
 
338
      <br>
 
339
nr-spare-disks 1
 
340
      <br>
 
341
persistent-superblock 1
 
342
      <br>
 
343
chunk-size 32
 
344
      <br>
 
345
parity-algorithm right-symmetric
 
346
      <br>
 
347
device /dev/hda4
 
348
      <br>
 
349
raid-disk 0
 
350
      <br>
 
351
device /dev/hdb4
 
352
      <br>
 
353
raid-disk 1
 
354
      <br>
 
355
device /dev/hdc4
 
356
      <br>
 
357
raid-disk 2
 
358
      <br>
 
359
device /dev/hdd4
 
360
      <br>
 
361
spare-disk 0</td>
 
362
    </tr>
 
363
  </tbody>
 
364
</table>
 
365
<span class="postbody"><br>
 
366
<br>
 
367
<br>
 
368
Now we need to create the RAID drives so:
 
369
<br>
 
370
<br>
 
371
</span>
 
372
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
373
 width="90%">
 
374
  <tbody>
 
375
    <tr>
 
376
      <td><span class="genmed"><b>Code:</b></span></td>
 
377
    </tr>
 
378
    <tr>
 
379
      <td class="code">#mkraid /dev/md*</td>
 
380
    </tr>
 
381
  </tbody>
 
382
</table>
 
383
<span class="postbody"><br>
 
384
<br>
 
385
<br>
 
386
for all raid drives, where * is replaced by the device specified in the
 
387
raidtab file.
 
388
<br>
 
389
<br>
 
390
I decided to put an ext2 filesystem on the /boot RAID drive:
 
391
<br>
 
392
<br>
 
393
</span>
 
394
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
395
 width="90%">
 
396
  <tbody>
 
397
    <tr>
 
398
      <td><span class="genmed"><b>Code:</b></span></td>
 
399
    </tr>
 
400
    <tr>
 
401
      <td class="code">#mke2fs /dev/md0</td>
 
402
    </tr>
 
403
  </tbody>
 
404
</table>
 
405
<span class="postbody"><br>
 
406
<br>
 
407
<br>
 
408
Remember how I mentioned that I was going to setup the swap space
 
409
so that it would exist on more than one drive, but would not be in a
 
410
RAID? So when we make the swap space we make two of them. Make the
 
411
swap:
 
412
<br>
 
413
<br>
 
414
</span>
 
415
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
416
 width="90%">
 
417
  <tbody>
 
418
    <tr>
 
419
      <td><span class="genmed"><b>Code:</b></span></td>
 
420
    </tr>
 
421
    <tr>
 
422
      <td class="code">#mkswap /dev/hda2
 
423
      <br>
 
424
#mkswap /dev/hdc2</td>
 
425
    </tr>
 
426
  </tbody>
 
427
</table>
 
428
<span class="postbody"><br>
 
429
<br>
 
430
<br>
 
431
And, since I want xfs on the / and /home RAIDs
 
432
<br>
 
433
<br>
 
434
</span>
 
435
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
436
 width="90%">
 
437
  <tbody>
 
438
    <tr>
 
439
      <td><span class="genmed"><b>Code:</b></span></td>
 
440
    </tr>
 
441
    <tr>
 
442
      <td class="code">#mkfs.xfs -d agcount=3 -l size=32m /dev/md2
 
443
      <br>
 
444
#mkfs.xfs -d agcount=3 -l size=32m /dev/md3</td>
 
445
    </tr>
 
446
  </tbody>
 
447
</table>
 
448
<span class="postbody"><br>
 
449
<br>
 
450
<br>
 
451
The parameters added to the mkfs.xfs command come from the
 
452
suggestions made in orginal x86 install guide. Both my / and /home
 
453
partitions are about 9 GB, and XFS likes at least one allocation group
 
454
per 4 GB. Thus I used an agcount of 3.
 
455
<br>
 
456
<br>
 
457
If you want an ext3 filesystems use:
 
458
<br>
 
459
<br>
 
460
</span>
 
461
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
462
 width="90%">
 
463
  <tbody>
 
464
    <tr>
 
465
      <td><span class="genmed"><b>Code:</b></span></td>
 
466
    </tr>
 
467
    <tr>
 
468
      <td class="code"># mke2fs -j /dev/md2
 
469
      <br>
 
470
# mke2fs -j /dev/md3</td>
 
471
    </tr>
 
472
  </tbody>
 
473
</table>
 
474
<span class="postbody"><br>
 
475
<br>
 
476
Or to create ReiserFS filesystems, use:
 
477
<br>
 
478
<br>
 
479
</span>
 
480
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
481
 width="90%">
 
482
  <tbody>
 
483
    <tr>
 
484
      <td><span class="genmed"><b>Code:</b></span></td>
 
485
    </tr>
 
486
    <tr>
 
487
      <td class="code"># mkreiserfs /dev/md2
 
488
      <br>
 
489
# mkreiserfs /dev/md3</td>
 
490
    </tr>
 
491
  </tbody>
 
492
</table>
 
493
<span class="postbody"><br>
 
494
<br>
 
495
<br>
 
496
<span style="font-weight: bold;">7. Mount partitions</span>
 
497
<br>
 
498
<br>
 
499
Turn the swap on:
 
500
<br>
 
501
<br>
 
502
</span>
 
503
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
504
 width="90%">
 
505
  <tbody>
 
506
    <tr>
 
507
      <td><span class="genmed"><b>Code:</b></span></td>
 
508
    </tr>
 
509
    <tr>
 
510
      <td class="code">#swapon /dev/hda2
 
511
      <br>
 
512
#swapon /dev/hdc2</td>
 
513
    </tr>
 
514
  </tbody>
 
515
</table>
 
516
<span class="postbody"><br>
 
517
<br>
 
518
<br>
 
519
Mount the / and /boot RAIDs:
 
520
<br>
 
521
<br>
 
522
</span>
 
523
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
524
 width="90%">
 
525
  <tbody>
 
526
    <tr>
 
527
      <td><span class="genmed"><b>Code:</b></span></td>
 
528
    </tr>
 
529
    <tr>
 
530
      <td class="code"># mkdir /mnt/gentoo
 
531
      <br>
 
532
# mount /dev/md2 /mnt/gentoo
 
533
      <br>
 
534
# mkdir /mnt/gentoo/boot
 
535
      <br>
 
536
# mount /dev/md0 /mnt/gentoo/boot</td>
 
537
    </tr>
 
538
  </tbody>
 
539
</table>
 
540
<span class="postbody"><br>
 
541
<br>
 
542
<br>
 
543
<br>
 
544
<span style="font-weight: bold;">8. Mounting the CD-ROM</span>
 
545
<br>
 
546
<br>
 
547
Follow normal gentoo instructions in this section.
 
548
<br>
 
549
<br>
 
550
<br>
 
551
<span style="font-weight: bold;">9. Unpack the stage you want to use</span>
 
552
<br>
 
553
<br>
 
554
Follow normal gentoo instructions in this section, except for one
 
555
addition. You need to copy your raidtab file over to your new gentoo
 
556
root. So after you copy resolv.conf do this:
 
557
<br>
 
558
<br>
 
559
</span>
 
560
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
561
 width="90%">
 
562
  <tbody>
 
563
    <tr>
 
564
      <td><span class="genmed"><b>Code:</b></span></td>
 
565
    </tr>
 
566
    <tr>
 
567
      <td class="code"># cp /etc/raidtab /mnt/gentoo/etc/raidtab</td>
 
568
    </tr>
 
569
  </tbody>
 
570
</table>
 
571
<span class="postbody"><br>
 
572
<br>
 
573
<br>
 
574
<span style="font-weight: bold;">10. Rsync</span>
 
575
<br>
 
576
<br>
 
577
Follow normal gentoo instructions in this section.
 
578
<br>
 
579
<br>
 
580
<br>
 
581
<span style="font-weight: bold;">11. Progressing from stage1 to stage2</span>
 
582
<br>
 
583
<br>
 
584
Follow normal gentoo instructions in this section.
 
585
<br>
 
586
<br>
 
587
<br>
 
588
<span style="font-weight: bold;">12. Progressing from stage2 to stage3</span>
 
589
<br>
 
590
<br>
 
591
Follow normal gentoo instructions in this section.
 
592
<br>
 
593
<br>
 
594
<br>
 
595
<span style="font-weight: bold;">13. Final steps: timezone</span>
 
596
<br>
 
597
<br>
 
598
Follow normal gentoo instructions in this section.
 
599
<br>
 
600
<br>
 
601
<br>
 
602
<span style="font-weight: bold;">14. Final steps: kernel and system
 
603
logger</span>
 
604
<br>
 
605
<br>
 
606
When in menuconfig be sure to compile in support for RAID devices
 
607
and all RAID levels you plan to use. And, be sure to compile them into
 
608
the kernel, don't compile them as modules. If you compile them as
 
609
modules you have to load the modules before mounting the RAID devices,
 
610
but if your / and /boot are the RAID you are in a catch-22. There are
 
611
work-arounds, but it is much easier to just compile all RAID support
 
612
into the kernel.
 
613
<br>
 
614
<br>
 
615
Also, since I put xfs filesystems on my machine I emerged the
 
616
xfs-sources. Other than that, follow the instructions normally.
 
617
<br>
 
618
<br>
 
619
<br>
 
620
<span style="font-weight: bold;">15. Final steps: install additional
 
621
packages</span>
 
622
<br>
 
623
<br>
 
624
<br>
 
625
Since I put xfs filesystems on my machine I emerged xfsprogs. Other
 
626
than that, follow the instructions normally.
 
627
<br>
 
628
<br>
 
629
<br>
 
630
<span style="font-weight: bold;">16. Final steps: /etc/fstab</span>
 
631
<br>
 
632
<br>
 
633
Here again we need to let the computer know about our two swap
 
634
partitions. You specify two or more paritions has swap here, and if you
 
635
specify them with the same priority all of them will be use at the same
 
636
time.
 
637
<br>
 
638
<br>
 
639
Also, be sure to specify the RAID drives and not the physical hard
 
640
drives in the the fstab file for any drive that is a RAID. My fstab
 
641
looks like this:
 
642
<br>
 
643
<br>
 
644
</span>
 
645
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
646
 width="90%">
 
647
  <tbody>
 
648
    <tr>
 
649
      <td><span class="genmed"><b>Code:</b></span></td>
 
650
    </tr>
 
651
    <tr>
 
652
      <td class="code">/dev/md0&nbsp; &nbsp; &nbsp; /boot&nbsp; &nbsp;
 
653
&nbsp;ext2&nbsp; &nbsp; &nbsp; noauto,noatime&nbsp; &nbsp; &nbsp;1 2
 
654
      <br>
 
655
/dev/md2&nbsp; &nbsp; &nbsp; /&nbsp; &nbsp; &nbsp; &nbsp;
 
656
&nbsp;xfs&nbsp; &nbsp; &nbsp; &nbsp;noatime&nbsp; &nbsp; &nbsp; &nbsp;
 
657
&nbsp; &nbsp; 0 1
 
658
      <br>
 
659
/dev/hda2&nbsp; &nbsp; &nbsp;swap&nbsp; &nbsp; &nbsp; swap&nbsp; &nbsp;
 
660
&nbsp; defaults,pri=1&nbsp; &nbsp; &nbsp;0 0
 
661
      <br>
 
662
/dev/hdc2&nbsp; &nbsp; &nbsp;swap&nbsp; &nbsp; &nbsp; swap&nbsp; &nbsp;
 
663
&nbsp; defaults,pri=1&nbsp; &nbsp; &nbsp;0 0
 
664
      <br>
 
665
/dev/md3&nbsp; &nbsp; &nbsp; /home&nbsp; &nbsp; &nbsp;xfs&nbsp; &nbsp;
 
666
&nbsp; &nbsp;noatime&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 1
 
667
      <br>
 
668
/dev/cdroms/cdrom0&nbsp; &nbsp;/mnt/cdrom&nbsp; &nbsp;iso9660&nbsp;
 
669
&nbsp; &nbsp; noauto,ro&nbsp; &nbsp; &nbsp; 0 0
 
670
      <br>
 
671
proc&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/proc&nbsp; &nbsp; &nbsp;
 
672
proc&nbsp; &nbsp; &nbsp; defaults&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 
673
&nbsp;0 0</td>
 
674
    </tr>
 
675
  </tbody>
 
676
</table>
 
677
<span class="postbody"><br>
 
678
<br>
 
679
<br>
 
680
After that, follow instructions normally untill you get to grub.
 
681
<br>
 
682
<br>
 
683
Once you type
 
684
<br>
 
685
<br>
 
686
</span>
 
687
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
688
 width="90%">
 
689
  <tbody>
 
690
    <tr>
 
691
      <td><span class="genmed"><b>Code:</b></span></td>
 
692
    </tr>
 
693
    <tr>
 
694
      <td class="code">#grub</td>
 
695
    </tr>
 
696
  </tbody>
 
697
</table>
 
698
<span class="postbody"><br>
 
699
<br>
 
700
<br>
 
701
The commands are the same as the standard install if you follow my
 
702
partion setup. If you have deviated, type
 
703
<br>
 
704
<br>
 
705
</span>
 
706
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
707
 width="90%">
 
708
  <tbody>
 
709
    <tr>
 
710
      <td><span class="genmed"><b>Code:</b></span></td>
 
711
    </tr>
 
712
    <tr>
 
713
      <td class="code">grub&gt; find /boot/grub/stage1</td>
 
714
    </tr>
 
715
  </tbody>
 
716
</table>
 
717
<span class="postbody"><br>
 
718
<br>
 
719
<br>
 
720
to get the hard-drive to specify in place of (hd0,0). Since the
 
721
/boot partition is a RAID, grub cannot read it to get the bootloader.
 
722
It can only access physical drives. Thus, you still use (hd0,0) in this
 
723
step.
 
724
<br>
 
725
<br>
 
726
The menu.lst does change from the normal install. The difference is
 
727
in the specified root drive, it is now a RAID drive and no longer a
 
728
physical drive. Mine looks like this:
 
729
<br>
 
730
<br>
 
731
</span>
 
732
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
733
 width="90%">
 
734
  <tbody>
 
735
    <tr>
 
736
      <td><span class="genmed"><b>Code:</b></span></td>
 
737
    </tr>
 
738
    <tr>
 
739
      <td class="code">default 0
 
740
      <br>
 
741
timeout 30
 
742
      <br>
 
743
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
 
744
      <br>
 
745
      <br>
 
746
title=My example Gentoo Linux
 
747
      <br>
 
748
root (hd0,0)
 
749
      <br>
 
750
kernel /boot/bzImage root=/dev/md2</td>
 
751
    </tr>
 
752
  </tbody>
 
753
</table>
 
754
<span class="postbody"><br>
 
755
<br>
 
756
<br>
 
757
<br>
 
758
<span style="font-weight: bold;">17. Installation complete!</span>
 
759
<br>
 
760
<br>
 
761
Follow normal gentoo instructions in this section.
 
762
<br>
 
763
<br>
 
764
<br>
 
765
<span style="font-weight: bold;">18. Misc RAID stuff</span>
 
766
<br>
 
767
<br>
 
768
To see if you RAID is functioning properly after reboot do:
 
769
<br>
 
770
<br>
 
771
</span>
 
772
<table align="center" border="0" cellpadding="3" cellspacing="1"
 
773
 width="90%">
 
774
  <tbody>
 
775
    <tr>
 
776
      <td><span class="genmed"><b>Code:</b></span></td>
 
777
    </tr>
 
778
    <tr>
 
779
      <td class="code">#cat /proc/mdstat</td>
 
780
    </tr>
 
781
  </tbody>
 
782
</table>
 
783
<span class="postbody"><br>
 
784
<br>
 
785
<br>
 
786
There should be one entry per RAID drive. The RAID 1 drives should
 
787
have a "[UU]" in the entry, letting you know that the two hard drives
 
788
are "up, up". If one goes down you will see "[U_]". If this ever
 
789
happens your system will still run fine, but you should replace that
 
790
hard drive as soon as possible.
 
791
<br>
 
792
<br>
 
793
To rebuild a RAID 1:
 
794
<br>
 
795
<ol type="1">
 
796
  <br>
 
797
  <br>
 
798
  <br>
 
799
  <li>Power down the system
 
800
    <br>
 
801
  </li>
 
802
  <li>Replace the failed disk
 
803
    <br>
 
804
  </li>
 
805
  <li>Power up the system once again
 
806
    <br>
 
807
  </li>
 
808
  <li>Use
 
809
    <br>
 
810
    <table align="center" border="0" cellpadding="3" cellspacing="1"
 
811
 width="90%">
 
812
      <tbody>
 
813
        <tr>
 
814
          <td><span class="genmed"><b>Code:</b></span></td>
 
815
        </tr>
 
816
        <tr>
 
817
          <td class="code">raidhotadd /dev/mdX /dev/hdX</td>
 
818
        </tr>
 
819
      </tbody>
 
820
    </table>
 
821
    <span class="postbody"><br>
 
822
to re-insert the disk in the array
 
823
    <br>
 
824
    </span></li>
 
825
  <li>Watch the automatic reconstruction run
 
826
  </li>
 
827
</ol>
 
828
</span>
 
829
</body>
 
830
</html>