My idea was to simulate such situation on VirtualBox as: some crash happened with my hard disk drive, but I had had LVM and it was not a big deal to restore data using it. My steps were:
step1: initialization of disks:
pvcreate /dev/sdb
pvcreate /dev/sdc
pvcrete /dev/sdd
step2: Creation of physical volume group:
vgcreate vg1 /dev/sdb /dev/sdc /dev/sdd
step3: Creation of a logical volume with mirror:
lvcreate -L 1.5G -m2 -n mir vg1
step4: Creation of mount point for mir logical volume
sudo mkdir mnt/mir
sudo mkfs.ext4 /dev/vg1/mir
step5: Then I add entry about mir to the /etc/fstab
step6: Mounting of a mir:
mount -t ext4 /dev/vg1/mir /mnt/mir
step7: Then I shut down my VirtualBox and deleted /dev/sdd
step8: Found out which of these disks were missing
lvscan
step9: Looked for the last archive in lvm:
ls -l /etc/lvm/archive/vg1*
step10: Found out the missing ID:
less /etc/lvm/archive/vg1_00003-1776947519
The output was: BgR0KJ-JClh-T2gS-k6yK-9RGn-B8Ls-LYPQP0
step11: I tried to restore physical volume using this command:
pvcreate -ff --uuid "BgR0KJ-JClh-T2gS-k6yK-9RGn-B8Ls-LYPQP0" --restorefile /etc/lvm/archive/vg1_00003-1776947519.vg /dev/sdd
step12: Restoration of the group and sudden failure at the end:
vgcfgrestore -f /etc/lvm/archive/vg1_00003-1776947519.vg vg1
After pressing Enter key I got this:
Couldn't find device with uuid kgH6Qb-0Ao3-oZ1Q-HKrz-2FWk-GLez-meCjLU
PV unknown device missing from cache
Format-specific setup for unknown device failed
Restore failed
So another one uuid disappeared. At this point I just stuck and have not known what to do till now. So the question is to find solution to restore physical group, logical group and data from disk which was deleted from VirtualBox. I would really appreciate for any proposes.