"There are # physical volumes missing" - error in pvscan even when the PVs are present
The Problem
The output of pvscan command shows ‘There are # physical volumes missing’, but these physical volumes indeed exist and work well.
# pvscan -v -d
WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it!
Using physical volume(s) on command line.
Wiping cache of LVM-capable devices
Wiping internal VG cache
There are 3 physical volumes missing. <<----
WARNING: Device mismatch detected for VGExaDb/LVDbSys1 which is accessing /dev/xvda2, /dev/xvde1 instead of (null).
WARNING: Device mismatch detected for VGExaDb/LVDbSys2 which is accessing /dev/xvdd1, /dev/xvde1 instead of (null).
WARNING: Device mismatch detected for VGExaDb/LVDbOra1 which is accessing /dev/xvdd1 instead of (null).
WARNING: Device mismatch detected for VGExaDb/LVDbSwap1 which is accessing /dev/xvdd1 instead of (null).
WARNING: Device mismatch detected for VGExaDb/LVDoNotRemoveOrUse which is accessing /dev/xvdd1 instead of (null).
WARNING: Device mismatch detected for VGExaDb/LVDbVdR2D201VM04DBFSC4 which is accessing /dev/xvda2 instead of (null).
There are 3 physical volumes missing. <<----
PV /dev/xvda2 VG VGExaDb lvm2 [24.50 GiB / 0 free] <<---- exists
PV /dev/xvdd1 VG VGExaDb lvm2 [62.00 GiB / 0 free] <<---- exists
PV /dev/xvde1 VG VGExaDb lvm2 [96.00 GiB / 23.36 GiB free] <<---- exists
PV /dev/xvdf VG VGExaDb lvm2 [150.00 GiB / 20.00 GiB free]
Total: 4 [332.48 GiB] / in use: 4 [332.48 GiB] / in no VG: 0 [0 ]
# ls /dev/xvd*
... /dev/xvda2 ... /dev/xvdd1 ... /dev/xvde1 /dev/xvdf ...
The Solution
The ‘flags’ parameter is wrongly shown as ‘MISSING’ for the three PVs in file: /etc/lvm/backup/VGExaDb
--snippet--
physical_volumes {
pv0 {
...
device = "/dev/xvda2" # Hint only
status = ["ALLOCATABLE"]
flags = ["MISSING"] <<----
...
}
pv1 {
...
device = "/dev/xvdd1" # Hint only
status = ["ALLOCATABLE"]
flags = ["MISSING"] <<----
...
}
pv2 {
...
device = "/dev/xvde1" # Hint only
status = ["ALLOCATABLE"]
flags = ["MISSING"] <<----
...
}
pv3 {
...
device = "/dev/xvdf" # Hint only
status = ["ALLOCATABLE"]
flags = []
...
}
}
Follow the stpes outlined below in order to resolve the issue:
1. Schedule a downtime window to boot the server under rescue mode.
2. Backup the file ‘/etc/lvm/backup/VGExaDb’:
# vgcfgbackup -f VGExaDb.old -v VGExaDb
3. Change the following parameter for pv0/ pv1/ pv2 in file ‘/etc/lvm/backup/VGExaDb.old’
From:
flags = ["MISSING"]
To:
flags = []
4. Execute the commands below
# vgcfgrestore -f VGExaDb.old -v VGExaDb
# vgchange -a y VGExaDb
5. Reboot the server:
# shutdown -r now