Duplicate LVM Volume Group Warning

At startup, the vgscan command is run to scan the block devices on the system looking for LVM labels, to determine which of them are physical volumes and to read the metadata and build up a list of volume groups. The names of the physical volumes are stored in the LVM cache file of each node in the system, /etc/lvm/cache/.cache. Subsequent commands may read that file to avoiding rescanning.

The following LVM errors were observed:

# pvs
  WARNING: found device with duplicate /dev/md3
  WARNING: found device with duplicate /dev/sdb3
  WARNING: Disabling lvmetad cache which does not support duplicate PVs.
  WARNING: Scan found duplicate PVs.
  WARNING: Not using lvmetad because cache update failed.
  WARNING: Not using device /dev/md3 for PV XHC1A9-kwD8-k5pO-i8sS-zoiV-RfWP-e8oSUb.
  WARNING: Not using device /dev/sdb3 for PV XHC1A9-kwD8-k5pO-i8sS-zoiV-RfWP-e8oSUb.
  WARNING: PV XHC1A9-kwD8-k5pO-i8sS-zoiV-RfWP-e8oSUb prefers device /dev/sda3 because of previous preference.
  WARNING: PV XHC1A9-kwD8-k5pO-i8sS-zoiV-RfWP-e8oSUb prefers device /dev/sda3 because of previous preference.
  WARNING: Device mismatch detected for vg00/usr which is accessing /dev/md3 instead of /dev/sda3.
  WARNING: Device mismatch detected for vg00/var which is accessing /dev/md3 instead of /dev/sda3.
  WARNING: Device mismatch detected for vg00/home which is accessing /dev/md3 instead of /dev/sda3.
  PV         VG   Fmt  Attr PSize   PFree
  /dev/sda3  vg00 lvm2 a--  925.51g 910.51g

Resolution

To update the LVM filter do the following:

1- Make a Backup of /etc/lvm/lvm.conf

# cp /etc/lvm/lvm.conf /etc/lvm/lvm.conf.bak

2- Edit /etc/lvm/lvm.conf with any Text Editor (vi or nano)

# vi /etc/lvm/lvm.conf

3- Search for filter = [ , to search with Text file using vi, press / and type the keyword. To navigate within the search press n.

# This configuration option has an automatic default value.
# filter = [ "a|.*/|" ]

4- Uncomment the Second line, and replace the current values with the following:

        # This configuration option has an automatic default value.
        filter = [ "a|/dev/md.*|", "r/.*/" ]

5- Save, and exit lvm.conf file, by pressing Esc from Keyboard to exit Insert mode, then press :wq!

6- Run vgscan

7- Run pvscan to confirm the error is no longer present.

Mohammed has written 63 articles

One thought on “Duplicate LVM Volume Group Warning

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>