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.
$ 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.
$ 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.
$ 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.
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.
$ 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
$ 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.
$ 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.
$ sudo vgchange --activate y vgdata 1 logical volume(s) in volume group "vgdata" now active
$ 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.