← Back to team overview

kernel-packages team mailing list archive

[Bug 1271205] Re: kpartx / device-mapper errors on small disk

 

** Summary changed:

- can't kpartx qcow2 cirros 0.3.1
+ kpartx / device-mapper errors on small disk

** Description changed:

  $ wget http://download.cirros-
  cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img
  
  $ sudo qemu-nbd -c /dev/nbd7 cirros-0.3.2-x86_64-disk.img
  $ sudo kpartx -av /dev/nbd7
  
  gives:
  
  device-mapper: resume ioctl on nbd7p1 failed: Invalid argument
  create/reload failed on nbd7p1
  add map nbd7p1 (0:0): 0 64260 linear /dev/nbd7 16065
  
  dmesg adds:
  
  [80163.572187] bio: create slab <bio-1> at 1
  [80163.572258] device-mapper: table: 253:0: nbd7 too small for target: start=16065, len=64260, dev_size=80324
  
  using fdisk on /dev/nbd7 gives
  
  Command (m for help): v
  Partitions 1: cylinder 5 greater than maximum 4
  Remaining 16063 unallocated 512-byte sectors
- 
- it looks like the partition table is not 100% proper?

** Description changed:

- $ wget http://download.cirros-
- cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img
+ 
+ This was originally opened as a cirros bug, but seems generic to kpartx or device-mapper.  I suspect device-mapper.
+ 
+ Independent of cirros, recreate is like this:
+  $ sudo modprobe nbd
+  $ rm -f my.img
+  $ truncate --size $((16065*5*512)) my.img
+  $ echo "16065,," | sfdisk -uS my.img
+  $ fdisk -l my.img
+    ...
+   
+  $ sudo qemu-nbd --connect /dev/nbd7 "$PWD/my.img"
+  $ sudo kpartx -av /dev/nbd7
+  $ sudo kpartx -av /dev/nbd7
+   device-mapper: resume ioctl on nbd7p1 failed: Invalid argument
+   create/reload failed on nbd7p1
+   add map nbd7p1 (0:0): 0 64260 linear /dev/nbd7 16065
+  $ dmesg | tail
+  [1281945.659640] nbd7: p1 size 64260 extends beyond EOD, truncated
+  [1281964.528483] device-mapper: table: 252:0: nbd7 too small for target:  start=16065, len=64260, dev_size=80324
+ 
+ 
+ wrt cirros, the reproduce looks like this:
+ $ wget http://download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img
  
  $ sudo qemu-nbd -c /dev/nbd7 cirros-0.3.2-x86_64-disk.img
  $ sudo kpartx -av /dev/nbd7
  
  gives:
  
  device-mapper: resume ioctl on nbd7p1 failed: Invalid argument
  create/reload failed on nbd7p1
  add map nbd7p1 (0:0): 0 64260 linear /dev/nbd7 16065
  
  dmesg adds:
  
  [80163.572187] bio: create slab <bio-1> at 1
  [80163.572258] device-mapper: table: 253:0: nbd7 too small for target: start=16065, len=64260, dev_size=80324
  
  using fdisk on /dev/nbd7 gives
  
  Command (m for help): v
  Partitions 1: cylinder 5 greater than maximum 4
  Remaining 16063 unallocated 512-byte sectors

** Also affects: linux (Ubuntu)
   Importance: Undecided
       Status: New

** No longer affects: cirros

** Changed in: linux (Ubuntu)
       Status: New => Confirmed

** Changed in: linux (Ubuntu)
   Importance: Undecided => Low

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1271205

Title:
  kpartx / device-mapper errors on small disk

Status in “linux” package in Ubuntu:
  Confirmed

Bug description:
  
  This was originally opened as a cirros bug, but seems generic to kpartx or device-mapper.  I suspect device-mapper.

  Independent of cirros, recreate is like this:
   $ sudo modprobe nbd
   $ rm -f my.img
   $ truncate --size $((16065*5*512)) my.img
   $ echo "16065,," | sfdisk -uS my.img
   $ fdisk -l my.img
     ...
    
   $ sudo qemu-nbd --connect /dev/nbd7 "$PWD/my.img"
   $ sudo kpartx -av /dev/nbd7
   $ sudo kpartx -av /dev/nbd7
    device-mapper: resume ioctl on nbd7p1 failed: Invalid argument
    create/reload failed on nbd7p1
    add map nbd7p1 (0:0): 0 64260 linear /dev/nbd7 16065
   $ dmesg | tail
   [1281945.659640] nbd7: p1 size 64260 extends beyond EOD, truncated
   [1281964.528483] device-mapper: table: 252:0: nbd7 too small for target:  start=16065, len=64260, dev_size=80324

  
  wrt cirros, the reproduce looks like this:
  $ wget http://download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img

  $ sudo qemu-nbd -c /dev/nbd7 cirros-0.3.2-x86_64-disk.img
  $ sudo kpartx -av /dev/nbd7

  gives:

  device-mapper: resume ioctl on nbd7p1 failed: Invalid argument
  create/reload failed on nbd7p1
  add map nbd7p1 (0:0): 0 64260 linear /dev/nbd7 16065

  dmesg adds:

  [80163.572187] bio: create slab <bio-1> at 1
  [80163.572258] device-mapper: table: 253:0: nbd7 too small for target: start=16065, len=64260, dev_size=80324

  using fdisk on /dev/nbd7 gives

  Command (m for help): v
  Partitions 1: cylinder 5 greater than maximum 4
  Remaining 16063 unallocated 512-byte sectors

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1271205/+subscriptions