Hi Bruno,

Please find attached a patch that implements mdadm support whilst fully
retaining raidtools2 support. With the changes detailed in the patch, I
have just successfully archived and restored a RAID1 and a RAID0 array
consisting of two drives each on Debian sid amd64, but I expect all
Linux distribution with mdadm to work as well (famous last words ;-) ).

A few notes and remarks:

After much going back and forth I have decided to extend what is already
there rather than recode much of the RAID functionality. The reasons are
mainly that I have only limited time and wanted results rather sooner
than later but even more so that I didn't want to change the raidtools2
side of things because I can't/won't test this and I didn't want to
spend any effort on raidtools2 because it's officially deprecated (cf.
http://people.redhat.com/mingo/raidtools/).

With this said, the patch utilises existing capabilities for
parsing /proc/mdstat and for reading and writing /etc/raidtab. mdadm
works without a config file and even 'mdadm --detail --scan --verbose'
does not give all the (relevant) information that can be gathered from
mdstat. I could have come up with a new file (format), but I think
raidtab is fine (it shouldn't be in /etc really). I am introducing a new
function create_raid_device_via_mdadm() that will create a single RAID
array using mdadm and that gets called in format_device() in case mkraid
cannot be found. Same goes for 'mdadm -S' versus raidstop. An equivalent
for raidstart is not really required as 'mdadm --create' starts the
array straight away.

There are limitations (pre-existing, not introduced by my changes):
- chunk size is hard coded to 4k
- spare devices are ignored
- the parity algorithm is ignored
- multipath is not supported

To overcome these limitations, I will need to change some data
structures and expand the mdstat parser - in fact, I have already
written an experimental stand-alone parser for this purpose. I'm not
sure whether multipath is worth it; it is not even really a RAID level.

Further, I had to include a few more modules for RAID in mindi and init
needed a little change.

Finally, device mapper is not supported. I understand you are working on
this, so I haven't looked into it.

It would be great if you could let me know what you think, in particular
whether you'd be sufficiently happy for this to go into the next stable
version.

Cheers,
Andree
-- 
Andree Leidenfrost
Sydney - Australia

Attachment: RAIDpatch#325877v1.tar.gz
Description: Binary data

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to