Bug#394333: lvm2: Volume group corruption on internal error during 'lvcreate --mirror 1'

Paul LeoNerd Evans leonerd at leonerd.org.uk
Fri Oct 20 20:28:57 CEST 2006


Package: lvm2
Version: 2.02.06-3
Severity: important

Starting off with a brand new VG:

root at cel:~
# pvcreate /dev/sda2
  Physical volume "/dev/sda2" successfully created
root at cel:~
# pvcreate /dev/sda3
  Physical volume "/dev/sda3" successfully created
root at cel:~
# vgcreate vg /dev/sda2 /dev/sda3
  Volume group "vg" successfully created

We try to make a mirror LV:

root at cel:~
# lvcreate --size 100M --mirrors 1 --name mirrorlv vg
  Not enough PVs with free space available for parallel allocation.
  Consider --alloc anywhere if desperate.

So I try that:

root at cel:~
# lvcreate --size 100M --mirrors 1 --name mirrorlv vg --alloc anywhere
  Insufficient suitable allocatable extents for logical volume : 50 more required

Then I try forcing the two mirror locations:

root at cel:~
# lvcreate --size 100M --mirrors 1 --name mirrorlv vg --alloc anywhere /dev/sda2 /dev/sda3
  Insufficient suitable allocatable extents for logical volume : 50 more required

Then in a final attempt, knowing that really a 2-way mirror wants 3 LVs
(one for the loglv as well), I try forcing that:

root at cel:~
# lvcreate --size 100M --mirrors 1 --name mirrorlv vg --alloc anywhere /dev/sda2 /dev/sda3 /dev/sda3
  Inconsistent length: 1 25
  PV segment pe_alloc_count mismatch: 1 != 26
  PV segment VG free_count mismatch: 47658 != 47633
  Internal error: PV segments corrupted in vg.

Ooops.

At this point the VG seems stable still. But if I attempt it a second time:

root at cel:~
# lvcreate --size 100M --mirrors 1 --name mirrorlv vg --alloc anywhere /dev/sda2 /dev/sda3 /dev/sda3
  LV mirrorlv_mlog invalid: segment 2 should begin at LE 1 (found 0).
  Couldn't read all logical volumes for volume group vg.
  LV mirrorlv_mlog invalid: segment 2 should begin at LE 1 (found 0).
  Couldn't read all logical volumes for volume group vg.
  LV mirrorlv_mlog invalid: segment 2 should begin at LE 1 (found 0).
  Couldn't read all logical volumes for volume group vg.
  LV mirrorlv_mlog invalid: segment 2 should begin at LE 1 (found 0).
  Couldn't read all logical volumes for volume group vg.
  LV mirrorlv_mlog invalid: segment 2 should begin at LE 1 (found 0).
  Couldn't read all logical volumes for volume group vg.
  LV mirrorlv_mlog invalid: segment 2 should begin at LE 1 (found 0).
  Couldn't read all logical volumes for volume group vg.
  LV mirrorlv_mlog invalid: segment 2 should begin at LE 1 (found 0).
  Couldn't read all logical volumes for volume group vg.
  LV mirrorlv_mlog invalid: segment 2 should begin at LE 1 (found 0).
  Couldn't read all logical volumes for volume group vg.
  Volume group for uuid not found: 7GdZGk2PIrCvQ3cFDce2lfw1262UQHyh1ex58nUi9EBWv508q2NhFbwvG90dcMUb
  Aborting. Failed to activate mirror log. Remove new LVs and retry.
  Failed to create mirror log.

root at cel:~
# vgdisplay 
  LV mirrorlv_mlog invalid: segment 2 should begin at LE 1 (found 0).
  Couldn't read all logical volumes for volume group vg.
  LV mirrorlv_mlog invalid: segment 2 should begin at LE 1 (found 0).
  Couldn't read all logical volumes for volume group vg.
  LV mirrorlv_mlog invalid: segment 2 should begin at LE 1 (found 0).
  Couldn't read all logical volumes for volume group vg.
  LV mirrorlv_mlog invalid: segment 2 should begin at LE 1 (found 0).
  Couldn't read all logical volumes for volume group vg.
  Volume group "vg" not found

So far the only way I've found out of this is to vgchange -a n, then remove
and recreate the VG from scratch.

Admittedly [the above] isn't a very usual way of working, but it really
shouldn't irreversablly corrupt the VG like that.

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-mh3.nim
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)

Versions of packages lvm2 depends on:
ii  debconf [debconf-2.0]        1.5.5       Debian configuration management sy
ii  libc6                        2.3.6.ds1-4 GNU C Library: Shared libraries
ii  libdevmapper1.02             2:1.02.08-1 The Linux Kernel Device Mapper use
ii  libncurses5                  5.5-3       Shared libraries for terminal hand
ii  libreadline5                 5.1-7       GNU readline and history libraries
ii  libselinux1                  1.30.28-2   SELinux shared libraries
ii  libsepol1                    1.12.26-2   Security Enhanced Linux policy lib
ii  lvm-common                   1.5.20      The Logical Volume Manager for Lin

lvm2 recommends no packages.

-- debconf information excluded




More information about the pkg-lvm-maintainers mailing list