Description of problem: kpartx when trying to create the corresponding linear devices on a dos partition with an extended partition fails. This is occurring because kpartx creates partitions that are inside a logical partition on top of the device that represents the extended partition. The problem comes from the fact that when this is done instead of changing the offset of the partition to the start of the extended partition it continues to use the offset from the beginning of the entire volume. Example DOS MBR: # partition table of /dev/sda unit: sectors /dev/sda1 : start= 32, size= 206816, Id=83 /dev/sda2 : start= 206848, size= 206848, Id=83 /dev/sda3 : start= 413696, size= 6293504, Id=82 /dev/sda4 : start= 6707200, size= 56207360, Id= 5 /dev/sda5 : start= 6707232, size= 5244896, Id=83 /dev/sda6 : start= 11952160, size= 5244896, Id=83 /dev/sda7 : start= 17197088, size= 22022112, Id=83 /dev/sda8 : start= 39219232, size= 22022112, Id=83 bad dmtable made by kpartx: mpath0p7: 0 22022112 linear 253:4 22442080 mpath0p6: 0 5244896 linear 253:4 11952192 mpath0p5: 0 5244896 linear 253:4 6707232 mpath0p4: 0 56207360 linear 253:0 6707200 mpath0p3: 0 6293504 linear 253:0 413696 mpath0p2: 0 206848 linear 253:0 206848 mpath0p1: 0 206816 linear 253:0 32 Corrected dmtable: archive0p8: 0 22022112 linear 253:4 32512032 archive0p7: 0 22022112 linear 253:4 10489888 archive0p6: 0 5244896 linear 253:4 5244960 archive0p5: 0 5244896 linear 253:4 32 archive0p4: 0 56207360 linear 253:0 6707200 archive0p3: 0 6293504 linear 253:0 413696 archive0p2: 0 206848 linear 253:0 206848 archive0p1: 0 206816 linear 253:0 32 Attached is a patch which I used to work around this problem. So far it has worked for me. Version-Release number of selected component (if applicable): device-mapper-multipath-0.4.8-7.fc10.i386 How reproducible: 100% Steps to Reproduce: 1. Create a partition table with extended partitions on a multipath device 2. Execute "kpartx -a <mpathdev>" Actual results: Fails to create some of the partitions. Expected results: Partitions created as linear device mapper devs. Additional info:
Created attachment 326169 [details] Subtracts the start of the extended partition from the overall volume offset. Patch mentioned in description.
*** Bug 479116 has been marked as a duplicate of this bug. ***
Is there any improvements about how to fix this bug ? Because this is really weird that it was working previously without the patch !!! Or the problem might be elsewhere ?
I think this use to work in previous versions of kpartx because all dm-linear devices use to sit on top of the same device. In this version only primary partitions sit on top of the base device and extended partitions sit on top of the appropriate partition.
This patch is still needed in current rawhide ! Any chances of it to be fixed by the F-11 beta ?
Ok, that's apparently serious problem, I'll fix that in rawhide.
Created attachment 334287 [details] Proposed patch (patch from Hannes who originally added that code to kpartx - not sure why it is missing there)
Fixed in device-mapper-multipath-0.4.8-9.fc11 build.