Bug 491889 - odd partition naming with kpartx
Summary: odd partition naming with kpartx
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: device-mapper-obsolete
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Milan Broz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-03-24 14:44 UTC by Bill Nottingham
Modified: 2014-03-17 03:18 UTC (History)
11 users (show)

Fixed In Version: 2.02.48-1.fc11
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-07-19 10:32:16 UTC


Attachments (Terms of Use)
Proposed patch (1.06 KB, patch)
2009-06-17 15:03 UTC, Milan Broz
no flags Details | Diff

Description Bill Nottingham 2009-03-24 14:44:10 UTC
Description of problem:

I have currently /dev/mapper/_dev_sdb1 (a dm-crypt mapping of /dev/sdb1).

I perform the following:

# losetup /dev/loop0 /var/lib/libvirt/images/upgrade-test.img
# kpartx -a /dev/loop0

kpartx creates:

# dmsetup ls --tree
_dev_sdb1p1 (253:1)
 └─ (7:0)

Where did it come up with that name?

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

kpartx-0.4.8-9.fc11.x86_64

Comment 1 Bug Zapper 2009-06-09 12:33:47 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 2 Jason Farrell 2009-06-12 21:51:27 UTC
I've got a similar odd mapping problem with kpartx-0.4.8-10.fc11.x86_64 in F11. 

It used to create "loop1p1, loop1p2, loop1p3, ..." mappings for each loop device partition, but I notice now that it's yanking an odd basename mapping from one of my old LVs (it's wanting to create "vgr10-rootf9p1" instead of the expected "loop1p1").

To Reproduce:

# qemu-img create usb.img 8G
Formatting 'usb.img', fmt=raw, size=8388608 kB
# parted usb.img mklabel msdos
# parted usb.img mkpart primary ext3 0 -- -1
# parted usb.img p
Model:  (file)                   
Disk /0tmp/img/usb.img: 8590MB   
Sector size (logical/physical): 512B/512B
Partition Table: msdos                   

Number  Start   End     Size    Type     File system  Flags
 1      16.4kB  8590MB  8590MB  primary                    

# losetup /dev/loop1 usb.img
[root@nano img]# file -s /dev/loop1        
/dev/loop1: x86 boot sector; partition 1: ID=0x83, starthead 1, startsector 32, 16777184 sectors, code offset 0xb8
# kpartx -l /dev/loop1
vgr10-rootf9p1 : 0 16777184 /dev/loop1 32
[root@nano img]# kpartx -a /dev/loop1
[root@nano img]# dmsetup ls --tree
vgr5-repo (253:8)
 └─ (9:3)
vgr10-swapcrypt (253:2)
 └─ (9:1)
vgr10-swap (253:0)
 └─ (9:1)
vgr0-0tmp (253:12)
 └─ (9:2)
vgr5-home (253:7)
 └─ (9:3)
vgr10-rootf11 (253:6)
 └─ (9:1)
vgr10-rootf9p1 (253:13)
 └─ (7:1)
vgr10-rootf10 (253:3)
 └─ (9:1)
vgr10-butter (253:4)
 └─ (9:1)
vgr0-0safe (253:11)
 └─ (9:2)
vgr10-rootf11rc1 (253:5)
 └─ (9:1)
vgr5-archive--nobu (253:10)
 └─ (9:3)
vgr10-rootf9 (253:1)
 └─ (9:1)
vgr5-0safe--backup (253:9)
 └─ (9:3)

Comment 3 Jason Farrell 2009-06-12 21:56:18 UTC
Ok, so it works if given the FILE but not the loop DEVICE. I don't think this used to matter.

# kpartx -d /dev/loop1
# kpartx -l usb.img
loop2p1 : 0 16777184 /dev/loop2 32

Comment 4 Milan Broz 2009-06-17 13:59:43 UTC
Hm. it doesn't work event with kpartx -l here:

# kpartx -l /dev/loop0
vg_test-lv1p1 : 0 64197 /dev/loop0 63
vg_test-lv1p2 : 0 64260 /dev/loop0 64260
vg_test-lv1p3 : 0 128520 /dev/loop0 128520
vg_test-lv1p5 : 0 128457 /dev/dm-2 63

I'll try to fix that...

Comment 5 Milan Broz 2009-06-17 15:03:53 UTC
Created attachment 348269 [details]
Proposed patch

Patch attached, but I am not sure if libdevmapper change in operation here is correct now...
(I'll fix it after some discussion about it.)

Comment 6 Milan Broz 2009-06-17 21:01:27 UTC
I fixed upstream libdevmapper library to be compatible here, no need to patch kpartx.

I hope that this week will be new release which will fix this problem.

(In the meantime setting bug to POST - fixed upstream.)

Comment 7 Fedora Update System 2009-07-03 09:30:12 UTC
lvm2-2.02.48-1.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/lvm2-2.02.48-1.fc11

Comment 8 Jason Farrell 2009-07-04 02:01:58 UTC
fixed. can no longer reproduce.

# kpartx -l /dev/loop1
loop1p1 : 0 8388576 /dev/loop1 32

Comment 9 Fedora Update System 2009-07-11 17:15:58 UTC
lvm2-2.02.48-1.fc11 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 lvm2'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-7468

Comment 10 Fedora Update System 2009-07-19 10:31:34 UTC
lvm2-2.02.48-1.fc11 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.