neděle 19. února 2023

LVM - recovery of a temporarily failed disk/PV, missing PV

https://www.golinuxcloud.com/recover-lvm2-partition-restore-vg-pv-metadata/#Step_2_Restore_PV_Physical_Volume_in_Linux

 

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/4/html/cluster_logical_volume_manager/mdatarecover


https://serverfault.com/questions/788202/locked-lvm-logical-volume-in-vg-with-missing-pv

Similar to Can't remove volume group, solved this problem by creating a temporary pv with the same uuid:

UUID="RQr0HS-17ts-1k6Y-Xnex-IZwi-Y2kM-vCc5mP"  # from question
dd if=/dev/zero of=/tmp/tmp.raw bs=1M count=100 
losetup -f
losetup /dev/loop0 /tmp/tmp.raw
pvcreate --norestorefile -u $UUID /dev/loop0   # it has arisen!
killall lvmetad      # so it stops complaining about duplicate uuids (dulezite)
pvremove /dev/loop0  # a clean removal 
losetup -D
pvscan --cache       # to restart lvmetad


https://serverfault.com/questions/894410/cant-remove-volume-group

You cannot use --removemissing or force delete VG if metadata area equal zero as in my case.

Make block device from file and include in $VG:

dd if=/dev/zero of=/tmp/tmp.raw bs=1M count=100
losetup -f
losetup /dev/loop0 /tmp/tmp.raw
vgextend $VG /dev/loop0

After that I have Metadata Areas 1

vgremove --force $VG

and remove pvdevice:

pvremove /dev/loop0

Žádné komentáře:

Okomentovat