Bug#529876: lvm2: pvmove lost my full lv (bad interaction with kvm ?)

Vincent Danjean vdanjean at debian.org
Thu May 21 23:49:09 UTC 2009


Package: lvm2
Version: 2.02.44-3
Severity: important

  Hi,

  I had a VG (aya) on two PV (sda2 and sdd1) that I want to move to another
disk. So I create a new PV on hdb3, add it in VG aya and then I use pvmove.
the sda2 PV only contained one LV (aya/root, the root fs of the machine) and
sdd1 PV only contained one LV (aya/kvms mounted in /srv/kvm). Both LV had a
ext3 filesystem.

  The first pvmove was successful but the second destroyed my aya/kvms LV.
More exactely, the LV has been moved to the new PV (hdb3) but only the
allocation (not the data). So the "moved" aya/kvms LV did not contain a working
ext3 filesystem.

  The only difference I can think between the LV aya/root and aya/kvms is that
aya/kvms had disk images for currently running kvm virtual machines (two plain
files). After the pvmove, the virtual machines exhibit some IO error and later
the host freeze. I rebooted the host. On reboot, /srv/kvms cannot be mounted
(no filesystem dectected on /dev/aya/kvms).

  I workaround by dumping /dev/sdd1 in a file and loop-mounting my old kvms
partition (with several try to find the correct offset, ie 196608 in my case)
I can tell now that I had big stress during this operation...

  It is possible the it is impossible to move PV when kvm is using some part of
it. However, destroying the data is not an option: pvmove must abort
gracefully.

  Regards,
    Vincent

Here is the command I type (I had them because I was working in a terminal with ssh on another computer)

aya:/mnt# pvmove -v -i 10  /dev/sda2 /dev/hdb3 
    Finding volume group "aya"
    Archiving volume group "aya" metadata (seqno 6).
    Creating logical volume pvmove0
    Moving 2263 extents of logical volume aya/root
    Found volume group "aya"
    Updating volume group metadata
    Creating volume group backup "/etc/lvm/backup/aya" (seqno 7).
    Found volume group "aya"
    Found volume group "aya"
    Suspending aya-root (253:0) with device flush
    Found volume group "aya"
    Creating aya-pvmove0
    Loading aya-pvmove0 table
    Resuming aya-pvmove0 (253:6)
    Found volume group "aya"
    Loading aya-pvmove0 table
    Suppressed aya-pvmove0 identical table reload.
    Loading aya-root table
    Resuming aya-root (253:0)
    Checking progress every 10 seconds
  /dev/sda2: Moved: 6,5%
  /dev/sda2: Moved: 12,9%
  /dev/sda2: Moved: 17,9%
  /dev/sda2: Moved: 23,7%
  /dev/sda2: Moved: 30,2%
  /dev/sda2: Moved: 36,7%
  /dev/sda2: Moved: 43,2%
  /dev/sda2: Moved: 49,7%
  /dev/sda2: Moved: 56,2%
  /dev/sda2: Moved: 62,6%
  /dev/sda2: Moved: 69,1%
  /dev/sda2: Moved: 75,7%
  /dev/sda2: Moved: 82,1%
  /dev/sda2: Moved: 88,6%
  /dev/sda2: Moved: 95,2%
  /dev/sda2: Moved: 100,0%
    Found volume group "aya"
    Found volume group "aya"
    Loading aya-root table
    Suspending aya-root (253:0) with device flush
    Suspending aya-pvmove0 (253:6) with device flush
    Found volume group "aya"
    Found volume group "aya"
    Found volume group "aya"
    Resuming aya-pvmove0 (253:6)
    Found volume group "aya"
    Resuming aya-root (253:0)
    Found volume group "aya"
    Found volume group "aya"
    Removing temporary pvmove LV
    Writing out final volume group after pvmove
    Creating volume group backup "/etc/lvm/backup/aya" (seqno 9).
aya:/mnt# pvdisplay 
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               aya
  PV Size               8,84 GB / not usable 257,00 KB
  Allocatable           yes 
  PE Size (KByte)       4096
  Total PE              2263
  Free PE               2263
  Allocated PE          0
  PV UUID               HWPFiQ-rEvJ-7cwt-l8NQ-TSNM-k48H-M2d3aF
   
  --- Physical volume ---
  PV Name               /dev/sdd1
  VG Name               aya
  PV Size               9,32 GB / not usable 2,56 MB
  Allocatable           yes (but full)
  PE Size (KByte)       4096
  Total PE              2384
  Free PE               0
  Allocated PE          2384
  PV UUID               LqycU5-wKyw-hrfz-ZnBW-P3y3-jzKM-aTO2ry
   
  --- Physical volume ---
  PV Name               /dev/hdb3
  VG Name               aya
  PV Size               269,96 GB / not usable 2,80 MB
  Allocatable           yes 
  PE Size (KByte)       4096
  Total PE              69109
  Free PE               66846
  Allocated PE          2263
  PV UUID               XJ5ZDb-KeeH-rAq2-unjK-WgjW-qpT1-wLooFb
   
aya:/mnt# pvmove -v -i 10  /dev/sdd1 /dev/hdb3 
    Finding volume group "aya"
    Archiving volume group "aya" metadata (seqno 9).
    Creating logical volume pvmove0
    Moving 2384 extents of logical volume aya/kvms
    Found volume group "aya"
    Updating volume group metadata
    Creating volume group backup "/etc/lvm/backup/aya" (seqno 10).
    Found volume group "aya"
    Found volume group "aya"
    Suspending aya-kvms (253:1) with device flush
    Found volume group "aya"
    Found volume group "aya"
    Creating aya-pvmove0
  device-mapper: create ioctl failed: Périphérique ou ressource occupé
    Loading aya-kvms table
  device-mapper: reload ioctl failed: Argument invalide
    Checking progress every 10 seconds
  WARNING: dev_open(/dev/sdd1) called while suspended
  WARNING: dev_open(/dev/sda2) called while suspended
  WARNING: dev_open(/dev/hdb3) called while suspended
  WARNING: dev_open(/dev/sdd1) called while suspended
  WARNING: dev_open(/dev/sda2) called while suspended
  WARNING: dev_open(/dev/hdb3) called while suspended
  WARNING: dev_open(/dev/sdd1) called while suspended
  WARNING: dev_open(/dev/sda2) called while suspended
  WARNING: dev_open(/dev/hdb3) called while suspended
  /dev/sdd1: Moved: 100,0%
    Found volume group "aya"
    Found volume group "aya"
    Found volume group "aya"
    Found volume group "aya"
    Suspending aya-pvmove0 (253:6) with device flush
    Found volume group "aya"
    Creating aya-pvmove0
  device-mapper: create ioctl failed: Périphérique ou ressource occupé
  Unable to reactivate logical volume "pvmove0"
    Found volume group "aya"
    Loading aya-kvms table
    Resuming aya-kvms (253:1)
    Found volume group "aya"
    Removing aya-pvmove0 (253:6)
    Found volume group "aya"
    Removing temporary pvmove LV
    Writing out final volume group after pvmove
    Creating volume group backup "/etc/lvm/backup/aya" (seqno 12).

aya:/mnt# pvdisplay 
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               aya
  PV Size               8,84 GB / not usable 257,00 KB
  Allocatable           yes 
  PE Size (KByte)       4096
  Total PE              2263
  Free PE               2263
  Allocated PE          0
  PV UUID               HWPFiQ-rEvJ-7cwt-l8NQ-TSNM-k48H-M2d3aF
   
  --- Physical volume ---
  PV Name               /dev/sdd1
  VG Name               aya
  PV Size               9,32 GB / not usable 2,56 MB
  Allocatable           yes 
  PE Size (KByte)       4096
  Total PE              2384
  Free PE               2384
  Allocated PE          0
  PV UUID               LqycU5-wKyw-hrfz-ZnBW-P3y3-jzKM-aTO2ry
   
  --- Physical volume ---
  PV Name               /dev/hdb3
  VG Name               aya
  PV Size               269,96 GB / not usable 2,80 MB
  Allocatable           yes 
  PE Size (KByte)       4096
  Total PE              69109
  Free PE               64462
  Allocated PE          4647
  PV UUID               XJ5ZDb-KeeH-rAq2-unjK-WgjW-qpT1-wLooFb
   
aya:/mnt# vgreduce aya /dev/sda2
  Removed "/dev/sda2" from volume group "aya"
aya:/mnt# pvremove  /dev/sda2
  Labels on physical volume "/dev/sda2" successfully wiped
aya:/mnt# pvdisplay 
  --- Physical volume ---
  PV Name               /dev/sdd1
  VG Name               aya
  PV Size               9,32 GB / not usable 2,56 MB
  Allocatable           yes 
  PE Size (KByte)       4096
  Total PE              2384
  Free PE               2384
  Allocated PE          0
  PV UUID               LqycU5-wKyw-hrfz-ZnBW-P3y3-jzKM-aTO2ry
   
  --- Physical volume ---
  PV Name               /dev/hdb3
  VG Name               aya
  PV Size               269,96 GB / not usable 2,80 MB
  Allocatable           yes 
  PE Size (KByte)       4096
  Total PE              69109
  Free PE               64462
  Allocated PE          4647
  PV UUID               XJ5ZDb-KeeH-rAq2-unjK-WgjW-qpT1-wLooFb
   
aya:/mnt# pvdisplay -m
  --- Physical volume ---
  PV Name               /dev/sdd1
  VG Name               aya
  PV Size               9,32 GB / not usable 2,56 MB
  Allocatable           yes 
  PE Size (KByte)       4096
  Total PE              2384
  Free PE               2384
  Allocated PE          0
  PV UUID               LqycU5-wKyw-hrfz-ZnBW-P3y3-jzKM-aTO2ry
   
  --- Physical Segments ---
  Physical extent 0 to 2383:
    FREE
   
  --- Physical volume ---
  PV Name               /dev/hdb3
  VG Name               aya
  PV Size               269,96 GB / not usable 2,80 MB
  Allocatable           yes 
  PE Size (KByte)       4096
  Total PE              69109
  Free PE               64462
  Allocated PE          4647
  PV UUID               XJ5ZDb-KeeH-rAq2-unjK-WgjW-qpT1-wLooFb
   
  --- Physical Segments ---
  Physical extent 0 to 2262:
    Logical volume	/dev/aya/root
    Logical extents	0 to 2262
  Physical extent 2263 to 4646:
    Logical volume	/dev/aya/kvms
    Logical extents	0 to 2383
  Physical extent 4647 to 69108:
    FREE
   




-- System Information:
Debian Release: squeeze/sid
  APT prefers oldstable
  APT policy: (500, 'oldstable'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.29-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages lvm2 depends on:
ii  libc6                        2.9-12      GNU C Library: Shared libraries
ii  libdevmapper1.02.1           2:1.02.30-3 The Linux Kernel Device Mapper use
ii  libreadline5                 5.2-4       GNU readline and history libraries
ii  lsb-base                     3.2-22      Linux Standard Base 3.2 init scrip

Versions of packages lvm2 recommends:
ii  dmsetup                      2:1.02.30-3 The Linux Kernel Device Mapper use

lvm2 suggests no packages.

-- no debconf information





More information about the pkg-lvm-maintainers mailing list