Bug 501476 - dmraid set activation from rc.sysinit should use kpartx to get partitions
dmraid set activation from rc.sysinit should use kpartx to get partitions
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
11
All Linux
low Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-19 07:46 EDT by Winfrid Tschiedel
Modified: 2014-03-16 23:18 EDT (History)
4 users (show)

See Also:
Fixed In Version: 8.95.1-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-12-21 23:50:13 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch fixing this (567 bytes, patch)
2009-05-25 03:42 EDT, Hans de Goede
no flags Details | Diff

  None (edit)
Description Winfrid Tschiedel 2009-05-19 07:46:09 EDT
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 08:34:07 EDT
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 11:52:57 EDT
Can you attach a patch?
Comment 3 Hans de Goede 2009-05-25 03:42:04 EDT
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 12:32:39 EDT
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 12:06:25 EDT
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 10:22:45 EST
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 02:24:39 EST
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-21 23:49:51 EST
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.

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