小于相应 PV 大小错误的扇区

小于相应 PV 大小错误的扇区

操作系统:CentOS6.8

初始磁盘是 /dev/vdc,卷组 vg0 与之合并。然后,使用 vgreduce /dev/vdc vg0 从卷组中删除此磁盘,这导致 LVM 元数据不一致,显示未找到具有 uuid 的 PV。还创建了新的分区 /dev/vdc1。

要恢复 LVM 元数据,请执行以下命令。

pvcreate --uuid "40sFOW-dBUz-Jb0l-K8ig-puvo-2qIA-xPfLIP" --restorefile /etc/lvm/archive/vg0_00003-615784639.vg /dev/vdc1

在文件中将设备名称从 更改为/dev/vdc并执行上述命令。/dev/vdc1.vg0_00003-615784639.vg

[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 ~]#  

我该如何纠正 pvs 命令中的以下错误。

[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 ~]#

答案1

我把 PV 大小减小了一点,减少了 1MB。

[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

相关内容