lvm-recovery

What to do if your lvm volume group get damaged by bugs like 81841? This is what happened to me lately. Luckily, I did not loose any data, but had to recover my phisical volume. This is described at http://tldp.org/HOWTO/html_single/LVM-HOWTO/#recovermetadata.

Long story short: Make sure you have a recent backup of /etc/lvm/archive/VolumeGroupName_XXXXX.vg with XXXX being incremented each time you create or remove a logical (snapshot) volume. No you need to issue these commands from e.g. a live cd:

pvcreate --uuid "<some_long_string>" --restorefile /etc/lvm/archive/VolumeGroupName_XXXXX.vg <PhysicalVolume>

Note that if used correctly, this doesn't destroy your physical volume, but only touches the (destroyed) metadata. After this, you most probably need to recover your volume group metadata. This is done with the tool 'vgcfgrestore':

vgcfgrestore --file /etc/lvm/archive/VolumeGroupName_XXXXX.vg --test --verbose -n /dev/$PV

With $PV being your damaged physical volume.

enjoy!

~~DISCUSSION~~

english debian ubuntu