Score:1

cannot remove pv from lvm config when disk unavailable

ng flag

I have a vm with 2 disk and 2 VG, on of the disk is a PV (no partition). OS is CentOS 7. Now the disk is unavailable. The PVS displays:

# 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

The VG consist of only this disk, no other pv in this vg. Tried to remove 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!

Tried to add a loop device to write metadata:

# 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

The /dev/loop0 PV was created but not attached to 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

What to do now? How can I remove vgbackup from the lvm config? Reboot is not an option now.

Thank you for your help!

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.