Duplicate LVM Volume Group Warning

  • 7003547
  • 15-Jun-2009
  • 08-Nov-2012

Environment

Novell Open Enterprise Server 2 (OES 2) Linux
Novell Open Enterprise Server 1 (OES 1) Linux
SUSE Linux Enterprise Server 11
SUSE Linux Enterprise Server 10
SUSE Linux Enterprise Server 9
Logical Volume Manager (LVM)


Situation

The following LVM errors were observed:

# /sbin/pvscan
  WARNING: Duplicate VG name sapvg: Existing JckPD2-vv2Q-3IJd-t3AN-Tqpv-PMTl-oT9Y1X (created here) takes precedence over XrqmSA-LzGU-qV9V-AlpL-uYHv-eEaA-M4ucXg
  Couldn't find device with uuid 'LZrggj-3RdW-mHdG-XFDQ-Rfok-1JTj-HyZM5E'.
  Couldn't find device with uuid '7IeYkn-V4tc-lz8D-K8JS-FMEn-eCgU-qL25mi'.
  Couldn't find device with uuid 'LZrggj-3RdW-mHdG-XFDQ-Rfok-1JTj-HyZM5E'.
  Couldn't find device with uuid '7IeYkn-V4tc-lz8D-K8JS-FMEn-eCgU-qL25mi'.
  PV unknown device   VG sapvg    lvm2 [136.73 GB / 100.32 GB free]
  PV /dev/sdb1        VG sapvg    lvm2 [136.73 GB / 90.63 GB free]
  PV unknown device   VG sapvg    lvm2 [68.36 GB / 68.36 GB free]
  PV /dev/md2         VG sapvg    lvm2 [136.53 GB / 63.03 GB free]
  PV /dev/md1         VG rootvg   lvm2 [53.35 GB / 2.05 GB free]
  Total: 5 [531.69 GB] / in use: 5 [531.69 GB] / in no VG: 0 [0   ]

Resolution

SUSE will have many representations or devices for the same physical hardware. LVM needs to know which of these devices to use. LVM meta data exists on both the /dev/sd* and /dev/md* devices for the same volume group. When choosing the device, pick the highest level of abstraction for the block device. In this example, the /dev/sd* devices have been consumed by the /dev/md* for software RAID. So the /dev/md* devices are the highest level of block abstraction. Update the LVM filter to only use the /dev/md* devices.

To update the LVM filter do the following:
  1. Edit /etc/lvm/lvm.conf
  2. Change the default filter = [ "r|/dev/.*/by-path/.*|", "r|/dev/.*/by-id/.*|", "a/.*/"] to filter = [ "a|/dev/md.*|", "r/.*/"]
  3. Save and exit /etc/lvm/lvm.conf
  4. Run vgscan
  5. Run pvscan to confirm the error is no longer present. It is also a good idea to reboot the server.
NOTE: This filter assumes you only use /dev/md* devices with LVM. If you use other devices, you will need to include an "Accept" filter for those devices as well.