vgcfgrestore
Restore Volume Group configuration from backup
SYNOPSIS
vgcfgrestore VolumeGroupName [file] vgcfgrestore -n NewVolumeGroupName VolumeGroupName [file]
PARAMETERS
VolumeGroupName
The name of the Volume Group to restore. If the -n option is not used, this is the name of the Volume Group the configuration will be restored to.
-n NewVolumeGroupName
Specifies a new name for the Volume Group during restoration. This allows restoring the configuration to a VG with a different name.
file
Optional. The file or directory containing the backup configuration. If omitted, it searches in /etc/lvm/archive/VolumeGroupName.
--force
Override certain checks and force the restore operation.
Use with extreme caution!
--test
Perform a simulation of the restore, showing what would be done without actually changing the system.
DESCRIPTION
The vgcfgrestore command restores Volume Group (VG) metadata from a backup created by vgcfgbackup. This is crucial for recovering from metadata corruption or system failures where the VG's configuration is lost. It recreates the VG's structure, logical volumes (LVs), and other attributes based on the backed-up configuration. The command can restore to the same VG or to a different VG (renaming during the restore process). It is vital to ensure the backup being restored is compatible with the current LVM version and kernel. The restore process overwrites the existing VG metadata, so caution is advised. It allows for restoring of one or many Volume Groups from the specified files or directories, as well as restores from a single file in /etc/lvm/archive. vgcfgrestore attempts to handle any inconsistencies and fix any minor metadata problems that it finds. However, more serious metadata corruption problems will prevent this command from working at all.
CAVEATS
Restoring from an incompatible backup may lead to data loss or system instability. Always back up the current configuration before restoring.
IMPORTANT NOTES
Before running vgcfgrestore, ensure that the physical volumes (PVs) that were part of the VG are accessible. The PV UUIDs in the restored metadata must match the actual PVs to ensure proper LV activation. If the PVs are no longer available or have been replaced, the restore will likely fail or result in data corruption.
HISTORY
The vgcfgrestore command is a core component of the Logical Volume Manager (LVM). It was designed to address the need for robust VG configuration management and recovery. As LVM evolved, vgcfgrestore gained features like renaming during restore and improved error handling.
SEE ALSO
vgcfgbackup(8), vgcreate(8), vgremove(8), lvcreate(8)