MD / DM
[Posted January 25, 2006 by corbet]
The Linux software RAID code (often called "MD" for "multi-device") is a
longstanding feature of the kernel. RAID users appreciate its robustness,
configurability, and the fact that it performs well; better performance
than that achieved with hardware RAID controllers is not unheard of. In
recent years, little has been heard about the MD code, however. Its feature set has
changed slowly, and developments with the device mapper code have taken a
higher profile. That, perhaps, is as it should be; a storage subsystem
which attracts attention is rarely a good thing.
That said, MD hacker Neil Brown has been busy. His latest patch set
implements RAID5 reshaping:
the ability to add devices to a RAID5 array without going through a backup
and restore cycle - or even shutting the array down. This is a nontrivial
task; adding a drive to a RAID5 array requires redistributing data and
parity blocks across the entire array. With this version of the patch,
Linux MD can not only perform this task, but it can do it while still
handling normal I/O to the array. The new patch also checkpoints the
process, so that it can be restarted if interrupted in the middle; this
corrects a minor defect in the previous version, wherein interrupting the
reshaping task would cause all data in the array to be lost.
Neil notes that things could still go wrong:
There is still a small window ( < 1 second) at the start of the
reshape during which a crash will cause unrecoverable corruption.
My plan is to resolve this in mdadm rather than md. The critical
data will be copied into the new drive(s) prior to commencing the
reshape. If there is a crash the kernel will refuse the reassemble
the array. mdadm will be able to re-assemble it by first restoring
the critical data and then letting the remainder of the reshape run
it's course.
Neil has various other enhancements in mind, including the ability to upgrade
a RAID5 array to RAID6 (which increases fault tolerance by adding another
set of parity blocks). Quite a bit, clearly, is happening in the MD world.
All this activity drew queries from a couple of observers who had, it
seems, assumed that the addition of the device mapper to the kernel meant
that the MD code would eventually whither away. The device mapper can
handle some of the lower RAID levels (mirroring and striping) now, and
there is work in progress to add RAID5 support. Since the device mapper is
a general framework for mixing and matching drives, it makes sense to some
that the RAID functionality should move there too.
Unsurprisingly, Neil disagrees. His
suggestion is that "anything with redundancy," including RAID5 and RAID6,
is best handled in the MD code. The device mapper, instead, is good for
fancier arrangements like multipath, encryption, volume management,
snapshots, etc. Certainly, those who are placing trust in RAID for
redundancy should be comforted by the rather longer track record built up
by the MD code. MD is also said to be faster than the device mapper at
this time.
As others have pointed out, however, there is a cost to carrying multiple
RAID implementations in the kernel. Each must be maintained, and each will
have its own unique bugs to contribute to the whole. So, as the device
mapper develops higher-level RAID capabilities, it would be nice if some of
the core code could be shared between MD and DM. Making that happen,
however, will require developer effort - and it's not clear that any
hackers are interested in doing that work at this time.
(
Log in to post comments)