Gentoo Archives: gentoo-user

From: Volker Armin Hemmann <volkerarmin@××××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] How to get raid
Date: Thu, 05 Jan 2012 03:02:59
Message-Id: 2784979.6pH95vXhbC@localhost
In Reply to: Re: [gentoo-user] How to get raid by Jeff Cranmer
1 Am Mittwoch, 4. Januar 2012, 21:28:32 schrieb Jeff Cranmer:
2 > On Wed, 2012-01-04 at 14:39 +0100, Volker Armin Hemmann wrote:
3 > > Am Dienstag, 3. Januar 2012, 21:57:18 schrieb Jeff Cranmer:
4 > > > Hi all,
5 > > >
6 > > > I have recently built a new system, running Gentoo on a Sabertooth 990FX
7 > > > motherboard. The board has a raid controller on which I'm running a
8 > > > 120GB solid state drive for the OS (Raid 0) and a set of three 1.5TB
9 > > > drives which were previously running as a RAID5 array.
10 > >
11 > > no, it does not have a raid controller. It is bios raid. AKA fake raid.
12 > > You
13 > > will have less trouble if you stop using it.
14 > >
15 > > google for mdadm. There are some very nice howto's.
16 >
17 > Not sure I'd agree with you about the howtos being nice. They mostly
18 > deal with trying to boot from a RAID array (don't want that, as I have
19 > my OS on a non-RAID 120GB SSD). They're also contradictory, with some
20 > saying I need dmraid, and some saying not. Most seem to make no more
21 > than a passing nod towards genkernel.
22
23 the short one:
24
25 partition one disk with (c)fdisk. Use sfdisk to transfer the partition scheme
26 to the other disks.
27
28 run mdadm --create /dev/md0 level=whatever you want --raid-
29 devices=thenumberofdevices /dev/sdXY /dev/sdZY ...
30
31 mdadm --detail --scan >> /etc/mdadm.conf
32
33 done
34
35
36 >
37 > So, given that from the links that I've found, here's my starting set of
38 > questions.
39 >
40 > In /etc/genkernel.conf, which options do I need to enable.
41 > One guide suggested the following settings
42 > DMRAID="no"
43 > MDADM="yes"
44 > MDADM_CONFIG="/etc/mdadm.conf"
45 > MDADM_VER="3.1.4"
46
47 there is a reason why I never ever touch genkernel.
48
49 you should forget that crap. You don't need to copy around anything. If your
50 root is not on some fancy setup, you don't need initramfs.
51
52 Just make a nice kernel, put it in /boot. Done.
53
54 grub.conf:
55 kernel /vmlinuz root=/dev/sda1 nmi_watchdog=0
56
57 and you are fine.
58
59 Have the raids assembled by a) kernel (in that case you have to tell mdadm
60 that on creation time, man mdadm is your friend) or by mdadm init script.
61
62 Don't use fakeraid. Set bios to ahci and be done with this.
63
64 the relevant part of Kernel config for example:
65
66 <*> RAID support
67 │ │
68 │ │ [*] Autodetect RAID arrays during
69 kernel boot │ │
70 │ │ < > Linear (append) mode
71 │ │
72 │ │ < > RAID-0 (striping) mode
73 │ │
74 │ │ <*> RAID-1 (mirroring) mode
75 │ │
76 │ │ < > RAID-10 (mirrored striping) mode
77 │ │
78 │ │ <*> RAID-4/RAID-5/RAID-6 mode
79 │ │
80 │ │ [ ] RAID-4/RAID-5/RAID-6 Multicore
81 processing (EXPERIMENTAL) │ │
82 │ │ < > Multipath I/O support
83 │ │
84 │ │ < > Faulty test module for MD
85 │ │
86 │ │ < > Device mapper support
87 │ │
88 │ │
89 │ │
90 │ │
91
92 as you can see no dm support in my kernel.
93
94 No look what I got...
95
96 cat /proc/mdstat
97 Personalities : [raid1] [raid6] [raid5] [raid4]
98 md5 : active raid1 sdg2[2] sdf2[1]
99 830278202 blocks super 1.2 [2/2] [UU]
100
101 md4 : active raid1 sdf1[1] sdg1[2]
102 146479542 blocks super 1.2 [2/2] [UU]
103
104 md124 : active raid1 sdc1[2] sdd1[1] sdb1[0]
105 64128 blocks [3/3] [UUU]
106
107 md1 : active raid5 sdc3[2] sdd3[1] sdb3[0]
108 78123904 blocks level 5, 64k chunk, algorithm 2 [3/3] [UUU]
109
110 md2 : active raid5 sdc5[2] sdd5[1] sdb5[0]
111 39069824 blocks level 5, 64k chunk, algorithm 2 [3/3] [UUU]
112
113 md127 : active raid5 sdc6[2] sdd6[1] sdb6[0]
114 843813888 blocks level 5, 64k chunk, algorithm 2 [3/3] [UUU]
115
116 the numbers where once nicely 0-4 but some update fucked that up. No big deal
117 - I mount by UUID. Something I strongly recommend.
118
119 --
120 #163933

Replies

Subject Author
Re: [gentoo-user] How to get raid Jeff Cranmer <jeff@××××××××××××××.com>