Bug#798431: lvm2: OriginLV lost if CacheLV failed

Benoit Friry benoit at friry.net
Wed Sep 9 09:49:01 UTC 2015


Package: lvm2
Version: 2.02.127-1
Severity: normal

Dear Maintainer,

Context and issue
-----------------
I want to use lvmcache to speedup access to data on RAID1.

Configuration is essentially:
 - 2 HDD in software raid1 with md -> one pv -> one VG
 - 1 SSD (/dev/sda1) is put in same VG
 - 1 of the LV is for /
 - I created a lvm cache for /

It happenned /dev/sda1 failed.  Boot failed.  I booted from Debian Live
CD, but I did not manage to repair.  lvtools and cache_check refused to
repair cmeta LV, and I did not find how to access it to try any manual
repairing.

I had to reinstall/restore. 

Reproduction
------------
sda1 is the only partition on SSD
sde1 is the only partition on a USB key

*** LV creation
# vgcreate vgtest /dev/sda1 /dev/sde1
# lvcreate -n test -L 10G vgtest /dev/sda1
# lvcreate -n testcache -L 1G vgtest /dev/sde1
# lvcreate -n testcachemeta -L 8M vgtest /dev/sde1
# lvconvert --type cache-pool --poolmetadata vgtest/testcachemeta\
	--cachemode writethrough vgtest/testcache
# lvconvert --type cache --cachepool vgtest/testcache vgtest/test

*** LV failure
# lvs -a
# lvchange -an vgtest/test
# pvremove /dev/sde1 --force --force

*** LV recovery tentatives
# lvchange -ay vgtest/test
  WARNING: Device for PV NubIyb-joYP-9Jei-Fhy3-xUuz-5SVf-3NSI0I not found or rejected by a filter.
  Refusing activation of partial LV vgtest/test.  Use '--activationmode partial' to override.
# lvchange -ay vgtest/test --activationmode partial
  PARTIAL MODE. Incomplete logical volumes will be processed.
  WARNING: Device for PV NubIyb-joYP-9Jei-Fhy3-xUuz-5SVf-3NSI0I not found or rejected by a filter.
  Check of pool vgtest/testcache failed (status:1). Manual repair required!
# lvchange -ay vgtest/test_corig --force --activationmode partial
  PARTIAL MODE. Incomplete logical volumes will be processed.
  WARNING: Device for PV NubIyb-joYP-9Jei-Fhy3-xUuz-5SVf-3NSI0I not found or rejected by a filter.
  Unable to change internal LV test_corig directly
# lvconvert -v --force --uncache vgtest/test
  WARNING: Device for PV NubIyb-joYP-9Jei-Fhy3-xUuz-5SVf-3NSI0I not found or rejected by a filter.
    There are 1 physical volumes missing.
  Cannot change VG vgtest while PVs are missing.
  Consider vgreduce --removemissing.
    There are 1 physical volumes missing.
# vgreduce -v --force --removemissing vgtest
   Finding volume group "vgtest"
  WARNING: Device for PV NubIyb-joYP-9Jei-Fhy3-xUuz-5SVf-3NSI0I not found or rejected by a filter.
    There are 1 physical volumes missing.
    There are 1 physical volumes missing.
    Trying to open VG vgtest for recovery...
    Found same device /dev/sda1 with same pvid SFN1I61m6AOWxnMG5YjWvjVpPuQpNLAc
  WARNING: Device for PV NubIyb-joYP-9Jei-Fhy3-xUuz-5SVf-3NSI0I not found or rejected by a filter.
    There are 1 physical volumes missing.
    There are 1 physical volumes missing.
    Archiving volume group "vgtest" metadata (seqno 7).
  Removing partial LV test.
    Releasing logical volume "testcache"
    There are 1 physical volumes missing.
    Creating volume group backup "/etc/lvm/backup/vgtest" (seqno 8).
  Logical volume "testcache" successfully removed
    Releasing logical volume "test"
    There are 1 physical volumes missing.
    Creating volume group backup "/etc/lvm/backup/vgtest" (seqno 9).
  Logical volume "test" successfully removed
    Removing PV with UUID NubIyb-joYP-9Jei-Fhy3-xUuz-5SVf-3NSI0I from VG vgtest
    Creating volume group backup "/etc/lvm/backup/vgtest" (seqno 10).
  Wrote out consistent volume group vgtest

All LV is gone!

Using a cachethrough mode, OriginLV (/dev/sda1) was intact.
There must be some way to access it!


I did not find much clues on Internet. 
Best hit: https://www.redhat.com/archives/linux-lvm/2015-August/msg00008.html


Best regards,
Benoit

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.1.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages lvm2 depends on:
ii  dmeventd                  2:1.02.104-1
ii  dmsetup                   2:1.02.104-1
ii  init-system-helpers       1.23
ii  initscripts               2.88dsf-59.2
ii  libc6                     2.19-19
ii  libdevmapper-event1.02.1  2:1.02.104-1
ii  libdevmapper1.02.1        2:1.02.104-1
ii  liblvm2app2.2             2.02.127-1
ii  libreadline5              5.2+dfsg-3
ii  libudev1                  225-1
ii  lsb-base                  4.1+Debian14

lvm2 recommends no packages.

Versions of packages lvm2 suggests:
ii  thin-provisioning-tools  0.3.2-1

-- no debconf information



More information about the pkg-lvm-maintainers mailing list