DevOps · K8s · Volleyball · Travel  •  DevOps · K8s · Volleyball · Travel  •  DevOps · K8s · Volleyball · Travel
Explore NY Stream

— Kiaasa Dhanori Pune

How to fix duplicated PV issue on EMC multi-path

The "Found duplicate PV" warning on an EMC PowerPath system happens because LVM scans every path to a multipathed LUN and sees the same physical volume UUID several times. The fix is to add an LVM device filter that accepts only the pseudo multipath device (such as /dev/emcpower* or the kernel /dev/mapper/mpath* device) and rejects the underlying raw paths, then rebuild the LVM cache. This guide walks through diagnosing the problem and applying a correct, durable filter so LVM uses one stable device per LUN.

If you have ever run pvcreate /dev/emcpowerk1 and then watched pvdisplay spew lines like Found duplicate PV ... using /dev/sdv not /dev/emcpowerk1, this is the article that explains exactly why it happens and how to stop it for good. The duplicate PV on EMC PowerPath issue is one of the most common storage gotchas on Linux servers attached to a SAN.

Why LVM reports a duplicate PV on EMC multipath

A SAN LUN is almost never presented to a host over a single cable. For redundancy and load balancing, the same logical disk arrives through multiple HBA ports, multiple fabric paths, and multiple array controllers. The Linux kernel sees each path as a separate SCSI block device: /dev/sdv, /dev/sdh, /dev/sdac, /dev/sdo, and so on.

EMC PowerPath (the legacy multipathing software for VNX, CLARiiON, Symmetrix and VMAX arrays) coalesces those raw paths into a single pseudo device, named /dev/emcpowera, /dev/emcpowerk, etc. That pseudo device is the one you are supposed to use for everything: pvcreate, mkfs, partitioning and mounting.

The problem is that LVM does not know about PowerPath. By default it scans all block devices. Because every raw path and the PowerPath pseudo device point at the same LUN, they all carry the identical PV UUID written into the LVM label. LVM sees that one UUID on five different device nodes and prints a warning for each collision:

  • Found duplicate PV yyfFeZg8bUwYenONj1xXcnHkdf50U6kG: using /dev/sdv not /dev/emcpowerk1
  • Found duplicate PV yyfFeZg8bUwYenONj1xXcnHkdf50U6kG: using /dev/sdh not /dev/sdv
  • Found duplicate PV yyfFeZg8bUwYenONj1xXcnHkdf50U6kG: using /dev/sdac not /dev/sdh

This is more than cosmetic noise. If LVM activates the volume group through a raw single path instead of the multipath device, you lose path failover and load balancing for that volume group. A single cable, port or controller failure can then take the filesystem offline even though the LUN is still reachable on another path. The goal is to make LVM consider only the multipath pseudo device.

Solution: filter LVM so it scans only the PowerPath device

The fix is the LVM device filter in /etc/lvm/lvm.conf. A filter is an ordered list of accept (a) and reject (r) regular expressions. LVM walks the list top to bottom and uses the first match for each device, so order matters enormously. The strategy is: accept your boot/root disk, accept the PowerPath pseudo devices, then reject everything else.

Before editing anything, confirm which devices are real PVs and which are duplicate paths so you write a filter that matches your actual hardware:

  1. List the PowerPath devices and the raw paths behind each LUN:
    powermt display dev=all
  2. See exactly which device nodes LVM is currently scanning and where the duplicates are:
    pvscan -vvv 2>&1 | grep -i duplicate
  3. Confirm the naming of your pseudo devices (emcpower*) and your root disk (often /dev/sda):
    ls -l /dev/emcpower* and lsblk

Edit the LVM filter

Open the config file and locate the default filter line:

  1. Open the file in an editor: vi /etc/lvm/lvm.conf
  2. Find the default, which accepts everything:
    filter = [ "a/.*/" ]
  3. Comment it out and replace it with a filter that accepts your root disk and the PowerPath pseudo devices, then rejects the rest:

filter = [ "a|^/dev/sda[0-9]*$|", "a|^/dev/emcpower.*|", "r|.*|" ]

Read the three entries left to right:

  • a|^/dev/sda[0-9]*$| — accept the local boot/root disk and its partitions (/dev/sda, /dev/sda1, /dev/sda2, ...). Use commas between entries and anchor each pattern with ^ and $.
  • a|^/dev/emcpower.*| — accept every EMC PowerPath pseudo device, which is the single stable handle per LUN.
  • r|.*| — reject all remaining devices, which removes the raw /dev/sd* SAN paths that caused the duplicates.

Important correction to a filter you will see copied around the internet: a pattern like a/sda[1-9]$/ is wrong on two counts. It is missing a leading /dev/ anchor, and [1-9] excludes partition numbers like 10 and, critically, does not match the bare disk /dev/sda with no partition. If your root PV lives on /dev/sda2 you might get lucky, but the moment a disk has sda10 or you reference the whole disk, that filter silently drops the device and your volume group fails to activate. Always anchor with ^/dev/ and use [0-9]*.

Use global_filter on modern systems

On current Linux distributions (RHEL/CentOS 7 and later, and any system that runs the LVM metadata daemon lvmetad or lvmpolld), the plain filter setting is consulted by command-line tools but the cache built by the daemon can still pick up rejected devices. Set the same expression in global_filter, which is honored by every LVM component including the daemon:

global_filter = [ "a|^/dev/sda[0-9]*$|", "a|^/dev/emcpower.*|", "r|.*|" ]

If your multipathing is native Linux device-mapper-multipath rather than PowerPath, the pseudo device is /dev/mapper/mpath* (or your aliased name), so accept that instead:

global_filter = [ "a|^/dev/sda[0-9]*$|", "a|^/dev/mapper/mpath.*|", "r|^/dev/sd.*|", "a|.*|" ]

Rebuild the LVM device cache and rescan

After saving lvm.conf, the stale device cache in /etc/lvm/cache/.cache still remembers the old paths, so you must wipe it and rescan:

  1. Save and close the file.
  2. Clear the cache and rescan volume groups (the verbose form shows the cache being wiped):
    vgscan --cache on newer LVM, or the classic vgscan -vvvv
  3. If you run lvmetad, refresh it so the daemon picks up the new filter:
    pvscan --cache
  4. Re-display the physical volumes:
    pvdisplay

The verbose vgscan -vvvv output is intentionally noisy — you will see lines such as Wiping cache of LVM-capable devices and per-device decisions. That is expected; you are watching LVM rebuild its view of the world. What matters is the final pvdisplay.

Verification: confirm the duplicate PV warning is gone

A clean result shows each physical volume exactly once, on its multipath device. After the fix, pvdisplay should report your root PV on /dev/sda2 and the SAN PV on the PowerPath device with no duplicate lines at all:

FieldLocal root PVEMC SAN PV
PV Name/dev/sda2/dev/emcpowera
VG NameVolGroup00(new / unassigned)
PV Size135.87 GB34.00 GB
PV UUIDeirou1-MeG0-...-GQxmd5yyfFeZ-g8bU-...-50U6kG

Run these checks to be confident the change took effect and survives a reboot:

  1. Confirm no duplicate warnings remain: pvscan 2>&1 | grep -i duplicate should return nothing.
  2. Confirm each PV resolves to the pseudo device: pvs -o pv_name,vg_name,pv_uuid
  3. Confirm the volume group activates through the multipath device: vgs and lvs show your VGs/LVs with no errors.
  4. Confirm path redundancy is intact: powermt display dev=all (or multipath -ll for native DM) shows multiple active paths per device.
  5. Test that the filter survives reboot by checking it again after a controlled reboot, ideally before you depend on it in production.

Common pitfalls when fixing duplicate PV on EMC PowerPath

This task looks small but trips up many administrators. Watch for these:

  • Forgetting to wipe the cache. Editing lvm.conf alone changes nothing until vgscan --cache / pvscan --cache rebuilds /etc/lvm/cache/.cache.
  • Rejecting your own root disk. If the filter does not accept the device that holds your boot/root volume group, the system may fail to boot. Always accept the root disk first and test before rebooting.
  • Bad regex anchoring. Missing ^/dev/ or using [1-9] instead of [0-9]* drops valid devices. Anchor every pattern.
  • Editing only filter on systems that use lvmetad. Set global_filter as well, then restart the daemon: systemctl restart lvm2-lvmetad (where present).
  • Not regenerating the initramfs. If the root or any boot-time VG lives on the SAN, the filter must also be inside the boot image. After editing lvm.conf, rebuild it: dracut -f (RHEL/CentOS 7+) or mkinitrd (older releases). Otherwise the cached filter in the old initramfs wins at boot.
  • Mixing PowerPath and native multipath. Do not run EMC PowerPath and Linux device-mapper-multipath against the same LUNs at the same time. Pick one, and blacklist the EMC devices in /etc/multipath.conf if PowerPath owns them.

Modern equivalent: PowerPath is legacy

EMC PowerPath (now Dell PowerPath) still exists and is supported on enterprise arrays, but on most current Linux deployments the native, in-kernel device-mapper-multipath stack is the default and preferred choice because it ships with the distribution and needs no third-party kernel modules. The duplicate-PV concept is identical — you simply accept /dev/mapper/* and reject the raw /dev/sd* paths.

With native multipath you can avoid editing the LVM filter altogether by letting LVM detect multipath components automatically. Set multipath_component_detection = 1 (the default) and md_component_detection = 1 in lvm.conf; LVM then ignores any /dev/sd* device that is a member of a multipath map. A filter remains the most explicit and bullet-proof method, so many shops keep both.

Key Takeaways

  • The duplicate PV warning means LVM is scanning every SAN path to a LUN and seeing the same PV UUID multiple times.
  • Fix it with an ordered LVM filter that accepts the root disk and the multipath pseudo device (/dev/emcpower* or /dev/mapper/*) and rejects everything else.
  • Always anchor regex patterns with ^/dev/ and use [0-9]* for partitions; sloppy patterns silently drop valid devices.
  • Editing lvm.conf is not enough — wipe the cache with vgscan --cache / pvscan --cache, set global_filter for daemon systems, and rebuild the initramfs if the SAN holds boot volumes.
  • PowerPath is legacy; native device-mapper-multipath is the modern default, but the duplicate-PV fix is conceptually the same.

Frequently Asked Questions

Is the "Found duplicate PV" warning dangerous or just cosmetic?

It is a real risk, not just noise. If LVM activates a volume group on a single raw path instead of the multipath device, a path, port or controller failure can take the filesystem offline even though the LUN is still reachable on another path. Apply the filter so LVM uses only the multipath device and keeps full failover.

What is the difference between filter and global_filter in lvm.conf?

filter is applied by LVM command-line tools, while global_filter is applied by every LVM component including the metadata daemon (lvmetad). On modern systems set global_filter (or both) so the daemon-built cache does not re-introduce the rejected raw paths.

Why do duplicates come back after a reboot even though I fixed lvm.conf?

Almost always because the initramfs still carries the old configuration. If a boot-time or root volume group lives on the SAN, rebuild the boot image with dracut -f (RHEL/CentOS 7+) or mkinitrd on older systems so the corrected filter is used during early boot.

Should I use EMC PowerPath or native Linux multipath?

For new deployments, native device-mapper-multipath is the default and recommended option because it is built into the kernel and distribution. PowerPath remains valid on supported enterprise arrays, but never run both against the same LUNs simultaneously.

For more hands-on Linux and storage administration walkthroughs, subscribe to @explorenystream on YouTube.