LVM warning: Device for PV [...] not found or rejected by a filter

Written by - 0 comments

Published on - Listed in Linux LVM


When LVM cannot find a (removed) device anymore, the following warning message is shown after certain LVM commands, such as vgs:

root@linux:~# vgs
  WARNING: Device for PV bcT9Er-pvq6-3CCb-kdPU-98d3-NgNz-rrsnbO not found or rejected by a filter.
  VG  #PV #LV #SN Attr   VSize  VFree  
  vg0   2   3   0 wz-pn- 31.47g <18.00g

There can be a couple of reasons why this warning shows up, in this situation this happened because the original physical volume (PV) was replaced by a new PV with more capacity. Contents were moved from old to new PV using pvmove but then someone forgot to remove the original PV from the volume group (using vgreduce, pvremove).

Let's take a look at the current PVs:

root@linux:~# pvs
  WARNING: Device for PV bcT9Er-pvq6-3CCb-kdPU-98d3-NgNz-rrsnbO not found or rejected by a filter.
  PV         VG  Fmt  Attr PSize   PFree  
  /dev/sda3  vg0 lvm2 a--  <18.00g  <4.52g
  [unknown]  vg0 lvm2 a-m  <13.48g <13.48g

The original PV is simply shown as [unknown] in the list of devices. That's no surprise because in the meantime this (virtual) disk was removed from the server.

pvdisplay shows the same but with more information, including the UUID of the PV:

root@linux:~# pvdisplay
  WARNING: Device for PV bcT9Er-pvq6-3CCb-kdPU-98d3-NgNz-rrsnbO not found or rejected by a filter.
  --- Physical volume ---
  PV Name               [unknown]
  VG Name               vg0
  PV Size               13.48 GiB / not usable 4.00 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              3450
  Free PE               3450
  Allocated PE          0
  PV UUID               bcT9Er-pvq6-3CCb-kdPU-98d3-NgNz-rrsnbO


  --- Physical volume ---
  PV Name               /dev/sda3
  VG Name               vg0
  PV Size               <18.00 GiB / not usable 3.00 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              4607
  Free PE               1157
  Allocated PE          3450
  PV UUID               m2A8Nq-fbFB-MAY1-xLKQ-10VV-xZCE-dy1FtD

And no surprise here: The UUID of the unknown PV matches the one in the LVM warning.

Usually a PV is removed from a VG by using the following syntax:

vgreduce /device/path VG

But as this [unknown] device does not have a path anymore, this doesn't work. However the vgreduce command is equipped for this scenario, as the help output shows:

root@linux:~# vgreduce --help
  vgreduce - Remove physical volume(s) from a volume group
[...]
  Remove all missing PVs from a VG.
  vgreduce --removemissing VG

        [    --mirrorsonly ]
        [ COMMON_OPTIONS ]
[...]

Let's remove the missing PV:

root@linux:~# vgreduce --removemissing vg0 -v
  WARNING: Device for PV bcT9Er-pvq6-3CCb-kdPU-98d3-NgNz-rrsnbO not found or rejected by a filter.
    There are 1 physical volumes missing.
    There are 1 physical volumes missing.
    Archiving volume group "vg0" metadata (seqno 15).
    Removing PV with UUID bcT9Er-pvq6-3CCb-kdPU-98d3-NgNz-rrsnbO from VG vg0.
    Creating volume group backup "/etc/lvm/backup/vg0" (seqno 16).
  Wrote out consistent volume group vg0.

And the missing [unknown] device is now gone:

root@linux:~# pvs
  PV         VG  Fmt  Attr PSize   PFree
  /dev/sda3  vg0 lvm2 a--  <18.00g <4.52g

root@linux:~# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda3
  VG Name               vg0
  PV Size               <18.00 GiB / not usable 3.00 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              4607
  Free PE               1157
  Allocated PE          3450
  PV UUID               m2A8Nq-fbFB-MAY1-xLKQ-10VV-xZCE-dy1FtD

Caution! Only run this command if you know for sure that this unknown/removed device can safely be removed from the volume group!



Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.

RSS feed

Blog Tags:

  AWS   Android   Ansible   Apache   Apple   Atlassian   BSD   Backup   Bash   Bluecoat   CMS   Chef   Cloud   Coding   Consul   Containers   CouchDB   DB   DNS   Database   Databases   Docker   ELK   Elasticsearch   Filebeat   FreeBSD   Galera   Git   GlusterFS   Grafana   Graphics   HAProxy   HTML   Hacks   Hardware   Icinga   Influx   Internet   Java   KVM   Kibana   Kodi   Kubernetes   LVM   LXC   Linux   Logstash   Mac   Macintosh   Mail   MariaDB   Minio   MongoDB   Monitoring   Multimedia   MySQL   NFS   Nagios   Network   Nginx   OSSEC   OTRS   Office   PGSQL   PHP   Perl   Personal   PostgreSQL   Postgres   PowerDNS   Proxmox   Proxy   Python   Rancher   Rant   Redis   Roundcube   SSL   Samba   Seafile   Security   Shell   SmartOS   Solaris   Surveillance   Systemd   TLS   Tomcat   Ubuntu   Unix   VMWare   VMware   Varnish   Virtualization   Windows   Wireless   Wordpress   Wyse   ZFS   Zoneminder