Bug 150787

Summary: Cannot create raid device manually because of missing device
Product: Red Hat Enterprise Linux 4 Reporter: Peter Bieringer <pb>
Component: mdadmAssignee: Doug Ledford <dledford>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: k.georgiou, paulw
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-07-05 20:39:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Peter Bieringer 2005-03-10 16:37:22 UTC
problem:
Because udev only creates required devices, I cannot create a new
raid, reason: device is missing

Version-Release number of selected component (if applicable):
mdadm-1.6.0-2

How reproducible:
Always

Steps to Reproduce:
1. Install RHEL4, but leave some space on the disks free
2. create partition on each disk, type fd
3. reboot to activate partitions, needed because of:
WARNING: Re-reading the partition table failed with error 16: Device
or resource busy.
4. try to create raid:
# mdadm --create /dev/md2 --level 1 --raid-devices 2 /dev/sd[ab]5
    

Actual Results:  mdadm: error opening /dev/md2: No such file or directory

Expected Results:  Working

Additional info:

# ll /dev/md*
brw-rw----  1 root disk 9, 0 Mar 10 17:14 /dev/md0
brw-rw----  1 root disk 9, 1 Mar 10 17:14 /dev/md1

Workaround:
# mknod /dev/md2 b 9 2  &&  mdadm --create /dev/md2 --level 1
--raid-devices 2 /dev/sd[ab]5
mdadm: array /dev/md2 started.

Perhaps mdadm should get smarter and create missing devices (or
request creation using udev).

BTW: one can extend mknod also to understand "mdX" automagically like
already on "hdX".

Comment 1 Doug Ledford 2006-07-05 20:39:15 UTC
This isn't a bug.  The mdadm program, as per the upstream developer's wishes,
does not currenly automatically create device nodes.  In order to have mdadm
create the device node as part of the array creation process, the option
--auto=yes may be passed on the create command line and it will do as you are
expecting.  Further details of the --auto option can be found in the man page
for mdadm.