WARNING: Duplicate VG name
Environment
- Red Hat Enterprise Linux
- LVM2
Issue
- LVM related commands are spewing warnings about duplicate VGs
WARNING: Duplicate VG name vg_name: abCDe4-Ab9C-DeFG-a9bc-DEfG-LmNo-Pq0RsT (created here) takes precedence over aBcd8a-76ab-aBcd-EFge-9ab0-a7Bc-AbCddE
- One or more of my Volume Groups appears to have gone missing and I'm getting Duplicate VG warnings
- After cloning my disk I'm getting warnings from LVM commands regarding Duplicate VG names
- After importing disks from another machine, I'm getting warnings that the Volume Group has been duplicated
Resolution
- Verify you are getting the Duplicate VG name warning from your commands
# lvs vgname
WARNING: Duplicate VG name vgname: JwG3LS-u7aQ-a96s-nKuL-aWVx-iKaV-uc2pJ0 (created here) takes precedence over Cd1BG6-2Mrn-FW9r-qnjA-YKsx-YMA1-pfl4v2
LV VG Attr LSize Devices
lvol vgname -wi-ao 179.95G /dev/emcpowerb1(0)
- Check the output of
pvsto see which disks currently belong to the volume group
# pvs -o pv_name,vg_name,pv_uuid
PV VG PV UUID
/dev/emcpowerb1 vgname 2tLome-P2nz-IBAd-gsKi-LN0c-f39v-yZvTe2
/dev/emcpoweru1 vgname ZCB3Wq-JSR5-RRPx-oOLN-f6bv-vzx0-mGmnrF
- Check the backup metadata for your volume group to verify the correct PV UUID of your disk. This file should be located under
/etc/lvm/backup/<vgname>
# grep device etc/lvm/backup/vgname -B1 | grep id
id = "2tLome-P2nz-IBAd-gsKi-LN0c-f39v-yZvTe2"
- Use the
vgimportcloneagainst the disk that is not in the backup metadata
# vgimportclone --basevgname vgname_clone /dev/emcpoweru1
- If the output from pvs shows identical disks, the vgimportclone command can be run on either disk.
- Verify the error is gone and we now see two different volume groups
# lvs
LV VG Attr LSize Devices
lvol vgname -wi-ao 179.95G /dev/emcpowerb1(0)
lvol vgname_clone -wi-a- 179.95G /dev/emcpoweru1(0)
Root Cause
- LVM volume groups are defined using metadata on the header of the disk. If two disks have different metadata, but identical volume group names, the warning will be displayed
- Renaming a volume group to a volume group that already exists will cause this issue
- Importing a volume group from another system that has the same name will cause this issue
- Creating a hardware clone of your LUN can cause this issue
SBR
Product(s)
Components
Category
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.