Bug 732818

Summary: nested md's are not assembled correctly.
Product: [Fedora] Fedora Reporter: Thomas Davis <tdavis>
Component: mdadmAssignee: Doug Ledford <dledford>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 15CC: agk, dledford, mbroz
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: mdadm-3.2.2-9.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-10 23:59:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Thomas Davis 2011-08-23 18:07:38 UTC
Description of problem:

I have a volume built of 3 different md's, from 4 drives (2 are 1TB drives, 2 are 2TB drives)

two md's are raid1, and then these used to build a raid0 array.

upon boot, Fedora15 finds the two raid1's, but does not do the final assembly of the raid0 from the raid1's.

Using raid10 in the kernel results in wasted space, for the 2tb drives are not fully utilized.

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


How reproducible:

Build 3 raid partitions, make the 3rd dependent on the first
two being properly built.


Steps to Reproduce:
1. Create a raid1 md, create a second raid1 md, then create a raid0 md from md0 & md1.
2. Reboot.
3. System errors out.
  
Actual results:

system errors out.

Expected results:

system should build correct volume.

Additional info:

edit /lib/systemd/fedora-storage-init and add:

# Start any nest MD RAID arrays.
[ -f /etc/mdadm.conf -a -x /sbin/mdadm ] && /sbin/mdadm -As --auto=yes --run

before:

# Start any MD RAID arrays that haven't been started yet
[ -r /proc/mdstat ] && [ -r /dev/md/md-device-map ] && /sbin/mdadm -IRs

if [ -x /sbin/lvm ]; then
        action $"Setting up Logical Volume Management:" /sbin/lvm vgchange -a y --sysinit
fi

fixes the problem; ie:

[root@tank systemd]# pwd
/lib/systemd
[root@tank systemd]# more fedora-storage-init 
#!/bin/bash
#
# Storage initialization

. /etc/init.d/functions

[ -z "${cmdline}" ] && cmdline=$(cat /proc/cmdline)

if ! strstr "$cmdline" nompath && [ -f /etc/multipath.conf ] && \
                [ -x /sbin/multipath ]; then
        modprobe dm-multipath > /dev/null 2>&1
        /sbin/multipath -v 0
        if [ -x /sbin/kpartx ]; then
                /sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -a -p p" >/dev/null
        fi
fi

if ! strstr "$cmdline" nodmraid && [ -x /sbin/dmraid ]; then
        modprobe dm-mirror >/dev/null 2>&1
        dmraidsets=$(LC_ALL=C /sbin/dmraid -s -c -i)
        if [ "$?" = "0" ]; then
                for dmname in $dmraidsets; do
                        if [[ "$dmname" == isw_* ]] && \
                           ! strstr "$cmdline" noiswmd; then
                                continue
                        fi
                        /sbin/dmraid -ay -i --rm_partitions -p "$dmname" >/dev/null 2>&1
                        /sbin/kpartx -a -p p "/dev/mapper/$dmname"
                done
        fi
fi

[ -f /etc/mdadm.conf -a -x /sbin/mdadm ] && /sbin/mdadm -As --auto=yes --run
# Start any MD RAID arrays that haven't been started yet
[ -r /proc/mdstat ] && [ -r /dev/md/md-device-map ] && /sbin/mdadm -IRs

if [ -x /sbin/lvm ]; then
        action $"Setting up Logical Volume Management:" /sbin/lvm vgchange -a y --sysinit
fi

Comment 1 Thomas Davis 2011-08-23 18:31:03 UTC
Desired:

[root@tank systemd]# cat /proc/mdstat 
Personalities : [raid1] [raid0] 
md2 : active raid0 md0[0] md1[1]
      2723933888 blocks super 1.2 32k chunks
      
md1 : active raid1 sdd2[1] sdb1[0]
      1952488312 blocks super 1.2 [2/2] [UU]
      
md0 : active raid1 sda3[0] sdc3[1]
      771447672 blocks super 1.2 [2/2] [UU]
      
unused devices: <none>

with out the change above, md2 is not built upon boot.

sdd and sdb are 2TB drives, sda and sdc are 1TB drives.

Comment 2 Doug Ledford 2011-08-25 19:44:07 UTC
I changed the udev rules file in a way that should solve this.

Comment 3 Fedora Update System 2011-08-25 19:53:25 UTC
mdadm-3.2.2-8.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/mdadm-3.2.2-8.fc15

Comment 4 Thomas Davis 2011-08-26 16:58:42 UTC
Downloaded, installed and did a reboot..

All is well!

So the mdadm-3.2.2-8-fc15 update fixes this problem.

Comment 5 Fedora Update System 2011-08-26 18:58:45 UTC
Package mdadm-3.2.2-8.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mdadm-3.2.2-8.fc15'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/mdadm-3.2.2-8.fc15
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2011-09-02 05:24:22 UTC
Package mdadm-3.2.2-9.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mdadm-3.2.2-9.fc15'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/mdadm-3.2.2-9.fc15
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2011-09-10 23:58:55 UTC
mdadm-3.2.2-9.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.