Changing from dm-raid45.ko to dm-raid.ko

Mark-Willem Jansen markwillem at
Thu May 3 21:12:18 UTC 2012

Dear md/dm developers,

As I already pointed out on the ataraid-list, I have made a small patch for dmraid, so it will use the dm-raid target in state of the dm-raid45 target to handle raid4 and riad5 setups. This patch is added to this e-mail. To put it in context I use dmraid to detect my fakeraid, which is shared with a Windows OS.

There were some things I could not figure out and would like to ask three questions regarding the arguments passed to the module.

- First a more general question does it look okay to you what I have implemented?

- Second what to do with the offset variable that is given by the metadata on the disk? On the other dmraid related modules the disk information is passed like [dev][offset]. With the dm-raid module it changed to [meta-dev][data-dev]. In the patch I ignore the meta-dev and just pass "- path_to_dev" to the module. This will work as the offset given by the metadata on my disks are equal to zero, the same value that is automatically set by the module. What does one have to do if the metadata on the disk says that the offset is not equal to zero?

- Last I would like to build up the argument string more generally. Like concatenate the argument strings depending on some if statements, like

   num_arg += 2;
   arguments = arguments + sprintf("rebuild %d",;

And then pass the final string using

p_fmt(lc, table, "0 %U %s %s %u %s", sectors, dm_type, raid_type, num_arg, arguments).

This will make the code easier to read and quicker to hack/change/code.


Mark-Willem Jansen
P.S.: The patch is a modified version of the one I send to the ataraid-list some weeks ago.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0014-Changed-from-dm-raid45-to-dm-raid-for-handling-RAID4.patch
Type: text/x-patch
Size: 3787 bytes
Desc: not available
URL: <>

More information about the Ataraid-list mailing list