dmraid’s metadata & mdadm

For the past few years I’ve had a software raid array using mdadm. It works great.

And then I upgraded my kernel+mdadm last night; it broke. I was puzzled:

Do some reading and some more reading. Do some poking around to see where things stand. No dice. fdisk -l was showing a /dev/dm-0 device. Never seen that before. More digging. Hmm, dmraid -r is listing my drives. Why? Try removing them… dmsetup remove_all Still no good.

So tonight I dive back into the fray. Eventually decide to see exactly what the output of dmraid -r is indicating about those drives. Turns out that back when I originally created the array (several computers ago at this point) I was using a software BIOS RAID…with dmraid. The metadata was still there, and for whatever reason after all these years (two releases of debian had passed!) it suddenly starts reading that metadata again and usurping control of my drives.

So… dmraid -r -E to nuke the unneeded and mischievous metadata. Back in business.

TLDR: If your non-dmraid, mdadm RAID is suddenly borked, check to see if it’s got some crufty dmraid metadata stuck on there. If so, erase it.

  • IanC

    Thanks for that brilliant post, I have been running round in circles wondering where /dev/md-d0 came from when installing Ubuntu 9.04 on disks previously used in a raid config on another pc, I even used the manufacturer’s utility to write zeros to the entire disk, dmraid -r still showed up an old raid config on one disk.

  • IanC

    Thanks for that brilliant post, I have been running round in circles wondering where /dev/md-d0 came from when installing Ubuntu 9.04 on disks previously used in a raid config on another pc, I even used the manufacturer’s utility to write zeros to the entire disk, dmraid -r still showed up an old raid config on one disk.