Saturday, February 20, 2010

LVM: How to recover deleted LVM?

Guys,
This could be something very informative for all LVM experts !!

The lvm system maintains backup copies of the lvm configuration in the /etc/lvm/archive folder. I found the backup copy from just before my lvm volume was deleted. By using "vgcfgrestore" and the archive file i was able to restore the lvm configuration as it was before the lvm volume was deleted.

The command:

"vgcfgrestore -l VolGroup00"

shows a list of backed up configurations.

I found that the correct configuration was in the file "/etc/lvm/archive/VolGroup00_00054.vg".

Running "vgcfgrestore -f /etc/lvm/archive/VolGroup00_00054.vg" did the trick.