OS : CentOS6.8
The initial disk was /dev/vdc with which volume group vg0 was mde. Then, this disk was removed from volme group using vgreduce /dev/vdc vg0 which made the LVM metadata inconsistent, showing the PV with uuid not found. New partition /dev/vdc1 was also created.
To restore the LVM metadata, executed following command.
pvcreate --uuid "40sFOW-dBUz-Jb0l-K8ig-puvo-2qIA-xPfLIP" --restorefile /etc/lvm/archive/vg0_00003-615784639.vg /dev/vdc1
Changed the device name from /dev/vdc
to /dev/vdc1.
in file vg0_00003-615784639.vg
and executed above command.
[root@testpaul ~]# ls -lt /etc/lvm/archive/vg0_00003-615784639.vg /etc/lvm/archive/vg0_00002-1466532506.vg
-rw------- 1 root root 1567 May 20 10:24 /etc/lvm/archive/vg0_00003-615784639.vg
-rw------- 1 root root 1324 May 20 10:13 /etc/lvm/archive/vg0_00002-1466532506.vg
[root@testpaul ~]#
[root@testpaul ~]#
[root@testpaul ~]# grep -i device /etc/lvm/archive/{vg0_00003-615784639.vg,vg0_00002-1466532506.vg}
/etc/lvm/archive/vg0_00003-615784639.vg: device = "/dev/vdc1" # Hint only
/etc/lvm/archive/vg0_00003-615784639.vg: device = "/dev/vdd1" # Hint only
/etc/lvm/archive/vg0_00002-1466532506.vg: device = "/dev/vdc" # Hint only
[root@testpaul ~]#
How can I correct below error in pvs command.
[root@testpaul ~]# pvs
Device /dev/vdc1 has size of 20971377 sectors which is smaller than corresponding PV size of 20971520 sectors. Was device resized?
One or more devices used as PVs in VG vg0 have changed sizes.
PV VG Fmt Attr PSize PFree
/dev/vdc1 vg0 lvm2 a--u 10.00g 1020.00m
/dev/vdd1 vg0 lvm2 a--u 10.00g 10.00g
[root@testpaul ~]#
Best Answer
I reduced the PV size lesser, 1MB i lessened.