Gentoo Archives: gentoo-server

From: Chris Smart <taskara@××××××××××××.net>
To: gentoo-server@l.g.o
Subject: Re: [gentoo-server] Re: linux-2.6.8-gentoo-r3 .config for RAID5, help?
Date: Fri, 17 Sep 2004 01:31:11
Message-Id: 200409171130.56732.taskara@internode.on.net
1 OPPS :S
2 accidentally sent before I'd finished.
3
4 see below :)
5
6 > Chris> Out of interest, what mountpoint is /dev/md0? /home?
7 >
8 > It is /mnt/md0.
9 >
10 > Then I do:
11 > ln -s /mnt/md0/usr to /usr
12 > ln -s /mnt/md0/var to /var
13 > ln -s /mnt/md0/home to /home
14 > ln -s /mnt/md0/tmp to /tmp
15 >
16 > This actually caused problems, because some of the links in /usr/bin
17 > were to ../../sbin/xyz, but since /usr/bin/../.. is actually /mnt/md0,
18 > these links didn't resolve right.
19 >
20 > I wish I knew a better way, but I want to have /usr, /var, and /home
21 > all be on the same huge partition. I don't want to bust up my 1.5TB
22 > partition just for a /usr and /var, and I don't have enough space on
23 > my / partition for both of them.
24
25 Hmm.. ok here's the issue:
26
27 /dev/md0 is a device, it needs to go to a mountpoint.
28
29 So, /dev/md0 must be mounted somewhere, like / or /home or /usr etc..
30
31 ahh hangon ic, have you mounted /dev/md0 to /mnt/md0??
32
33 this is a crazy way of doing things.. how did you create your links?
34
35 normally for raid5 you need to create seperate raid devices for seperate
36 mount points.
37
38 so if you want /usr and /home under raid for example, then you need TWO raid
39 devices:
40 /dev/md0 and /dev/md1 (or whatever you want to name them)
41 then you mount /dev/md0 to /usr and /dev/md1 to /home.
42
43 by default all mountpoints go under /
44
45 so if you only have one big / partitions, then /usr /home etc will all go on
46 that partition.
47
48 if you want to seperate them, you need to create seperate partitions, and
49 mount them accordingly.
50
51 what you have done sounds rather odd, but hey - it's linux it's about your
52 choice! ;)
53
54 you could "cp -ap /usr /mnt/md0/" and then symlink /usr to /mnt/md0/usr/, and
55 the same for any other partitions you want, but like I said, this is a big
56 dodgy :)
57
58 > Chris> What did you do to compile your kernel?
59 >
60 > make && modules_install
61
62 you need to do:
63
64 make modules modules_install
65
66 then if you like you can even do make install, which will copy bzImage
67 to /boot/vmlinuz
68
69 > Chris> Did you use genkernel --menuconfig all?
70 >
71 > No, I didn't realize it was necessary. Is that how genkernel figures
72 > out what modules to put in the initrd? If that's the case, I could go
73 > back to using modules.
74
75 you don't have to use genkernel, but yes it will create an init for you if
76 you want it.
77
78 > Chris> Can you post your bootloader config?
79 >
80 > I'm appending my current .config and my /boot/grub/grub.conf
81 >
82 > Chris> Run make menuconfig. Under Device Drivers
83 > Chris> --->ATA/ATAPI/MFM/RLL support ---> there is an option in the
84 > Chris> kernel: [*] Boot off-board chipsets first support
85 > Chris> make that static, and it will boot your via controller first
86 > Chris> (ie make it /dev/hda)
87 >
88 > I don't understand --- doesn't this FORCE my PCI IDE controller to be
89 > first?
90
91 this forces linux to boot your on-board ide controller first (your onboard
92 controller is the one on your mainboard which is the VIA controller.
93
94 The VIA controller will become /dev/hda-d
95 The silicon image and other ide controllers will become /dev/hde and so on.
96
97 > I have one final question:
98 >
99 > Now that I've gone out and bought two more dual-bus IDE controllers,
100 > how do I know which disk was in which order in the RAID5 chain so that
101 > I can get the chain back again after all the drive names change?
102
103 yes, this is the question!
104
105 linux will access your pci ide controllers based on IRQ.
106
107 So you now have 3 controllers? is that right?
108
109 Each controller will have 4 devices links under linux.
110
111 that means you will have:
112
113 PCI controller 1:
114 /dev/hde
115 /dev/hdf
116 /dev/hdg
117 /dev/hdh
118
119 PCI Controller 2:
120 /dev/hdi
121 /dev/hdj
122 /dev/hdk
123 /dev/hdl
124
125 PCI Controller 3:
126 /dev/hdm
127 /dev/hdn
128 /dev/hdo
129 /dev/hdp
130
131 But because you want to use only PRIMARY hard drives on one channel each, then
132 you will only end up using:
133
134 PCI controller 1:
135 /dev/hde
136 /dev/hdg
137
138 PCI Controller 2:
139 /dev/hdi
140 /dev/hdk
141
142 PCI Controller 3:
143 /dev/hdm
144 /dev/hdo
145
146 I would get a pen and MARK your hard drives as they currently sit:
147
148 /dev/hda = 1
149 /dev/hdc = 2
150 /dev/defgh = 3,4,5,6,7
151
152 /dev/hda will stay on the via controller
153
154 /dev/hdc will move to channel 1 on the first ide controller
155 /dev/hdd will be MASTER and go to channel2 on the first ide controller
156 /dev/hde will move to channel 1 on the second ide controller
157 /dev/hdf will be MASTER and go to channel2 on second controller
158 /dev/hdg will move to channel 1 on the third ide controller
159 /dev/hdh will be MASTER and go to channel 2 on the third controller
160
161 IE: this is what it will become:
162 /dev/hdc =/dev/hde
163 /dev/hdd = /dev/hdg
164 /dev/hde = /dev/hdi
165 /dev/hdf = /dev/hdk
166 /dev/hdg = /dev/hdm
167 /dev/hdh = /dev/hdo
168
169
170 NB!!:
171 As I mentioned above, linux will order the controllers based on IRQ.
172
173 So linux might actually see the controller in slot 2 before the controller in
174 slot 1.
175
176 Honestly I am not sure whether it will destroy your raid5 array if the drive
177 order is changed, so you might be better off making sure the order is the
178 same!
179
180 You specified the devices when you created your raidtab. But AFAIK, linux only
181 reads that when it creates the md devices. When linux boots it does not read
182 the raidtab, but looks as the ID on each partition, and therefore knows which
183 partition is a part of which array.
184 What I DON'T know is whether it also numbers them, so it goes "oh yeah this
185 partitions is number ONE on THAT array".
186
187 So unless someone else can verify that, then it might be better to make sure
188 they are in the same order anyway.
189
190 The only way I can think to check which order linux sees them is to add one
191 controller at a time, and work it out yourself.
192
193 Remember the device layout I set above?
194
195 PCI controller 1:
196 /dev/hde
197 /dev/hdf
198 /dev/hdg
199 /dev/hdh
200
201 PCI Controller 2:
202 /dev/hdi
203 /dev/hdj
204 /dev/hdk
205 /dev/hdl
206
207 PCI Controller 3:
208 /dev/hdm
209 /dev/hdn
210 /dev/hdo
211 /dev/hdp
212
213 I would have one master hard drive connected to your current controller
214 (so /dev/hde), then I would put a SLAVE on channel 1 of the first new ide
215 controller.
216 Boot to your kernel - or gentoo livecd, and if the new controller is detected
217 AFTER the first, then that slave drive SHOULD be /dev//hdj.
218 If it is /dev/hdf, then the NEW controller was detected before the old ide
219 controller (and /dev/hde would be /dev/hdi, not hde).
220
221 Make sense?
222
223 Then you need to add the third controller, and I would put TWO MASTER drives
224 on each channel (just so you can tell the differences between the controllers
225 based on what hard drives are connected).
226
227 Boot back to your kernel or livecd.
228
229 If the controllers were all detected in the order you put them in, then you
230 should have:
231 /dev/hde (the first hdd)
232 /dev/hdj (the slave you put in second)
233 /dev/hdm (one of the 2 master drives you put in third)
234 /dev/hdo (the other master drive)
235
236 If you get something like:
237 /dev/hde (the first hdd)
238 /dev/hdi (one of the 2 master drives you put in third)
239 /dev/hdk (the other master drive)
240 /dev/hdn (the slave you put in second)
241
242 then the second and third controllers are being detected the other way around.
243
244 Make sense?
245
246 You'll have to see what devices are which, and then I would number your ide
247 controllers.
248
249 Then put the right hard drives on the right controllers.
250
251 There are other ways than the above, like specifying certain IRQs to each PCI
252 slot, but it's still tricky cause some are bound to use the same IRQ etc etc.
253
254 Also maybe edit your raid tab to reflect the new devices incase linux DOES
255 read that too (but I don't think so cause if /etc/ if raided it can't read
256 raidtab in order to create the array! ;))
257
258 Man I hope you have some cooling in that case of yours!
259
260 Hope this helps, and doesn't destroy your RAID5 data.
261
262 Chris
263
264 > Thanks,
265 > Dave
266
267 -------------------------------------------------------

Replies

Subject Author
[gentoo-server] How to convince "genkernel initrd" to include specific drivers? David Wuertele <dave-gnus@×××××.com>