Re: Howto: implement AMD SB9xx RAID5 support in dmraid

Astarta <[email protected]> Fri, 13 Apr 2012 11:00:10 +0400
Newsgroups gmane.linux.ataraid
Organization rat.ru
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============2254410822581222496==
Content-Type: multipart/alternative;
	boundary="------------080004010307090100060803"

This is a multi-part message in MIME format.
--------------080004010307090100060803
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx3-phx2.redhat.com id q3D7AH4N025038

Hello Mark-Willem,

Good research! Thank you for sharing.

--
Mary

On 04/13/2012 03:23 AM, Mark-Willem Jansen wrote:

> Hi,
>
> Been playing with the patches you gave me. And I finally got the raid=20
> up and running, 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, this caused dmraid to=20
> produce a new error related to the missing dm-raid45 module. Before=20
> activating a new raid set  dmraid checks if a dm-target has been=20
> registered with device-mapper. This can be changed through a struct in=20
> metadata.c. Doing this accordingly only left me with the error of raid=20
> array not activated. Going through the dmesg I found that dmraid was=20
> giving a wrong raid type to the dm-raid module. Digging deeper I wound=20
> that the arguments given to dm-raid45 and dm-raid have a different=20
> structure. So I have changed the arguments structure send to the=20
> module accordingly.
>
> $ dmraid -ay -t
> pdc_ciihdaafgf: 0 1953124864 raid raid5_la 2 128 nosync 3 - /dev/sdb -=20
> /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=20
> 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=20
> naming the patch.)
>
> Now I can activate the raid and by using kpartx I can also mount the=20
> partitions on the raid. Whoot.
>
> Unfortunately the fix was a bit dirty, could be that I have broken=20
> dmraid for the other raid types. Also I am not sure if you need to=20
> send the region_size to the dm-raid module.
>
> Regards,
>
> Mark-Willem
>
> -----------------------------------------------------------------------=
-
> Date: Tue, 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
>
> Hello,
>
> I do have dm-raid45 patch for 3.2.
> I do not remember where it was taken from, but it compiles with 3.2 :-)
>
>
> On 04/03/2012 11:13 AM, Mark-Willem Jansen wrote:
>
>     Hello,
>
>     Later this day I will apply the patch. But patching the kernel
>     will be more cumbersome. The
>     present kernel running om my system is 3.2.0 and the patches found
>     on the web are for
>     older kernels. But maybe the module dm-raid.ko included in the
>     kernel can be helpful.
>
>     Regards,
>
>     Mark-Willem
>
>     > Date: Mon, 2 Apr 2012 17:42:12 +0400
>     > From: [email protected] <mailto:[email protected]>
>     > To: [email protected] <mailto:[email protected]>
>     > CC: [email protected] <mailto:[email protected]>
>     > Subject: Re: Howto: implement AMD SB9xx RAID5 support in dmraid
>     >
>     > hello,
>     >
>     > You may try the attached patch to support RAID5 in pdc dmraid
>     format. It
>     > works OK for me.
>     > Be sure to patch the kernel itself to support dm-raid45 target.
>     >
>     >
>     > On 04/02/2012 02:59 AM, Phillip Susi wrote:
>     > > -----BEGIN PGP SIGNED MESSAGE-----
>     > > Hash: SHA1
>     > >
>     > > On 04/01/2012 04:21 PM, 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, there appears to
>     be no #define for PDC_T_RAID5, 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+lYbsT8OL=
3
>     > > l22ZRVt9ReIAu7CJzRjx0yfaYAUo6Zy8fwzOjt9eF4fPYVQvnn53SYQu/qtyv2D=
Z
>     > > rDyv7owpxwcqQsZIYvBzQvWjEVT2s6VJrVtOVnZ2G1awa1SwIoc9LPnmouOeKhQ=
G
>     > > auYL+O1UqfQEroJDsnOkZ8srrgc/m2zN3AxID4ps0FymQyNgy2s+HhBlsI4LeUN=
K
>     > > GimqJMwfbvaMlk0u8botcm2aMwogq+ap1GhJYddnRMluS6U4UJnS7NYrZYtww/1=
m
>     > > 3WJWkX9hsYxo+QBA0qassg3zc/efzkC8pBBvDo7FLNGcXs2txi7dXmNXLferwFo=
=3D
>     > > =3Do0zP
>     > > -----END PGP SIGNATURE-----
>     > >
>     > > _______________________________________________
>     > > Ataraid-list mailing list
>     > > [email protected] <mailto:[email protected]>
>     > > https://www.redhat.com/mailman/listinfo/ataraid-list
>     >
>     >
>     > --
>     > =D0=A1 =D1=83=D0=B2=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC,
>     > Astarta
>     > =D0=90=D0=B4=D0=BC=D0=B8=D0=BD=D0=B8=D1=81=D1=82=D1=80=D0=B0=D1=82=
=D0=BE=D1=80 =D0=A4=D0=BE=D1=80=D1=83=D0=BC=D0=B0 "=D0=9A=D1=80=D1=8B=D1=81=
=D0=B8=D0=BD=D1=8B=D0=B9 =D0=91=D1=83=D0=BC"
>     > http://rat.ru/forum/index.php
>     >
>     > =E2=80=9CThe Linux philosophy is 'Laugh in the face of danger'.
>     > Oops. Wrong One. 'Do it yourself'. Yes, that's it.=E2=80=9D
>     > (c) Linus Torvalds.
>     >
>
>
>
> --=20
> =D0=A1 =D1=83=D0=B2=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC,
> Astarta
> =D0=90=D0=B4=D0=BC=D0=B8=D0=BD=D0=B8=D1=81=D1=82=D1=80=D0=B0=D1=82=D0=BE=
=D1=80 =D0=A4=D0=BE=D1=80=D1=83=D0=BC=D0=B0 "=D0=9A=D1=80=D1=8B=D1=81=D0=B8=
=D0=BD=D1=8B=D0=B9 =D0=91=D1=83=D0=BC"
> http://rat.ru/forum/index.php
>
> =E2=80=9CThe Linux philosophy is 'Laugh in the face of danger'.
> Oops. Wrong One. 'Do it yourself'. Yes, that's it.=E2=80=9D
> (c) Linus Torvalds.


--------------080004010307090100060803
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx3-phx2.redhat.com id q3D7AH4N025038

<html>
  <head>
    <meta content=3D"text/html; charset=3DUTF-8" http-equiv=3D"Content-Ty=
pe">
  </head>
  <body bgcolor=3D"#FFFFFF" text=3D"#000000">
    Hello Mark-Willem,<br>
    <br>
    Good research! Thank you for sharing.<br>
    <br>
    --<br>
    Mary<br>
    <br>
    On 04/13/2012 03:23 AM, Mark-Willem Jansen wrote:<br>
    <br>
    <blockquote cite=3D"mid:[email protected]"
      type=3D"cite">
      <div dir=3D"ltr">Hi,<br>
        <br>
        Been playing with the patches you gave me. And I finally got the
        raid up and running, using the shipped dm-raid.ko module in the
        3.2 kernel.<br>
        <br>
        Lets go through the steps.<br>
        <br>
        I have applied the dmraid_pdc_raid5.patch, this caused dmraid to
        produce a new error related to the missing dm-raid45 module.
        Before activating a new raid set=C2=A0 dmraid checks if a dm-targ=
et
        has been registered with device-mapper. This can be changed
        through a struct in metadata.c. Doing this accordingly only left
        me with the error of raid array not activated. Going through 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 dm-raid have a different structure. So I have
        changed the arguments structure send to the module accordingly.<b=
r>
        <br>
        $ dmraid -ay -t<br>
        pdc_ciihdaafgf: 0 1953124864 raid raid5_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 that 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 partitions on the raid. Whoot.<br>
        <br>
        Unfortunately the fix was a bit dirty, 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,<br>
        <br>
        Mark-Willem<br>
        <br>
        <div>
          <hr id=3D"stopSpelling">Date: Tue, 3 Apr 2012 11:13:20 +0400<br=
>
          From: <a class=3D"moz-txt-link-abbreviated" href=3D"mailto:asta=
[email protected]">[email protected]</a><br>
          To: <a class=3D"moz-txt-link-abbreviated" href=3D"mailto:markwi=
[email protected]">[email protected]</a><br>
          CC: <a class=3D"moz-txt-link-abbreviated" href=3D"mailto:atarai=
[email protected]">[email protected]</a><br>
          Subject: Re: Howto: implement AMD SB9xx RAID5 support in
          dmraid<br>
          <br>
          <meta http-equiv=3D"Content-Type" content=3D"text/html;
            charset=3DUTF-8">
          <meta name=3D"Generator" content=3D"Microsoft SafeHTML">
          Hello,<br>
          <br>
          I do have dm-raid45 patch for 3.2. <br>
          I do not remember where it was taken from, but it compiles
          with 3.2 :-)<br>
          <br>
          <br>
          On 04/03/2012 11:13 AM, Mark-Willem Jansen wrote:
          <blockquote
            cite=3D"mid:[email protected]">
            <style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}

</style>
            <div dir=3D"ltr"> Hello,<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,<br>
              <br>
              Mark-Willem<br>
              <br>
              <div>&gt; Date: Mon, 2 Apr 2012 17:42:12 +0400<br>
                &gt; From: <a moz-do-not-send=3D"true"
                  class=3D"ecxmoz-txt-link-abbreviated"
                  href=3D"mailto:[email protected]">[email protected]</a><br>
                &gt; To: <a moz-do-not-send=3D"true"
                  class=3D"ecxmoz-txt-link-abbreviated"
                  href=3D"mailto:[email protected]">markwillem@hotma=
il.com</a><br>
                &gt; CC: <a moz-do-not-send=3D"true"
                  class=3D"ecxmoz-txt-link-abbreviated"
                  href=3D"mailto:[email protected]">[email protected]</a><b=
r>
                &gt; Subject: Re: Howto: implement AMD SB9xx RAID5
                support in dmraid<br>
                &gt; <br>
                &gt; hello,<br>
                &gt; <br>
                &gt; You may try the attached patch to support RAID5 in
                pdc dmraid format. It <br>
                &gt; works OK for me.<br>
                &gt; Be sure to patch the kernel itself to support
                dm-raid45 target.<br>
                &gt; <br>
                &gt; <br>
                &gt; On 04/02/2012 02:59 AM, Phillip Susi wrote:<br>
                &gt; &gt; -----BEGIN PGP SIGNED MESSAGE-----<br>
                &gt; &gt; Hash: SHA1<br>
                &gt; &gt;<br>
                &gt; &gt; On 04/01/2012 04:21 PM, Mark-Willem Jansen
                wrote:<br>
                &gt; &gt;&gt; ERROR: pdc: zero sectors on /dev/sdd<br>
                &gt; &gt;&gt; ERROR: pdc: setting up RAID device
                /dev/sdd<br>
                &gt; &gt; It looks like sectors() in pdc.c is missing
                the case for computing the size of a RAID5. For that
                matter, there appears to be no #define for PDC_T_RAID5,
                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>
                &gt; &gt;<br>
                &gt; &gt;<br>
                &gt; &gt; -----BEGIN PGP SIGNATURE-----<br>
                &gt; &gt; Version: GnuPG v1.4.11 (GNU/Linux)<br>
                &gt; &gt; Comment: Using GnuPG with Mozilla - <a
                  moz-do-not-send=3D"true"
                  class=3D"ecxmoz-txt-link-freetext"
                  href=3D"http://enigmail.mozdev.org/" target=3D"_blank">=
http://enigmail.mozdev.org/</a><br>
                &gt; &gt;<br>
                &gt; &gt;
                iQEcBAEBAgAGBQJPeN2yAAoJEJrBOlT6nu75NFQIANRt6f4STTvdEV+lY=
bsT8OL3<br>
                &gt; &gt;
                l22ZRVt9ReIAu7CJzRjx0yfaYAUo6Zy8fwzOjt9eF4fPYVQvnn53SYQu/=
qtyv2DZ<br>
                &gt; &gt;
                rDyv7owpxwcqQsZIYvBzQvWjEVT2s6VJrVtOVnZ2G1awa1SwIoc9LPnmo=
uOeKhQG<br>
                &gt; &gt;
                auYL+O1UqfQEroJDsnOkZ8srrgc/m2zN3AxID4ps0FymQyNgy2s+HhBls=
I4LeUNK<br>
                &gt; &gt;
                GimqJMwfbvaMlk0u8botcm2aMwogq+ap1GhJYddnRMluS6U4UJnS7NYrZ=
Ytww/1m<br>
                &gt; &gt;
                3WJWkX9hsYxo+QBA0qassg3zc/efzkC8pBBvDo7FLNGcXs2txi7dXmNXL=
ferwFo=3D<br>
                &gt; &gt; =3Do0zP<br>
                &gt; &gt; -----END PGP SIGNATURE-----<br>
                &gt; &gt;<br>
                &gt; &gt;
                _______________________________________________<br>
                &gt; &gt; Ataraid-list mailing list<br>
                &gt; &gt; <a moz-do-not-send=3D"true"
                  class=3D"ecxmoz-txt-link-abbreviated"
                  href=3D"mailto:[email protected]">Ataraid-list@re=
dhat.com</a><br>
                &gt; &gt; <a moz-do-not-send=3D"true"
                  class=3D"ecxmoz-txt-link-freetext"
                  href=3D"https://www.redhat.com/mailman/listinfo/ataraid=
-list"
                  target=3D"_blank">https://www.redhat.com/mailman/listin=
fo/ataraid-list</a><br>
                &gt; <br>
                &gt; <br>
                &gt; -- <br>
                &gt; =D0=A1 =D1=83=D0=B2=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=
=B5=D0=BC,<br>
                &gt; Astarta<br>
                &gt; =D0=90=D0=B4=D0=BC=D0=B8=D0=BD=D0=B8=D1=81=D1=82=D1=80=
=D0=B0=D1=82=D0=BE=D1=80 =D0=A4=D0=BE=D1=80=D1=83=D0=BC=D0=B0 "=D0=9A=D1=80=
=D1=8B=D1=81=D0=B8=D0=BD=D1=8B=D0=B9 =D0=91=D1=83=D0=BC"<br>
                &gt; <a moz-do-not-send=3D"true"
                  class=3D"ecxmoz-txt-link-freetext"
                  href=3D"http://rat.ru/forum/index.php" target=3D"_blank=
">http://rat.ru/forum/index.php</a><br>
                &gt; <br>
                &gt; =E2=80=9CThe Linux philosophy is 'Laugh in the face =
of
                danger'.<br>
                &gt; Oops. Wrong One. 'Do it yourself'. Yes, that's it.=E2=
=80=9D<br>
                &gt; (c) Linus Torvalds.<br>
                &gt; <br>
              </div>
            </div>
          </blockquote>
          <br>
          <br>
          <pre class=3D"ecxmoz-signature">--=20
=D0=A1 =D1=83=D0=B2=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC,
Astarta
=D0=90=D0=B4=D0=BC=D0=B8=D0=BD=D0=B8=D1=81=D1=82=D1=80=D0=B0=D1=82=D0=BE=D1=
=80 =D0=A4=D0=BE=D1=80=D1=83=D0=BC=D0=B0 "=D0=9A=D1=80=D1=8B=D1=81=D0=B8=D0=
=BD=D1=8B=D0=B9 =D0=91=D1=83=D0=BC"
<a moz-do-not-send=3D"true" class=3D"ecxmoz-txt-link-freetext" href=3D"ht=
tp://rat.ru/forum/index.php" target=3D"_blank">http://rat.ru/forum/index.=
php</a>

=E2=80=9CThe Linux philosophy is 'Laugh in the face of danger'.
Oops. Wrong One. 'Do it yourself'. Yes, that's it.=E2=80=9D
(c) Linus Torvalds. </pre>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>

--------------080004010307090100060803--


--===============2254410822581222496==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

_______________________________________________
Ataraid-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/ataraid-list
--===============2254410822581222496==--