Bug#780142: kpartx fails with error device-mapper: resume ioctl on loop0p1 failed: Invalid argument

Ritesh Raj Sarraf rrs at researchut.com
Tue Mar 10 17:48:01 UTC 2015


On Monday 09 March 2015 10:47 PM, Carlos Alberto Lopez Perez wrote:
> Package: kpartx
> Version: 0.5.0-6
> Severity: important
>
>
> Hi,
>
> kpartx fails to map the following image file:
>
> # Note: download is ~1GB zip that gives an uncompressed ~8GB image.
> $ wget http://download.udoo.org/files/UDOO_Quad/Yocto_img/udoo_quad_revC_yocto_090713.zip
> [...]
>
> $ sha1sum udoo_quad_revC_yocto_090713.zip
> c79c6961a37eed320fdf9843f69500558c86fc58  udoo_quad_revC_yocto_090713.zip
>
> $ unzip udoo_quad_revC_yocto_090713.zip 
> Archive:  udoo_quad_revC_yocto_090713.zip
>   inflating: udoo_quad_revC_yocto_09072013.img  
>
> $ ls -sh udoo_quad_revC_yocto_09072013.img 
> 7.4G udoo_quad_revC_yocto_09072013.img
>
> $ sha1sum udoo_quad_revC_yocto_09072013.img 
> dd5ddd6d1676d49e69ad9d5613dd2dfa84e96868  udoo_quad_revC_yocto_09072013.img
>
> $ file udoo_quad_revC_yocto_09072013.img 
> udoo_quad_revC_yocto_09072013.img: ; partition 1 : ID=0x83, start-CHS (0x1,70,6), end-CHS (0x3c6,177,43), startsector 20480, 15509504 sectors
>
>
> $ sudo kpartx -av udoo_quad_revC_yocto_09072013.img 
> device-mapper: resume ioctl on loop0p1 failed: Invalid argument
> create/reload failed on loop0p1
> add map loop0p1 (0:0): 0 15509504 linear /dev/loop0 20480
>
> And on /var/log/kern.log it appears:
> kernel: [728695.658845] device-mapper: table: 253:7: loop0 too small for target: start=20480, len=15509504, dev_size=15407104

I guess the kernel is confused with the image here.  Because ideally,
shouldn't dev_size be greater than start alignment + len ???

>
> $ sudo fdisk -l /dev/loop0
>
> Disk /dev/loop0: 7.4 GiB, 7888437248 bytes, 15407104 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disklabel type: dos
> Disk identifier: 0x000032bb
>
> Device       Boot Start      End  Sectors  Size Id Type
> /dev/loop0p1      20480 15529983 15509504  7.4G 83 Linux
>
>
> And there is no /dev/loop0p1 or /dev/mapper/loop0p1 anywhere.
>
> kpartx works for me fine with another images, so maybe there
> is something in this image that makes it fail?

I guess so. It worked fine in my local test.

rrs at swastik:~$ ls /dev/mapper/
control  LocalCrypt-ROOT@  LocalCrypt-SWAP@  loop0p1@  sda7_crypt@
23:13 ♒♒♒   ☺   

> BTW: I don't have multipath-tools installed.
>
I don't think that should matter.

-- 
Ritesh Raj Sarraf
RESEARCHUT - http://www.researchut.com
"Necessity is the mother of invention."

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-lvm-maintainers/attachments/20150310/7f818937/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-lvm-maintainers/attachments/20150310/7f818937/attachment.sig>


More information about the pkg-lvm-maintainers mailing list