Red Hat Bugzilla – Bug 827240
mdadm --examine --scan reports device names that do not exist
Last modified: 2012-05-31 19:47:09 EDT
Description of problem:
Version-Release number of selected component (if applicable):
This change appeared on booting the latest downloaded kernel.
Steps to Reproduce:
mdadm --examine --scan
ARRAY /dev/md/0 metadata=1.0 UUID=17d0df6b:7389191e:5a1201f2:dc6ee635 name=XXXX:0
The device (after the word ARRAY) to be ''/dev/md0'' - this device exists, whereas ''/dev/md/0'' does not.
The reason that this is important for me is that I parse the output of the --scan to get devices to print more information about, eg:
mdadm --misc --detail /dev/md0
This is not a bug and is working as designed. The examine command only looks at superblocks on the disk device itself and guesses what an appropriate device name would be based upon the name (version 1.x superblocks) or superminor (version 0.90 superblocks) field of the superblock. The name that you assemble a device under can be anything and need not follow what the field above would suggest (and often does not), but that's not the purpose of the examine command to find that out.
You should just use mdadm --detail --scan. It does what you are wanting without needing the step of scanning for non-md devices and reading their superblocks. And since it reads the information from the running array, and not by reading the raw superblock on the device, it uses whatever name the array is currently assembled under.