RE: Howto: implement AMD SB9xx RAID5 support in dmraid
Mark-Willem Jansen <[email protected]> Fri, 13 Apr 2012 01:23:43 +0200
| Newsgroups | gmane.linux.ataraid |
|---|---|
| Message-ID | <[email protected]> |
--_9351b25f-294c-42bd-af1a-5fc1712ec8fb_ Content-Type: multipart/alternative; boundary="_7bf5150a-8682-4f07-83f0-3808913fbe9c_" --_7bf5150a-8682-4f07-83f0-3808913fbe9c_ Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: quoted-printable Hi=2C Been playing with the patches you gave me. And I finally got the raid up an= d running=2C using the shipped dm-raid.ko module in the 3.2 kernel. Lets go through the steps. I have applied the dmraid_pdc_raid5.patch=2C this caused dmraid to produce = a new error related to the missing dm-raid45 module. Before activating a ne= w raid set dmraid checks if a dm-target has been registered with device-ma= pper. This can be changed through a struct in metadata.c. Doing this accord= ingly only left me with the error of raid array not activated. Going throug= h the dmesg I found that dmraid was giving a wrong raid type to the dm-raid= module. Digging deeper I wound that the arguments given to dm-raid45 and d= m-raid have a different structure. So I have changed the arguments structur= e send to the module accordingly. $ dmraid -ay -t pdc_ciihdaafgf: 0 1953124864 raid raid5_la 2 128 nosync 3 - /dev/sdb - /dev= /sdc - /dev/sdd this used to be something like (I forgot some numbers) $ dmraid -ay -t pdc_ciihdaafgf: 0 1953124864 raid core 2 132016 nosync raid5_la 1 128 3 -1 = /dev/sdb 0 /dev/sdc 0 /dev/sdd 0 The patch has been attached. (see that I have made some typo's in naming th= e patch.) Now I can activate the raid and by using kpartx I can also mount the partit= ions on the raid. Whoot. Unfortunately the fix was a bit dirty=2C could be that I have broken dmraid= for the other raid types. Also I am not sure if you need to send the regio= n_size to the dm-raid module. Regards=2C Mark-Willem Date: Tue=2C 3 Apr 2012 11:13:20 +0400 From: [email protected] To: [email protected] CC: [email protected] Subject: Re: Howto: implement AMD SB9xx RAID5 support in dmraid =20 =20 =20 =20 Hello=2C =20 I do have dm-raid45 patch for 3.2.=20 I do not remember where it was taken from=2C but it compiles with 3.2 :-) =20 =20 On 04/03/2012 11:13 AM=2C Mark-Willem Jansen wrote: =20 =20 =20 Hello=2C =20 Later this day I will apply the patch. But patching the kernel will be more cumbersome. The=20 present kernel running om my system is 3.2.0 and the patches found on the web are for=20 older kernels. But maybe the module dm-raid.ko included in the kernel can be helpful. =20 Regards=2C =20 Mark-Willem =20 > Date: Mon=2C 2 Apr 2012 17:42:12 +0400 > From: [email protected] > To: [email protected] > CC: [email protected] > Subject: Re: Howto: implement AMD SB9xx RAID5 support in dmraid >=20 > hello=2C >=20 > You may try the attached patch to support RAID5 in pdc dmraid format. It=20 > works OK for me. > Be sure to patch the kernel itself to support dm-raid45 target. >=20 >=20 > On 04/02/2012 02:59 AM=2C Phillip Susi wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > On 04/01/2012 04:21 PM=2C Mark-Willem Jansen wrote: > >> ERROR: pdc: zero sectors on /dev/sdd > >> ERROR: pdc: setting up RAID device /dev/sdd > > It looks like sectors() in pdc.c is missing the case for computing the size of a RAID5. For that matter=2C there appears to be no #define for PDC_T_RAID5=2C so you will need to add one and add it to the mapping table in type() and fix sectors() to handle it and probably a few other things. > > > > > > -----BEGIN PGP SIGNATURE----- > > Version: GnuPG v1.4.11 (GNU/Linux) > > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > > > iQEcBAEBAgAGBQJPeN2yAAoJEJrBOlT6nu75NFQIANRt6f4STTvdEV+lYbsT8OL3 > > l22ZRVt9ReIAu7CJzRjx0yfaYAUo6Zy8fwzOjt9eF4fPYVQvnn53SYQu/qtyv2DZ > > rDyv7owpxwcqQsZIYvBzQvWjEVT2s6VJrVtOVnZ2G1awa1SwIoc9LPnmouOeKhQG > > auYL+O1UqfQEroJDsnOkZ8srrgc/m2zN3AxID4ps0FymQyNgy2s+HhBlsI4LeUNK > > GimqJMwfbvaMlk0u8botcm2aMwogq+ap1GhJYddnRMluS6U4UJnS7NYrZYtww/1m > > 3WJWkX9hsYxo+QBA0qassg3zc/efzkC8pBBvDo7FLNGcXs2txi7dXmNXLferwFo= =3D > > =3Do0zP > > -----END PGP SIGNATURE----- > > > > _______________________________________________ > > Ataraid-list mailing list > > [email protected] > > https://www.redhat.com/mailman/listinfo/ataraid-list >=20 >=20 > --=20 > =D1 =F3=E2=E0=E6=E5=ED=E8=E5=EC=2C > Astarta > =C0=E4=EC=E8=ED=E8=F1=F2=F0=E0=F2=EE=F0 =D4=EE=F0=F3=EC=E0 "=CA= =F0=FB=F1=E8=ED=FB=E9 =C1=F3=EC" > http://rat.ru/forum/index.php >=20 > =93The Linux philosophy is 'Laugh in the face of danger'. > Oops. Wrong One. 'Do it yourself'. Yes=2C that's it.=94 > (c) Linus Torvalds. >=20 =20 =20 =20 =20 =20 --=20 =D1 =F3=E2=E0=E6=E5=ED=E8=E5=EC=2C Astarta =C0=E4=EC=E8=ED=E8=F1=F2=F0=E0=F2=EE=F0 =D4=EE=F0=F3=EC=E0 "=CA=F0=FB=F1=E8= =ED=FB=E9 =C1=F3=EC" http://rat.ru/forum/index.php =93The Linux philosophy is 'Laugh in the face of danger'. Oops. Wrong One. 'Do it yourself'. Yes=2C that's it.=94 (c) Linus Torvalds. = --_7bf5150a-8682-4f07-83f0-3808913fbe9c_ Content-Type: text/html; charset="windows-1251" Content-Transfer-Encoding: quoted-printable <html> <head> <style><!-- .hmmessage P { margin:0px=3B padding:0px } body.hmmessage { font-size: 10pt=3B font-family:Tahoma } --></style></head> <body class=3D'hmmessage'><div dir=3D'ltr'> Hi=2C<br><br>Been playing with the patches you gave me. And I finally got t= he raid up and running=2C using the shipped dm-raid.ko module in the 3.2 ke= rnel.<br><br>Lets go through the steps.<br><br>I have applied the dmraid_pd= c_raid5.patch=2C this caused dmraid to produce a new error related to the m= issing dm-raid45 module. Before activating a new raid set =3B dmraid ch= ecks if a dm-target has been registered with device-mapper. This can be cha= nged through a struct in metadata.c. Doing this accordingly only left me wi= th the error of raid array not activated. Going through the dmesg I found t= hat dmraid was giving a wrong raid type to the dm-raid module. Digging deep= er I wound that the arguments given to dm-raid45 and dm-raid have a differe= nt structure. So I have changed the arguments structure send to the module = accordingly.<br><br>$ dmraid -ay -t<br>pdc_ciihdaafgf: 0 1953124864 raid ra= id5_la 2 128 nosync 3 - /dev/sdb - /dev/sdc - /dev/sdd<br><br>this used to = be something like (I forgot some numbers)<br>$ dmraid -ay -t<br> pdc_ciihdaafgf: 0 1953124864 raid core 2 132016 nosync raid5_la 1 128 3 -1 = /dev/sdb 0 /dev/sdc 0 /dev/sdd 0<br><br>The patch has been attached. (see t= hat I have made some typo's in naming the patch.)<br> <br>Now I can activate the raid and by using kpartx I can also mount the pa= rtitions on the raid. Whoot.<br><br>Unfortunately the fix was a bit dirty= =2C could be that I have broken dmraid for the other raid types. Also I am = not sure if you need to send the region_size to the dm-raid module.<br><br>= Regards=2C<br><br>Mark-Willem<br><br><div><div id=3D"SkyDrivePlaceholder"><= /div><hr id=3D"stopSpelling">Date: Tue=2C 3 Apr 2012 11:13:20 +0400<br>From= : [email protected]<br>To: [email protected]<br>CC: [email protected]= om<br>Subject: Re: Howto: implement AMD SB9xx RAID5 support in dmraid<br><b= r> =20 <meta http-equiv=3D"Content-Type" content=3D"text/html=3B charset=3Dunicode= "> <meta name=3D"Generator" content=3D"Microsoft SafeHTML"> =20 =20 =20 Hello=2C<br> <br> I do have dm-raid45 patch for 3.2. <br> I do not remember where it was taken from=2C but it compiles with 3.2 :-)<br> <br> <br> On 04/03/2012 11:13 AM=2C Mark-Willem Jansen wrote: <blockquote cite=3D"mid:[email protected]"> <style> .ExternalClass .ecxhmmessage P {padding:0px=3B} .ExternalClass body.ecxhmmessage {font-size:10pt=3Bfont-family:Tahoma=3B} </style> <div dir=3D"ltr"> Hello=2C<br> <br> Later this day I will apply the patch. But patching the kernel will be more cumbersome. The <br> present kernel running om my system is 3.2.0 and the patches found on the web are for <br> older kernels. But maybe the module dm-raid.ko included in the kernel can be helpful.<br> <br> Regards=2C<br> <br> Mark-Willem<br> <br> <div>>=3B Date: Mon=2C 2 Apr 2012 17:42:12 +0400<br> >=3B From: <a class=3D"ecxmoz-txt-link-abbreviated" href=3D"mai= lto:[email protected]">[email protected]</a><br> >=3B To: <a class=3D"ecxmoz-txt-link-abbreviated" href=3D"mailt= o:[email protected]">[email protected]</a><br> >=3B CC: <a class=3D"ecxmoz-txt-link-abbreviated" href=3D"mailt= o:[email protected]">[email protected]</a><br> >=3B Subject: Re: Howto: implement AMD SB9xx RAID5 support in dmraid<br> >=3B <br> >=3B hello=2C<br> >=3B <br> >=3B You may try the attached patch to support RAID5 in pdc dmraid format. It <br> >=3B works OK for me.<br> >=3B Be sure to patch the kernel itself to support dm-raid45 target.<br> >=3B <br> >=3B <br> >=3B On 04/02/2012 02:59 AM=2C Phillip Susi wrote:<br> >=3B >=3B -----BEGIN PGP SIGNED MESSAGE-----<br> >=3B >=3B Hash: SHA1<br> >=3B >=3B<br> >=3B >=3B On 04/01/2012 04:21 PM=2C Mark-Willem Jansen wrote:= <br> >=3B >=3B>=3B ERROR: pdc: zero sectors on /dev/sdd<br> >=3B >=3B>=3B ERROR: pdc: setting up RAID device /dev/sdd<b= r> >=3B >=3B It looks like sectors() in pdc.c is missing the cas= e for computing the size of a RAID5. For that matter=2C there appears to be no #define for PDC_T_RAID5=2C so you will need to add one and add it to the mapping table in type() and fix sectors() to handle it and probably a few other things.<br> >=3B >=3B<br> >=3B >=3B<br> >=3B >=3B -----BEGIN PGP SIGNATURE-----<br> >=3B >=3B Version: GnuPG v1.4.11 (GNU/Linux)<br> >=3B >=3B Comment: Using GnuPG with Mozilla - <a class=3D"ecxmoz-txt-link-freetext" href=3D"http://enigmail.moz= dev.org/" target=3D"_blank">http://enigmail.mozdev.org/</a><br> >=3B >=3B<br> >=3B >=3B iQEcBAEBAgAGBQJPeN2yAAoJEJrBOlT6nu75NFQIANRt6f4STTvdEV+lYbsT8OL3<= br> >=3B >=3B l22ZRVt9ReIAu7CJzRjx0yfaYAUo6Zy8fwzOjt9eF4fPYVQvnn53SYQu/qtyv2DZ<= br> >=3B >=3B rDyv7owpxwcqQsZIYvBzQvWjEVT2s6VJrVtOVnZ2G1awa1SwIoc9LPnmouOeKhQG<= br> >=3B >=3B auYL+O1UqfQEroJDsnOkZ8srrgc/m2zN3AxID4ps0FymQyNgy2s+HhBlsI4LeUNK<= br> >=3B >=3B GimqJMwfbvaMlk0u8botcm2aMwogq+ap1GhJYddnRMluS6U4UJnS7NYrZYtww/1m<= br> >=3B >=3B 3WJWkX9hsYxo+QBA0qassg3zc/efzkC8pBBvDo7FLNGcXs2txi7dXmNXLferwFo= =3D<br> >=3B >=3B =3Do0zP<br> >=3B >=3B -----END PGP SIGNATURE-----<br> >=3B >=3B<br> >=3B >=3B _______________________________________________<br> >=3B >=3B Ataraid-list mailing list<br> >=3B >=3B <a class=3D"ecxmoz-txt-link-abbreviated" href=3D"ma= ilto:[email protected]">[email protected]</a><br> >=3B >=3B <a class=3D"ecxmoz-txt-link-freetext" href=3D"https= ://www.redhat.com/mailman/listinfo/ataraid-list" target=3D"_blank">https://= www.redhat.com/mailman/listinfo/ataraid-list</a><br> >=3B <br> >=3B <br> >=3B -- <br> >=3B =D1 =F3=E2=E0=E6=E5=ED=E8=E5=EC=2C<br> >=3B Astarta<br> >=3B =C0=E4=EC=E8=ED=E8=F1=F2=F0=E0=F2=EE=F0 =D4=EE=F0=F3=EC=E0= "=CA=F0=FB=F1=E8=ED=FB=E9 =C1=F3=EC"<br> >=3B <a class=3D"ecxmoz-txt-link-freetext" href=3D"http://rat.r= u/forum/index.php" target=3D"_blank">http://rat.ru/forum/index.php</a><br> >=3B <br> >=3B =93The Linux philosophy is 'Laugh in the face of danger'.<= br> >=3B Oops. Wrong One. 'Do it yourself'. Yes=2C that's it.=94<br= > >=3B (c) Linus Torvalds.<br> >=3B <br> </div> </div> </blockquote> <br> <br> <pre class=3D"ecxmoz-signature">--=20 =D1 =F3=E2=E0=E6=E5=ED=E8=E5=EC=2C Astarta =C0=E4=EC=E8=ED=E8=F1=F2=F0=E0=F2=EE=F0 =D4=EE=F0=F3=EC=E0 "=CA=F0=FB=F1=E8= =ED=FB=E9 =C1=F3=EC" <a class=3D"ecxmoz-txt-link-freetext" href=3D"http://rat.ru/forum/index.php= " target=3D"_blank">http://rat.ru/forum/index.php</a> =93The Linux philosophy is 'Laugh in the face of danger'. Oops. Wrong One. 'Do it yourself'. Yes=2C that's it.=94 (c) Linus Torvalds. </pre></div> </div></body> </html>= --_7bf5150a-8682-4f07-83f0-3808913fbe9c_-- --_9351b25f-294c-42bd-af1a-5fc1712ec8fb_ Content-Type: text/x-patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="0014-Using-target-dm-raid-in-state-off-dm-raid45.patch" RnJvbTogTWFyay1XaWxsZW0gSmFuc2VuIDxyYXduYXJAdXNlcnMuc291cmNlZm9yZ2UubmV0PgpE YXRlOiBUaHUsIDEyIEFwciAyMDEyIDIyOjM3OjEyICswMjAwClN1YmplY3Q6IFVzaW5nIHRhcmdl dCBkbS1yYWlkIGluIHN0YXRlIG9mZiBkbS1yYWlkNDUKCi0tLQogMS4wLjAucmMxNi9saWIvYWN0 aXZhdGUvYWN0aXZhdGUuYyB8ICAgMTggKysrKysrKysrLS0tLS0tLS0tCiAxLjAuMC5yYzE2L2xp Yi9tZXRhZGF0YS9tZXRhZGF0YS5jIHwgICAxMCArKysrKy0tLS0tCiAyIGZpbGVzIGNoYW5nZWQs IDE0IGluc2VydGlvbnMoKyksIDE0IGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhLzEuMC4wLnJj MTYvbGliL2FjdGl2YXRlL2FjdGl2YXRlLmMgYi8xLjAuMC5yYzE2L2xpYi9hY3RpdmF0ZS9hY3Rp dmF0ZS5jCmluZGV4IDA1YmQ2MTAuLjZjYzI2MDMgMTAwNjQ0Ci0tLSBhLzEuMC4wLnJjMTYvbGli L2FjdGl2YXRlL2FjdGl2YXRlLmMKKysrIGIvMS4wLjAucmMxNi9saWIvYWN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fcmFpZDQsICJyYWlkNCIsICJyYWlkIn0s CisJeyB0X3JhaWQ1X2xzLCAicmFpZDVfbHMiLCAicmFpZCJ9LAorCXsgdF9yYWlkNV9ycywgInJh aWQ1X3JzIiwgInJhaWQifSwKKwl7IHRfcmFpZDVfbGEsICJyYWlkNV9sYSIsICJyYWlkIn0sCisJ eyB0X3JhaWQ1X3JhLCAicmFpZDVfcmEiLCAicmFpZCJ9LAogCXsgdF9yYWlkNiwgInJhaWQ2Iiwg TlVMTH0sCiB9OwogCg== --_9351b25f-294c-42bd-af1a-5fc1712ec8fb_ Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Ataraid-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/ataraid-list --_9351b25f-294c-42bd-af1a-5fc1712ec8fb_--