Linux LVM error VG meta data inconsistent and Solution

www‮ual.‬tturi.com
Linux LVM error VG meta data inconsistent and Solution

In Linux, the Logical Volume Manager (LVM) is a system used to manage logical volumes, or partitions, on a storage device. If the LVM metadata becomes inconsistent, it can cause errors and prevent the system from accessing the logical volumes.

One common error that can occur is "VG meta data inconsistent". This error occurs when the LVM metadata is not in sync with the physical volume data. This can happen due to various reasons, such as a power failure, system crash, or corruption of the metadata.

To fix this error, you can use the vgck command to check and repair the LVM metadata. This command checks the consistency of the metadata and attempts to repair any inconsistencies it finds.

To use the vgck command, first use the vgchange command to deactivate all the logical volumes in the volume group:

vgchange -a n volume_group

Replace "volume_group" with the name of the volume group that is experiencing the error.

Next, run the vgck command to check and repair the metadata:

vgck volume_group

This command will check the metadata and attempt to repair any inconsistencies it finds. If the metadata is repaired successfully, you should see a message indicating that the metadata is now consistent.

Finally, use the vgchange command to activate the logical volumes again:

vgchange -a y volume_group

This should fix the "VG meta data inconsistent" error and allow you to access the logical volumes again. If the error persists, you may need to try other troubleshooting steps, such as restoring a backup of the metadata or recreating the volume group and logical volumes.

It's always a good idea to regularly back up your LVM metadata to prevent data loss in case of errors or corruption. You can use the vgcfgbackup command to create a backup of the LVM metadata.

vgcfgbackup volume_group

This will create a backup of the LVM metadata for the specified volume group in the /etc/lvm/backup directory. You can then use this backup to restore the metadata if needed.

Created Time:2017-10-30 10:17:34  Author:lautturi