User Tools

Site Tools


linux:linux_error_lvm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux:linux_error_lvm [2021/01/01 21:25]
127.0.0.1 external edit
linux:linux_error_lvm [2024/05/16 23:56] (current)
manu
Line 37: Line 37:
   systemctl show dev-mapper-vg_ispd1arc.lv_ispd1arc.device   systemctl show dev-mapper-vg_ispd1arc.lv_ispd1arc.device
   systemctl show dev-mapper-vg_ispd1arc   systemctl show dev-mapper-vg_ispd1arc
 +  ​
 +===== Recovering Physical Volume Metadata =====
 +
 +Symptom:
 +<cli prompt='#'>​
 +[root@lnx001] ~ # pvs
 +  PV         ​VG ​     Fmt  Attr PSize    PFree
 +  /​dev/​sda2 ​ vg_root lvm2 a--   <​49.51g <25.26g
 +  [unknown] ​ vg_root lvm2 a--   <​49.51g <25.26g
 +</​cli>​
 +
 +The VG is not active
 +
 +You should not attempt this procedure with a working LVM logical volume. You will lose your data if you specify the incorrect UUID.
 +
 +<cli prompt='#'>​
 +[root@lnx001] ~ # vgchange -an --partial
 +Partial mode. Incomplete volume groups will be activated read-only.
 +  Couldn'​t find device with uuid '​FmGRh3-zhok-iVI8-7qTD-S5BI-MAEN-NYM5Sk'​.
 +  Couldn'​t find device with uuid '​FmGRh3-zhok-iVI8-7qTD-S5BI-MAEN-NYM5Sk'​.
 +</​cli>​
 +
 +Restore the PVID on disk partition ​
 +<cli prompt='#'>​
 +[root@lnx001] ~ # pvcreate --uuid "​FmGRh3-zhok-iVI8-7qTD-S5BI-MAEN-NYM5Sk"​ --restorefile /​etc/​lvm/​archive/​vg_root_00050.vg /dev/sda3
 +  Physical volume "/​dev/​sda3"​ successfully created
 +</​cli>  ​
 +
 +Restore the VG
 +<cli prompt='#'>​
 +[root@lnx001] ~ # vgcfgrestore vg_root
 +  Restored volume group vg_root
 +</​cli>​
 +
 +List the LVs
 +<cli prompt='#'>​
 +[root@lnx001] ~ # lvs -a -o +devices
 +  LV              VG      Attr       ​LSize ​   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices
 +  lv_home ​        ​vg_root -wi------- ​   2.00g                                                     /​dev/​sda2(3712)
 +  lv_opt ​         vg_root -wi------- ​ 512.00m ​                                                    /​dev/​sda3(1536)
 +  lv_opt_tivoli ​  ​vg_root -wi------- ​   2.00g                                                     /​dev/​sda3(1024)
 +</​cli>​
 +
 +Activate the LVs
 +<cli prompt='#'>​
 +[root@lnx001] ~ # lvchange -ay /​dev/​vg_root/​lv_home ​
 +[root@lnx001] ~ # lvs -a -o +devices
 +  LV              VG      Attr       ​LSize ​   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices
 +  lv_home ​        ​vg_root -wi-a----- ​   2.00g                                                     /​dev/​sda2(3712)
 +  lv_opt ​         vg_root -wi------- ​ 512.00m ​                                                    /​dev/​sda3(1536)
 +  lv_opt_tivoli ​  ​vg_root -wi------- ​   2.00g                                                     /​dev/​sda3(1024)
 +</​cli>​
 +
 +===== Recovering Volume Group Metadata =====
 +
 +Restore VG metadata
 +<cli prompt='#'>​
 +# vgcfgrestore VG
 +  Restored volume group VG
 +</​cli>​
 +
 +Assign a random UUID to VG
 +<cli prompt='#'>​
 +# vgchange -an vg-name
 +# vgchange --uuid <​vg-name>​
 +# vgchange -an vg-name
 +</​cli>  ​
 +
 +
linux/linux_error_lvm.1609532711.txt.gz · Last modified: 2021/01/01 21:25 by 127.0.0.1