Bug 593460 - dracut mdraid hostonly checking doesn't work for imsm
Summary: dracut mdraid hostonly checking doesn't work for imsm
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dracut
Version: 13
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-05-18 20:24 UTC by Andy Lutomirski
Modified: 2010-10-30 23:39 UTC (History)
2 users (show)

Fixed In Version: dracut-005-5.fc12
Clone Of:
Environment:
Last Closed: 2010-10-27 22:54:53 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Proposed fix (735 bytes, patch)
2010-05-18 20:30 UTC, Andy Lutomirski
no flags Details | Diff
Better fix (1.49 KB, patch)
2010-05-18 20:45 UTC, Andy Lutomirski
no flags Details | Diff

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.


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