How To Backup LVM Configuration On Linux (vgcfgbackup & vgcfgrestore)

In many cases, lvm configuration gets corrupted. So the best pratice to have the lvm configuration is to backup. lvm could also be corrupted on some disk failures and on reboot OS fails to boot up. So it is important to have the lvm configuration backup.


vgcfgbackup takes the configuration metadata from the lvm header of the disk and save to a default file location /etc/lvmconf/base_vg_name.conf. By default, vgcfgbackup runs automatically each time, the lvm command changes the lvm configuration.

# vgcfgbackup

The command has option -f and -u and it is explained below:

#vgcfgbackup [-f vg_conf_path ] [-u] vg_name


The path name of a volume group

-f vg_conf_path

Save the configuration using an alternate file name specified by vg_conf_path. If -f is omitted, the default file name is in the form of /etc/lvmconf/base_vg_name.conf. Where base_vg_name is the base name of vg_name.

For example, if vg_name is specified as /dev/vg00, base_vg_name is vg00.


Update the configuration backup file with the latest lvm configuration. Only those physical volumes added since the configuration backup file was last modified need to be online. If -u is omitted, all physical volumes for vg_name must be online.


The vgcfgrestore command restores LVM volume group configuration from backup file or kernel memory. Restore cannot be performed if the volume group is activated in shared mode. The vgcfgrestore command restores the lvm configuration data from a default (-n option) or alternate (-f option) configuration backup file, or from kernel memory (-k option), to the physical volume named by pv_path. Examples are given below.

Restore the lvm configuration information for the physical volume /dev/rdsk/c0t7d0 that was saved in the default file vg00.conf in the path /etc/lvmconf:

#vgcfgrestore -n /dev/vg00 /dev/rdsk/c0t7d0

Restore the lvm configuration information to physical volume /dev/rdsk/c0t4d0 using alternate configuration file /tmp/vg00.backup:

#vgcfgrestore -f /tmp/vg00.backup /dev/rdsk/c0t4d0



Share This :

Free Linux Ebook to Download

Leave a Reply

Commenting Policy:
Promotion of your products ? Comment gets deleted.
All comments are subject to moderation.