Bug 593460

Summary: dracut mdraid hostonly checking doesn't work for imsm
Product: [Fedora] Fedora Reporter: Andy Lutomirski <luto>
Component: dracutAssignee: Harald Hoyer <harald>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: harald, jonathan
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: dracut-005-5.fc12 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-10-27 22:54:53 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:
Attachments:
Description Flags
Proposed fix
none
Better fix none

Description Andy Lutomirski 2010-05-18 20:24:25 UTC
hostonly checking doesn't include 90mdraid on my system, breaking my boot.

The bug seems to be that check_block_and_slaves looks at slaves but not parents.

# find_root_block_device 
259:1
# ls /sys/dev/block/259\:1/../slaves
sda  sdb
# ls /sys/dev/block/259\:1/
alignment_offset   holders       partition  start      trace
dev                inflight      power      stat       uevent
discard_alignment  make-it-fail  size       subsystem

[look, no slaves]

What the script meant to do was this:

# ls -l /sys/dev/block/259:1/../slaves
total 0
lrwxrwxrwx. 1 root root 0 May 18 16:11 sda -> ../../../../pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
lrwxrwxrwx. 1 root root 0 May 18 16:11 sdb -> ../../../../pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sdb

But using blkid like this is IMO just silly, because:

# /sbin/blkid /dev/md1
# cat /proc/mdstat
Personalities : [raid1] 
md1 : active raid1 sda[2] sdb[0]
      488383488 blocks super external:/md0/0 [2/1] [_U]
      [==>..................]  recovery = 13.1% (64073920/488383620) finish=120.3min speed=58754K/sec
      
md0 : inactive sdb[1](S) sda[0](S)
      4514 blocks super external:imsm
       
unused devices: <none>


This is probably a better check:
# [[ -d /sys/dev/block/259:1/../md ]] && echo yes
yes

This code from 90mdraid/check is also suspicious:
        # root is not on a block device, use the shotgun approach
        blkid | grep -q linux_raid || exit 1
Is isw_raid missing?

Comment 1 Andy Lutomirski 2010-05-18 20:30:26 UTC
Created attachment 414960 [details]
Proposed fix

This version is silly (b/c there should be a check_block_and_parents function), but it should be a lot more reliable than the current code, and, as a bonus, it'll work for ddf arrays as well.

Tested on my machine.

Comment 2 Andy Lutomirski 2010-05-18 20:45:22 UTC
Created attachment 414961 [details]
Better fix

The previous version might have broken LVM on md.  Here's a better patch.

Comment 3 Harald Hoyer 2010-05-19 06:06:02 UTC
thanks!

Comment 4 Fedora Update System 2010-09-23 15:31:27 UTC
dracut-005-4.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/dracut-005-4.fc13

Comment 5 Fedora Update System 2010-09-23 15:32:55 UTC
dracut-005-4.fc12 has been submitted as an update for Fedora 12.
https://admin.fedoraproject.org/updates/dracut-005-4.fc12

Comment 6 Fedora Update System 2010-09-24 20:38:34 UTC
dracut-005-4.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update dracut'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/dracut-005-4.fc12

Comment 7 Fedora Update System 2010-10-27 22:53:25 UTC
dracut-005-5.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2010-10-30 23:38:04 UTC
dracut-005-5.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.