當磁碟不可用時,無法從 lvm 配置中刪除 pv

當磁碟不可用時,無法從 lvm 配置中刪除 pv

我有一個有 2 個磁碟和 2 個 VG 的虛擬機,其中一個磁碟是一個 PV(無分割區)。作業系統是CentOS 7。 PVS 顯示:

# pvs
  WARNING: Device for PV L9Anor-qlzF-mTT7-Rxx0-Ovig-hMQI-OkupZL not found or rejected by a filter.
  WARNING: Device for PV L9Anor-qlzF-mTT7-Rxx0-Ovig-hMQI-OkupZL not found or rejected by a filter.
  WARNING: Device for PV L9Anor-qlzF-mTT7-Rxx0-Ovig-hMQI-OkupZL not found or rejected by a filter.
  Couldn't find device with uuid L9Anor-qlzF-mTT7-Rxx0-Ovig-hMQI-OkupZL.
  PV         VG       Fmt  Attr PSize    PFree  
  ...
  [unknown]  vgbackup lvm2 a-m  <800,00g <30,00g

--- Volume group ---
  VG Name               vgbackup
  System ID             
  Format                lvm2
  Metadata Areas        0
  Metadata Sequence No  5
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                0
  VG Size               <800,00 GiB
  PE Size               4,00 MiB
  Total PE              204799
  Alloc PE / Size       197120 / 770,00 GiB
  Free  PE / Size       7679 / <30,00 GiB
  VG UUID               d2QWd0-eg28-RpRY-RX0h-JV7A-dpJH-jRF71x

VG 僅包含此磁碟,此 vg 中沒有其他 pv。嘗試刪除 pv:

vgremove --force vgbackup 
  WARNING: Device for PV L9Anor-qlzF-mTT7-Rxx0-Ovig-hMQI-OkupZL not found or rejected by a filter.
  Couldn't find device with uuid L9Anor-qlzF-mTT7-Rxx0-Ovig-hMQI-OkupZL.
  Aborting vg_write: No metadata areas to write to!

嘗試新增循環設備來寫入元資料:

# losetup -l
NAME       SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE
/dev/loop0         0      0         0  0 /tmp/tmp.raw

# vgextend vgbackup /dev/loop0
  WARNING: Device for PV L9Anor-qlzF-mTT7-Rxx0-Ovig-hMQI-OkupZL not found or rejected by a filter.
  WARNING: Device for PV L9Anor-qlzF-mTT7-Rxx0-Ovig-hMQI-OkupZL not found or rejected by a filter.
  Couldn't find device with uuid L9Anor-qlzF-mTT7-Rxx0-Ovig-hMQI-OkupZL.
  WARNING: Device for PV L9Anor-qlzF-mTT7-Rxx0-Ovig-hMQI-OkupZL not found or rejected by a filter.
Segmentation fault

/dev/loop0 PV 已建立但未附加至 vgbackup:

# pvs
  WARNING: Device for PV L9Anor-qlzF-mTT7-Rxx0-Ovig-hMQI-OkupZL not found or rejected by a filter.
  WARNING: Device for PV L9Anor-qlzF-mTT7-Rxx0-Ovig-hMQI-OkupZL not found or rejected by a filter.
  WARNING: Device for PV L9Anor-qlzF-mTT7-Rxx0-Ovig-hMQI-OkupZL not found or rejected by a filter.
  Couldn't find device with uuid L9Anor-qlzF-mTT7-Rxx0-Ovig-hMQI-OkupZL.
  PV         VG       Fmt  Attr PSize    PFree  
  /dev/loop0          lvm2 ---   100,00m 100,00m
  /dev/sda2  rootvg   lvm2 a--    58,80g   4,00m
  [unknown]  vgbackup lvm2 a-m  <800,00g <30,00g

現在做什麼?如何從 lvm 配置中刪除 vgbackup?現在無法選擇重新啟動。

感謝您的幫忙!

相關內容