lvm document how to recover pv metadata
PATCH 1/1 lvm document how to recover pv metadata
thanks a lot to roadrunner on #lvm.
belows cmd recovered a partition of mine that i had nuked with mkswap. not much sleep helps to do such nonesense.
added relevant pvcreate to the recipe section with a big fat warning.
--
maks
LVM-HOWTO.xml renamed from LVM-HOWTO.xml.old +30 -0
@@ -4372,6 +4372,36 @@ default=lvm </para> </sect2> </sect1> + <sect1 id="recovermetadata"><title>Recover physical volume metadata</title> + <title>Restore physical volume:</title> + <para> + If you get the warning "incorrect metadata area header checksum" + you probably toasted the volume group descriptor area and lvm + startup can't occur. + </para> + <warning><title>Warning</title> + <para> + Don't do this on a properly working lvm. + First you need to specify the correct physical volume to + <command>pvcreate</command> or you may lose your data. + </para> + </warning> + <para> + Then you need to extract the exact uuid for the relevant partition + (PhysicalVolume of course) from the file + <filename>/etc/lvm/archive/VolumeGroupName_XXXXX.vg</filename>. + (Where XXXXX represents the number of the last known good archived lvm + metadata). <command>pvcreate</command> can restore the metadata: + <command>pvcreate --uuid ".." --restorefile /etc/lvm/archive/VolumeGroupName_XXXXX.vg PhysicalVolume</command> + </para> + <para> + If you are lucky you'll find that the lvm metadata takes on disk + at least so much space than a swap signature. So aboves command + can recover a physical volume from an accidental mkswap. + <command>pvcreate</command> only overwrites the lvm metadata areas + on disk and doesn't touch the data areas (the logical volumes). + </para> + </sect1> </chapter> <appendix id="dangerousops"><title>Dangerous Operations</title>