0

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 ~]#
  • 2
    @JeffJose if you use whole with lvm you don't have any reason to use partition. – c4f4t0r May 20 '18 at 10:36
  • The tests I am doing is on test server and on actual production server, there are so many block devices that make up the volume group. Only for one disk, customer has added disk as raw device initially, then removed disk from volume group and then he created partition and added that to volume group. – Jeff Jose May 20 '18 at 14:50
0

I reduced the PV size lesser, 1MB i lessened.

[root@testpaul ~]# pvresize --setphysicalvolumesize 10239M /dev/vdc1

Device /dev/vdc1 has size of 20971377 sectors which is smaller than corresponding PV size of 20971520 sectors. Was device resized?..... Physical volume "/dev/vdc1" changed 1 physical volume(s) resized / 0 physical volume(s) not resized

[root@testpaul ~]# vgcfgrestore vg0

Restored volume group vg0

[root@testpaul ~]# pvs

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.