Restoring LVM metadata is a recovery task for accidental volume changes, lost LV definitions, or damaged volume group descriptors where the data extents still exist on disk. A current metadata backup gives vgcfgrestore the layout to write back to the physical volumes before the volume group is activated again.

The vgcfgbackup command saves the volume group descriptor, and vgcfgrestore writes a selected descriptor back to the devices named in that backup. Default installations keep automatic backups under /etc/lvm/backup and archives under /etc/lvm/archive, while an explicit --file path makes the recovery point easier to copy off the host.

Metadata backups do not contain filesystem or application data inside logical volumes. Stop writers, keep a fresh safety copy of the current metadata before restoring an older file, and avoid treating vgcfgrestore as rollback for thin pool contents because thin-pool metadata has separate recovery rules.

Steps to back up and restore LVM metadata:

  1. List the target volume group and logical volumes.
    $ sudo lvs --options lv_name,vg_name,lv_size,lv_attr vgdata
      LV       VG     LSize  Attr      
      projects vgdata 20.00g -wi-a-----

    Replace vgdata with the volume group whose metadata should be backed up or restored. Confirm the LV names before saving or applying metadata so the restore point matches the intended layout.

  2. Save a manual metadata backup while the layout is known good.
    $ sudo vgcfgbackup --file /root/vgdata-before-change.conf vgdata
      Volume group "vgdata" successfully backed up.

    Copy the explicit backup file to normal backup storage. Many LVM installations also create automatic backup and archive files under /etc/lvm after configuration changes.

  3. Inspect the selected metadata backup file.
    $ sudo vgcfgrestore --list --file /root/vgdata-before-change.conf vgdata
       
      File:		/root/vgdata-before-change.conf
      VG name:    	vgdata
      Description:	vgcfgbackup --file /root/vgdata-before-change.conf vgdata
      Backup Time:	Fri Jun 12 12:17:25 2026

    Use vgcfgrestore --list vgdata to list automatic backup and archive files when the restore point comes from /etc/lvm/backup or /etc/lvm/archive.

  4. Stop applications that write to logical volumes in the target volume group.

    Restoring VG metadata while filesystems, databases, virtual machines, or swap devices are active can leave the restored layout mismatched with open devices and in-flight writes.

  5. Deactivate the volume group.
    $ sudo vgchange --activate n vgdata
      0 logical volume(s) in volume group "vgdata" now active

    Unmount filesystems or stop raw consumers first if the command reports that any LV is still open.
    Related: How to activate and deactivate an LVM logical volume

  6. Test the metadata restore from the selected file.
    $ sudo vgcfgrestore --test --file /root/vgdata-before-change.conf vgdata
      TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
      Restored volume group vgdata.
  7. Restore the metadata file to the volume group.
    $ sudo vgcfgrestore --file /root/vgdata-before-change.conf vgdata
      Restored volume group vgdata.

    This writes VG metadata back to the physical volumes named in the backup. Use the file that matches the intended VG and restore point.

  8. Activate the restored volume group.
    $ sudo vgchange --activate y vgdata
      1 logical volume(s) in volume group "vgdata" now active
  9. Verify that the expected logical volumes are present again.
    $ sudo lvs --options lv_name,vg_name,lv_size,lv_attr vgdata
      LV       VG     LSize  Attr      
      projects vgdata 20.00g -wi-a-----

    Run filesystem-specific checks or application checks before returning a restored data volume to service.