Bug 501476

Summary: dmraid set activation from rc.sysinit should use kpartx to get partitions
Product: [Fedora] Fedora Reporter: Winfrid Tschiedel <Winfrid.Tschiedel>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: gasmith, hdegoede, notting, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 8.95.1-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-12-22 04:50:13 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
Patch fixing this none

Description Winfrid Tschiedel 2009-05-19 11:46:09 UTC
Description of problem:

I get in case of fedora different layouts for mapped device,
the format for automatically active raid-devices is
/dev/mapper/<dmraid-id>p<partition number>
while the ā€œpā€ for manually activated devices is missing.



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


How reproducible: 

always

Steps to Reproduce:
1. install fedora on a dmraid device
2. reboot
3. add later a second dmraid device (already partitioned !)
   
Actual results:
After the reboot you will see (e.g.) :

ls /dev/mapper
control         pdc_djgfieghjb    pdc_djgfieghjbp2  pdc_djgfieghjbp6
pdc_cbbgheicjb  pdc_djgfieghjbp1  pdc_djgfieghjbp5

dmraid -ay -p
ERROR: ddf1: both header signatures bad on /dev/sda
RAID set "pdc_cbbgheicjb" already active
RAID set "pdc_djgfieghjb" already active

kpartx -l /dev/mapper/pdc_cbbgheicjb 
pdc_cbbgheicjb1 : 0 1999967 /dev/mapper/pdc_cbbgheicjb 34
pdc_cbbgheicjb2 : 0 48781250 /dev/mapper/pdc_cbbgheicjb 2000001
pdc_cbbgheicjb3 : 0 48828125 /dev/mapper/pdc_cbbgheicjb 50781251
pdc_cbbgheicjb4 : 0 7812500 /dev/mapper/pdc_cbbgheicjb 99609376

kpartx -a /dev/mapper/pdc_cbbgheicjb 
ls /dev/mapper
control          pdc_cbbgheicjb2  pdc_djgfieghjb    pdc_djgfieghjbp5
pdc_cbbgheicjb   pdc_cbbgheicjb3  pdc_djgfieghjbp1  pdc_djgfieghjbp6
pdc_cbbgheicjb1  pdc_cbbgheicjb4  pdc_djgfieghjbp2



Expected results:

As an example you will the expected results ( these results were produced
by openSUSE 11.1 - fully updated ) :

ls /dev/mapper
control               pdc_cbbgheicjb_part3  pdc_djgfieghjb_part2
pdc_cbbgheicjb        pdc_cbbgheicjb_part4  pdc_djgfieghjb_part3
pdc_cbbgheicjb_part1  pdc_djgfieghjb        pdc_djgfieghjb_part5
pdc_cbbgheicjb_part2  pdc_djgfieghjb_part1  pdc_djgfieghjb_part6

Note - the second dmraid device is automatically activated by NOVELL 
distributions.

Additional info:

Comment 1 Hans de Goede 2009-05-19 12:34:07 UTC
Bill,

The issue is not as much the naming being inconsistent (this is caused
by the manual activation Winfied is doing). But that rc.sysinit uses
dmraid to scan the partition table and create the partitioned /dev/mapper
entries. Which unfortunately does not work. 

This is related to Bug 500322, which is about the same issue in mkinitrd.

And yes I remember that I actually simplified things to no use
kpartx in rc.sysinit while adding the --rm_partitions to the rc.sysinit dmraid invocation, sorry!

You should be able to just drop in the old / RHEL-5 rc.sysinit code for
dmraid except that:
1) You need to add --rm_partitions to the dmraid commandline
2) Do not use dm_resolve_name, just use the name from the 1st dmraid
   command as is.

Winfrid, you can get rid of the inconsistent naming issue when manually
activating the partitions by using kpartx like this:
kpartx -a -p p /dev/mapper/pdc_cbbgheicjb

Comment 2 Bill Nottingham 2009-05-19 15:52:57 UTC
Can you attach a patch?

Comment 3 Hans de Goede 2009-05-25 07:42:04 UTC
Created attachment 345282 [details]
Patch fixing this

(In reply to comment #2)
> Can you attach a patch?  

Sure, here you go. I even tested it :)

Comment 4 Bill Nottingham 2009-05-26 16:32:39 UTC
http://git.fedorahosted.org/git/?p=initscripts.git;a=commitdiff;h=c7f37c0df875621f718e554775658ed2afb73eef

Will likely end up as an update at this point.

Comment 5 Bug Zapper 2009-06-09 16:06:25 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 6 Fedora Update System 2009-12-05 15:22:45 UTC
initscripts-8.95.1-1 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/initscripts-8.95.1-1

Comment 7 Fedora Update System 2009-12-07 07:24:39 UTC
initscripts-8.95.1-1 has been pushed to the Fedora 11 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 initscripts'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-12765

Comment 8 Fedora Update System 2009-12-22 04:49:51 UTC
initscripts-8.95.1-1 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.