Bug 827240 - mdadm --examine --scan reports device names that do not exist
mdadm --examine --scan reports device names that do not exist
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: mdadm (Show other bugs)
All Linux
unspecified Severity low
: rc
: ---
Assigned To: Doug Ledford
Red Hat Kernel QE team
Depends On:
  Show dependency treegraph
Reported: 2012-05-31 19:15 EDT by Alain D D Williams
Modified: 2012-05-31 19:47 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-05-31 19:47:09 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Alain D D Williams 2012-05-31 19:15:19 EDT
Description of problem:

Version-Release number of selected component (if applicable):
This change appeared on booting the latest downloaded kernel.

How reproducible:
Every time

Steps to Reproduce:
1. run:
  mdadm --examine --scan
Actual results:
Lines like:
ARRAY /dev/md/0 metadata=1.0 UUID=17d0df6b:7389191e:5a1201f2:dc6ee635 name=XXXX:0

Expected results:
The device (after the word ARRAY) to be ''/dev/md0'' - this device exists, whereas ''/dev/md/0'' does not.

Additional info:

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
Comment 2 Doug Ledford 2012-05-31 19:47:09 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.