Using the command 'vgcfgrestore' we can recover deleted LVM partitions. Linux keeps the backup copies of lvm configuration in the/etc/lvm/archive directory. In my scenario I have deleted 10GB lvm partition, follow the below steps to recover the LVM partition :
Step 1: Find the backed up configurations of your Volume Group
# vgcfgrestore --list < Volume-Group-Name >
# vgcfgrestore --list my-vg
In the above example the correct configuration are backed up , in my case “my-vg_00002-692643462.vg” is correct file through which I will recover my lvm partitions.Also notice the Description. If the lvmremove command was the last executed command then you stand a chance.
Step 2: Recover the LVM Partition using the command vgcfgrestore and the archinve file.
# vgcfgrestore -f /etc/lvm/archive/
To find out your volume group name, use the command vgs # vgcfgrestore -f /etc/lvm/archive/my-vg_00002-692643462.vg my-vg
The output should read "Restored volume group"Step 3: Make the recovered LVM active.
You must make the recovered partition active. Do this with the following command.
# lvchange -a y /dev/vg_VolumeGroupName/lv_logicalVolumeName
That should be all that is required to recover a deleted Logical Volume.