• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

LVM error “WARNING: Inconsistent metadata found” – How to resolve in CentOS / RHEL

by admin

What is inconsistent metadata error

When LVM performs pretty much any action, it first scans all available physical volumes and refreshes its view of the volume group layout. Because multiple physical volumes can exist in the same volume group, it is possible to end up in a situation where these PVs in the same VG reflect different information. In most cases, this results in the warning message “Inconsistent metadata found” error while executing any command like vgscan, pvscan. For example :

# vgscan
  Reading all physical volumes.  This may take a while...
  Volume group "vg_test" inconsistent
  WARNING: Inconsistent metadata found for VG vg_test - updating to use version 3
  Removing PV /dev/mapper/x (1nxHIW-2Thk-9mS4-2TzO-zHlB-Hsy2-CZsjE7) that no longer belongs to VG vg_test
  Found volume group "vg_test" using metadata type lvm2
Segmentation fault

There could be multiple causes for the inconsistent metadata error. And thus there is no exact resolution for this error. In most situations, restoring older versions of VG metadata with vgcfgrestore works.

Restoring VG metadata using vgcfgrestore

1. The volume group metadata may be restored with the following command:

# vgcfgrestore --file  /etc/lvm/backup/[volume group name] [volume group name]

2. Continuing the earlier error shown in ths post, the exact command would be:

# vgcfgrestore --file /etc/lvm/backup/vg_test vg_test
 Restored volume group vg_test

The name of the metadata backup file would be different that the one shown in above command. But it will include the name of the VG. You can check for the timestamp of the file and the content inside to be sure before executing the vgcfgrestore command.

3. To check that the new physical volume is intact and the volume group is functioning correctly execute vgdisplay -v.

# vgdisplay -v

Filed Under: Linux

Some more articles you might also be interested in …

  1. f5fpc Command Examples
  2. How to monitor /etc/shadow and /etc/passwd file for changes with Auditd?
  3. Linux “seq” Command Examples
  4. dphys-swapfile Command Examples in Linux
  5. scrot: command not found
  6. What are Reserved User Accounts in MySQL
  7. How to Restart Network Services in CentOS/RHEL 8
  8. awk: command not found
  9. lvextend command examples in Linux
  10. Understanding System Security Services Daemon (SSSD)

You May Also Like

Primary Sidebar

Recent Posts

  • cf: Command-line tool to manage apps and services on Cloud Foundry
  • certutil: Manage keys and certificates in both NSS databases and other NSS tokens
  • cdk: A CLI for AWS Cloud Development Kit (CDK)
  • cd: Change the current working directory

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright