User Tools

Site Tools


docu:csheet:sysadm:disks:lvm_backup_restore

Backup and restore LVM configuration of a volume group (vg)


To know the volume groups of your system, issue the following command, we will use the VG Name field:

vgdisplay


This command is automatically done everytime the LVM volume group changes, so you don't really have to schedule this command, but if you want to make sure you have a fresh backup of the LVM volume group, you can use:

vgcfgbackup Your-Volume-Group-Name
 
# or setting the output file
vgcfgbackup -f /etc/lvm/backup/your_own_backup_name Your-Volume-Group-Name


Backup will be saved under /etc/lvm/backup


You can restore the LVM configuration (not the files) using:

# -v = verbose
vgcfgrestore Your-Volume-Group-Name -v -f /etc/lvm/backup/Your-Volume-Group-Name
 
# check it exists, if you see it as 'inactive', use the next 'lvchange' command:
lvscan
 
lvchange -ay /dev/Your-Volume-Group-Name/lv_whatever

Source: https://linoxide.com/how-tos/how-to-backup-lvm-configuration-on-linux/

docu/csheet/sysadm/disks/lvm_backup_restore.txt · Last modified: 2020/07/11 11:52 by admin