I had Volume Group /dev/vg1 that consist two physical volumes /dev/sdb1 and /dev/sdc1. One of physical volume /dev/sdc1, corrupted due to disk failure, now the challenge was to recover LVM.

To achieve this use pvremove command as shown:
[root@server~]# pvremove /dev/sdc1

Above command will display an error that it couldn’t find device uuid ‘xxxxxxx’
Now issue following command to do it forcefully.
 [root@server~]# pvremove -ff /dev/sdc1 

After some warning, it will remove that physical volume. Now issue pvdisplay command
[root@server~]# pvdisplay
this will display an error message  ‘ Couldn’t find device with uuid xxxxxx’

Now what you need to do is to create a physical volume with new disk with missing uuid. For this following command can be used:

[root@server~]# pvcreate –uuid=xxxxxx /dev/sdd1 –restorefile=/etc/lvm/archive/vg0_0.vg

 Where /dev/sdd1 is new hard disk in replace of /dev/sdc1.Then restore the vg metadata with following command:

[root@server~]# vgcfgrestore -f /etc/lvm/archive/vg0_0.vg tvg0

Note: check archive of vg in /etc/lvm/archive

Posted in: Linux.
Last Modified: October 23, 2013

Leave a reply