Bug 827240

Summary: mdadm --examine --scan reports device names that do not exist
Product: Red Hat Enterprise Linux 6 Reporter: Alain D D Williams <addw>
Component: mdadmAssignee: Doug Ledford <dledford>
Status: CLOSED NOTABUG QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.2   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-31 23:47:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alain D D Williams 2012-05-31 23:15:19 UTC
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 23:47:09 UTC
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.