I am on CentOS 5.5 and am running Xen. I have a large volume group that I create logical volumes on using lvcreate. Today I had a customer cancel her account, then change her mind about an hour later. Unfortunately I had already removed the LVM her Xen image resided on. (just using a standard lvremove ). There has been no other LVM activity on this disk since then (nothing else added or deleted). Is it possible to "undo" a lvremove, or recover logical volume? If so, how would I go about it?
LVM does backup it's metadata to
The following can be dangerous and destructive so be very careful and if possible have a full backup.
The command to restore these volumegroup metadata backups is
The easiest thing to recover from lvremove (assuming you didn't write to the extents the LV was residing in) is:
Just find the backup of your metadata in /etc/lvm/archive and figure out
a) which extents the LV was residing in (EFROM, ETO)
After you have this info you create a new LV of the exactly same size on the exactly same PV extends without wiping the first 8kB of the LV: