Translated message

A translation of this page exists in English.

Warning message

This translation is outdated. For the most up-to-date information, please refer to the English version.

"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

  • pvs, vgs, lvs コマンドを実行してボリュームグループのメタデータを更新すると、警告が表示されます。

    WARNING: PV /dev/vdb in VG vg_test is using an old PV header, modify the VG to update.
    

Resolution

  • これらの警告をクリアするには、以下のコマンドを使用して volume group metadata を更新します。 これにより、pv_header_extension.version を現在の正しい値 '2' に更新するなど、あらゆるメタデータの問題に修正と更新が適用されます。

    # vgck --updatemetadata vg_test
    

Root Cause

  • 根本的な原因は、RHEL8 環境の pv_header_extension.version フィールドが現在の PV_HEADER_EXTENSION_VSN (2) と一致することが期待されていますが、一致しないことです。

    # pvck --dump headers /dev/<device-named-in-warning-message>
    :
      pv_header_extension.version 1    <==== out of date version, old structure format.
    
  • VG をエクスポート/インポートせずに、デバイスを RHEL バージョン 5 から 8 システムに直接移動すると、これらの警告が継続的に表示されます。LVM コマンドが実行されるたびに、警告が生成されます。

  • これらの警告は、デバイスが RHEL 5 から 6 に移行し、続いて RHEL 6 から 7 に移行し、最後に RHEL 8 に移行する際に表示されます。

    • pv_header_extension lvm2 データ構造は RHEL 5 には存在しませんでした。
    • pv_header_extension lvm2 データ構造は、バージョン番号 '1' で RHEL 6 に追加されました。

        File         Function    Line
      0 layout.h     <global>     26 #define PV_HEADER_EXTENSION_VSN 1
      1 text_label.c _text_write 126 pvhdr_ext->version=xlate32(PV_HEADER_EXTENSION_VSN);
      
      #define PV_HEADER_EXTENSION_VSN 1
      struct pv_header_extension {
              uint32_t version;
              uint32_t flags;             <== unused flags, no values defined.
              /* NULL-terminated list of bootloader areas */
              struct disk_locn bootloader_areas_xl[0];
      } __attribute__ ((packed));
      
    • 現在の pv_header_extension は、上記の構造内の flags エントリーの flags 値が変更されたとき (RHEL6 ではそのフィールドは使用されませんでした)、RHEL 7.9 リリース内でバージョン番号が '2' に増えました。 ただし、RHEL 7 の pv_header_extension 内の古い LVM2 メタデータバージョン情報を検出してユーザーに通知する統一された方法はありませんでした。

      /*
       * PV header extension versions:
       *   - version 1: bootloader_areas_xl support (flags unused)
       *   - version 2: PV_EXT_USED flags support added
       */
      #define PV_HEADER_EXTENSION_VSN 2
      struct pv_header_extension {
              uint32_t version;             <=== expected to be '2'
              uint32_t flags;               <=== flags used
              /* NULL-terminated list of bootloader areas */
              struct disk_locn bootloader_areas_xl[0];
      } __attribute__ ((packed));
      
    • RHEL 8 では、PV で実行される LVM2 メタデータチェックが他のコードパスから分離され、ディスク上のメタデータが pv_header_extension.version フィールドの値のチェックなどの健全性チェックに失敗した場合に、より一貫した警告を提供するように書き直されました。

       [...]
         69                 ext_version=lvmcache_ext_version(info); 
         70                 if (ext_version < PV_HEADER_EXTENSION_VSN) {            <<< Current version is '2'
         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 
       [...]
      
  • データ VG を移動する推奨される方法は、vgexport/vgimport を使用することです。 追加情報は、"How do I move a Volume Group from one system to another?" を参照してください。

Diagnostic Steps

  • LVM コマンドを実行すると、次の警告が表示されます。

    [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   
    
    • 再現手順:

      • 方法 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             
        
      • 方法 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.

Comments