WARNING: PV /dev/sdX in VG vgXX is using an old PV header, modify the VG to update

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 8
  • LVM

Issue

  • Warning appears when running pvs, vgs, lvs command to update volume group metadata:
   WARNING: PV /dev/vdb in VG vg_test is using an old PV header, modify the VG to update.

Resolution

  • In order to clear those warnings, Update volume group metadata by using the below command:
# vgck --updatemetadata vg_test

Root Cause

  • These warnings come continuously when a device is moved directly from RHEL version 5 to 8 system without exporting/importing a VG.
  • These warnings appear when a device moves from RHEL 5 to 6 then RHEL 6 to 7 and finally to RHEL 8.
  • PVS still have the old header and due the code level changes in higher version of lvm shows this warning:
     [...]
       69                 ext_version = lvmcache_ext_version(info); 
       70                 if (ext_version < PV_HEADER_EXTENSION_VSN) {            <<<
       71                         log_warn("WARNING: PV %s in VG %s is using an old PV header, modify the VG to update.",
       72                                  dev_name(pvl->pv->dev), vg->name);     <<< printed here 
       73                         continue;
       74                 }
       75 
     [...]

Diagnostic Steps

  • Running any LVM command gives the warning:
[root@rhel8 ~]# pvs
  WARNING: PV /dev/vdb in VG vg_test is using an old PV header, modify the VG to update.
  PV         VG      Fmt  Attr PSize    PFree
  /dev/vda2  rhel    lvm2 a--    <9.00g    0 
  /dev/vdb   vg_test lvm2 a--  1020.00m    0 
[root@rhel8 ~]# lvs
  WARNING: PV /dev/vdb in VG vg_test is using an old PV header, modify the VG to update.
  LV   VG      Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root rhel    -wi-ao----   <8.00g                                                    
  swap rhel    -wi-ao----    1.00g                                                    
  lv1  vg_test -wi-a----- 1020.00m   
  • Reproducer steps:

Method 1:

- Create a PV/VG/LV and file system on RHEL 5.
- Detach the disk and attach it to RHEL 8. 
- Run lvm commands: 

[root@rhel8 ~]# lvs
  WARNING: PV /dev/vdb in VG vg_test is using an old PV header, modify the VG to update.
  LV   VG      Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root rhel    -wi-ao----   <8.00g                                                    
  swap rhel    -wi-ao----    1.00g                                                    
  lv1  vg_test -wi-a----- 1020.00m             

Method 2:

- Create a PV/VG/LV and file system. Export the VG.
- Detach the disk and attach it to RHEL 8 and run lvm commands before doing vgimport.

[root@rhel8 ~]# pvs
  WARNING: PV /dev/vdd in VG vg_new is using an old PV header, modify the VG to update.
  PV         VG      Fmt  Attr PSize    PFree
  /dev/vda2  rhel    lvm2 a--    <9.00g    0 
  /dev/vdb   vg_test lvm2 a--  1020.00m    0 
  /dev/vdc   vg1     lvm2 a--   508.00m    0 
  /dev/vdd   vg_new  lvm2 ax-   716.00m    0   <<<<<<
[root@rhel8 ~]# vgimport vg_new
  WARNING: PV /dev/vdd in VG vg_new is using an old PV header, modify the VG to update.
  WARNING: updating PV header on /dev/vdd for VG vg_new.
  Volume group "vg_new" successfully imported
[root@rhel8 ~]# pvs
  PV         VG      Fmt  Attr PSize    PFree
  /dev/vda2  rhel    lvm2 a--    <9.00g    0 
  /dev/vdb   vg_test lvm2 a--  1020.00m    0 
  /dev/vdc   vg1     lvm2 a--   508.00m    0 
  /dev/vdd   vg_new  lvm2 a--   716.00m    0 

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.