Bug#612439: lvconvert --merge breaks Logical Volumes

Marcel Meckel debian at thermoman.de
Tue Feb 8 14:30:35 UTC 2011


Package: lvm2
Version: 2.02.66-5

When i want to restore a logical volume's content from one of it's
snapshots you can use the command:

  lvconvert --merge vg/lv-snap

according to manpage:

  "lvconvert --merge vg00/lvol1_snap"
  merges "vg00/lvol1_snap" into its origin.


Problem:

  Can't expand LV test: snapshot target support missing from kernel?

Reproducible:

  100%

Example:

% dd if=/dev/zero of=/var/tmp/disk bs=1M count=10
% losetup /dev/loop5 /var/tmp/disk
% pvcreate /dev/loop5
  Physical volume "/dev/loop5" successfully created
% vgcreate vg0 /dev/loop5
  Volume group "vg0" successfully created
% lvcreate --name test --extents 1 vg0
  Logical volume "test" created
% lvcreate --snapshot vg0/test -n test-snap --extents 1
  Logical volume "test-snap" created
% md5sum /dev/vg0/test{,-snap}
b5cfa9d6c8febd618f91ac2843d50a1c  /dev/vg0/test
b5cfa9d6c8febd618f91ac2843d50a1c  /dev/vg0/test-snap
% echo "changing-some-stuff" > /dev/vg0/test
% md5sum /dev/vg0/test{,-snap}
0a03546bcdfe5d9f3853c200fffe41f8  /dev/vg0/test
b5cfa9d6c8febd618f91ac2843d50a1c  /dev/vg0/test-snap
% lvs vg0
  LV        VG   Attr   LSize Origin Snap%  Move Log Copy%  Convert
  test      vg0  owi-a- 4.00m                                      
  test-snap vg0  swi-a- 4.00m test     0.29
% lvconvert --merge vg0/test-snap
  Can't expand LV test: snapshot target support missing from kernel?
  Failed to suspend origin test
% lvchange --available n vg0/test
% lvs vg0
  LV        VG   Attr   LSize Origin Snap%  Move Log Copy%  Convert
  test      vg0  owi--- 4.00m                                      
  test-snap vg0  swi--- 4.00m test
% lvconvert --merge vg0/test-snap
  Merging of volume test-snap started.
  Conversion starts after activation.
% lvchange --available y vg0/test
  Can't expand LV test: snapshot target support missing from kernel?
% lvs vg0
  LV   VG   Attr   LSize Origin Snap%  Move Log Copy%  Convert
  test vg0  Owi--- 4.00m

At this point LV ,test' can't be accessed anymore.

*****
* The only solution here is to restore the LVM metadata for this VG
* from /etc/lvm/archive or to recreate the LV with option --zero n
* on the same extends as before (check with lvs -o +seg_pe_ranges).
*****


Expected behaviour:


% lvconvert --merge /dev/vg0/test-snap
  Merging of volume test-snap started.
  test: Merged: 0,1%
  Merge of snapshot into logical volume test has finished.
  Logical volume "test-snap" successfully removed
% md5sum /dev/vg0/test
b5cfa9d6c8febd618f91ac2843d50a1c  /dev/vg0/test


More Info:


% lsmod|grep snap
dm_snapshot            18481  0 
dm_mod                 53754  55 dm_snapshot,dm_mirror,dm_log

% dpkg -l | grep linux-image
ii  linux-image-2.6.32-5-amd64  2.6.32-30
ii  linux-image-amd64           2.6.32+29

% uname -a
Linux han-solo 2.6.32-5-amd64 #1 SMP Wed Jan 12 03:40:32 UTC 2011 x86_64
GNU/Linux





More information about the pkg-lvm-maintainers mailing list