Resolving “PVID last seen on /dev/nvme0n1p2 not found” Error in LVM with Devices File on RHEL 9/CentOS 9


11 views

When working with LVM (Logical Volume Manager) on modern RHEL 9 or CentOS 9 systems, you might encounter this puzzling message:

Devices file sys_wwid nvme. PVID last seen on /dev/nvme0n1p2 not found.

Or alternatively:

Please remove the lvm.conf filter, it is ignored with the devices file.

RHEL 9 introduces a significant change in how LVM handles device filtering. The traditional approach using /etc/lvm/lvm.conf filters is being replaced by a more robust devices file system stored in /etc/lvm/devices/system.devices.

This change causes conflicts when:

  • Your system has existing lvm.conf filters
  • You're using NVMe devices
  • The devices file feature is active (default in RHEL 9)

Here's how to properly resolve this:

# First, check if devices file is in use
lvmdevices --check

# To see current device associations
lvmdevices --dump

# Solution 1: Full migration to devices file (recommended)
# Remove old filters and use only devices file
sudo sed -i '/^[[:space:]]*filter/d' /etc/lvm/lvm.conf
sudo systemctl restart lvm2-lvmetad.service

# For NVMe devices specifically:
sudo lvmdevices --adddev /dev/nvme0n1p2

If the issue persists after the above steps:

# Check for duplicate PVs
sudo pvscan -vvv

# Rebuild devices file (caution: backup first)
sudo cp /etc/lvm/devices/system.devices /etc/lvm/devices/system.devices.bak
sudo lvmdevices --update

# For systems with mixed storage:
sudo lvmconfig --type default --withcomments | grep -A10 "devices {"

Consider this working configuration for an NVMe-based system:

# /etc/lvm/devices/system.devices contents:
VERSION=1.1.0
IDTYPE=sys_wwid IDNAME=nvme.1984-09_ABCDEF0001234567890 DEVNAME=/dev/nvme0n1p2 PVID=ABCDEF1234567890

# Corresponding lvm.conf should have:
devices {
    use_devicesfile = 1
    devicesfile = "/etc/lvm/devices/system.devices"
    # No filter lines present!
}

When moving from older systems:

  • Convert all existing filters to devices file entries
  • Update udev rules if they modify device names
  • Check for multipath conflicts if present
  • Rebuild initramfs after changes: sudo dracut -f

The complete transition to devices file represents a more maintainable approach for modern Linux systems with complex storage configurations, though it requires careful migration from older setups.


When working with LVM on RHEL 9 or CentOS 9, you might encounter the warning:

Devices file sys_wwid nvme. PVID last seen on /dev/nvme0n1p2 not found.

Or the more direct message:

Please remove the lvm.conf filter, it is ignored with the devices file.

The core issue stems from RHEL 9's implementation of LVM's devices file feature, which conflicts with traditional filtering methods. The system is essentially telling you that your lvm.conf filter configuration is being overridden by the new devices file mechanism.

Option 1: Transition to the devices file system

# List current devices
sudo lvmdevices --listdevices

# Add your missing device
sudo lvmdevices --adddev /dev/nvme0n1p2

# Verify the update
sudo pvscan --cache

Option 2: Revert to traditional filtering

# Disable devices file
sudo vgimportdevices -a

# Then edit /etc/lvm/lvm.conf to implement your filters:
filter = [ "a|nvme0n1p2|", "r|.*|" ]

For a system with an NVMe disk showing this error, here's the complete workflow:

# First check if the device is properly initialized
sudo pvdisplay /dev/nvme0n1p2

# If missing, recreate the PV signature
sudo pvcreate --uuid  --restorefile /etc/lvm/archive/ /dev/nvme0n1p2

# Update devices file
sudo lvmdevices --update

# Force a rescan
sudo vgimportdevices -a
sudo vgchange -ay
  • The devices file (/etc/lvm/devices/system.devices) takes precedence over lvm.conf filters
  • Mixing both methods can lead to inconsistent behavior
  • Always backup your VG metadata before making changes (vgcfgbackup)

When troubleshooting, these commands prove invaluable:

# Show detailed device filtering
sudo lvmconfig --type full devices/filter

# Check which devices are actually being used
sudo lvm dumpconfig --type diff | grep -i devices

# View current PV mappings
sudo pvs -v --devicesfile /dev/null