删除旧的 LVMS

删除旧的 LVMS

我在 VMWare 上使用 RHEL9,并且正在学习 RHEL 课程并创建 LVM 并在我的 VMWare 中扩展它们。我删除了 VMWare 中多余的磁盘,通过 lsblk 确认它们已消失,添加了新磁盘,然后重新完成了课程中的练习。我注意到,当我运行 pvs、lvs 或 vgs 时,我收到了有关旧磁盘的消息。有谁知道我怎样才能摆脱它们?这是我的输出,如果您有任何疑问,请告诉我。谢谢!

[root@server1 ~]# pvs
  Devices file sys_wwid eui.694d23db39adb5e5000c296f16276b9b PVID UGehCcHnR5Ud32dgjIJ52SGfzW13ht1M last seen on /dev/nvme0n3p1 not found.
  Devices file sys_wwid eui.725f1dc391decc8a000c2968de6d8e2e PVID XF9w40zG2eklRw87ly57qzWapfuJI7ss last seen on /dev/nvme0n5p1 not found.
  Devices file sys_wwid eui.725f1dc391decc8a000c2968de6d8e2e PVID rQ1AhQVfqSYOd7TQ7mrxRMIxyHv0ZYRv last seen on /dev/nvme0n5p2 not found.
  Devices file sys_wwid eui.1980655febb3c392000c29691e59af71 PVID 9lHXG7HskeRNQ05eFJOBCNg68benZ33K last seen on /dev/nvme0n7p1 not found.
  Devices file sys_wwid eui.1980655febb3c392000c29691e59af71 PVID Orz06yF3Q5ODYDSbsm3OTVmwszWordiq last seen on /dev/nvme0n7p2 not found.
  Devices file sys_wwid eui.312757f5a371ce78000c296dd0907eb0 PVID TnGzeNPVwiUODoKU8irccjggtPi4eJcQ last seen on /dev/nvme0n8p1 not found.
  PV             VG      Fmt  Attr PSize    PFree   
  /dev/nvme0n1p2 rhel    lvm2 a--    11.00g    4.00m
  /dev/nvme0n3p1 vgdata  lvm2 a--     1.99g 1016.00m
  /dev/nvme0n4p1 vgfiles lvm2 a--  1020.00m       0 
  /dev/nvme0n4p2 vgfiles lvm2 a--  1020.00m  508.00m
[root@server1 ~]# lvs
  Devices file sys_wwid eui.694d23db39adb5e5000c296f16276b9b PVID UGehCcHnR5Ud32dgjIJ52SGfzW13ht1M last seen on /dev/nvme0n3p1 not found.
  Devices file sys_wwid eui.725f1dc391decc8a000c2968de6d8e2e PVID XF9w40zG2eklRw87ly57qzWapfuJI7ss last seen on /dev/nvme0n5p1 not found.
  Devices file sys_wwid eui.725f1dc391decc8a000c2968de6d8e2e PVID rQ1AhQVfqSYOd7TQ7mrxRMIxyHv0ZYRv last seen on /dev/nvme0n5p2 not found.
  Devices file sys_wwid eui.1980655febb3c392000c29691e59af71 PVID 9lHXG7HskeRNQ05eFJOBCNg68benZ33K last seen on /dev/nvme0n7p1 not found.
  Devices file sys_wwid eui.1980655febb3c392000c29691e59af71 PVID Orz06yF3Q5ODYDSbsm3OTVmwszWordiq last seen on /dev/nvme0n7p2 not found.
  Devices file sys_wwid eui.312757f5a371ce78000c296dd0907eb0 PVID TnGzeNPVwiUODoKU8irccjggtPi4eJcQ last seen on /dev/nvme0n8p1 not found.
  LV      VG      Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root    rhel    -wi-ao---- 10.00g                                                    
  swap    rhel    -wi-ao----  1.00g                                                    
  lvdata  vgdata  -wi-ao----  1.00g                                                    
  lvfiles vgfiles -wi-ao---- <1.50g                                                    
[root@server1 ~]# vgs
  Devices file sys_wwid eui.694d23db39adb5e5000c296f16276b9b PVID UGehCcHnR5Ud32dgjIJ52SGfzW13ht1M last seen on /dev/nvme0n3p1 not found.
  Devices file sys_wwid eui.725f1dc391decc8a000c2968de6d8e2e PVID XF9w40zG2eklRw87ly57qzWapfuJI7ss last seen on /dev/nvme0n5p1 not found.
  Devices file sys_wwid eui.725f1dc391decc8a000c2968de6d8e2e PVID rQ1AhQVfqSYOd7TQ7mrxRMIxyHv0ZYRv last seen on /dev/nvme0n5p2 not found.
  Devices file sys_wwid eui.1980655febb3c392000c29691e59af71 PVID 9lHXG7HskeRNQ05eFJOBCNg68benZ33K last seen on /dev/nvme0n7p1 not found.
  Devices file sys_wwid eui.1980655febb3c392000c29691e59af71 PVID Orz06yF3Q5ODYDSbsm3OTVmwszWordiq last seen on /dev/nvme0n7p2 not found.
  Devices file sys_wwid eui.312757f5a371ce78000c296dd0907eb0 PVID TnGzeNPVwiUODoKU8irccjggtPi4eJcQ last seen on /dev/nvme0n8p1 not found.
  VG      #PV #LV #SN Attr   VSize  VFree   
  rhel      1   2   0 wz--n- 11.00g    4.00m
  vgdata    1   1   0 wz--n-  1.99g 1016.00m
  vgfiles   2   1   0 wz--n-  1.99g  508.00m

答案1

新创建的 LVM PV 现在已添加到/etc/lvm/devices/system.devices配置文件中,并且 LVM 会尝试扫描此处列出的所有设备。通常pvremove会从文件中删除该条目,但由于您直接从 VM 中删除了磁盘而没有先运行pvremove,因此磁盘不会从配置文件中删除,并且 LVM 仍在尝试使用 PV。您需要使用以下命令删除丢失的 PV

lvmdevices --delpvid UGehCcHnR5Ud32dgjIJ52SGfzW13ht1M

(对所有缺失的 PV 重复此操作)。您还可以手动从文件中删除它们。

相关内容