Backup and Restore of LVM in LINUX

BACKUP AND RESTORE VOLUME GROUPS IN LINUX
Hi Guys, Welcome one more time to my blog, Let’s learn today how to backup your volume group and restore it in Linux environment.
In order to backup a VG we have to use vgcfgbackup command.
Let’s see the syntax.

Scenario: We have a vg with the name umvg which is having lvs, name umlv1, umlv2 which is mounted on /um1 as well as /um2
 
To backup the VG, we need to specify the location of file where we want the backup to be stored, like  /tmp/filename or /opt/filename or any nfs folder etc. In my case I’m using /opt/umvg as my filename. The syntax will be
 
#vgcfgbackup –f /opt/umvg umvg
Where –f represent file option, /opt/umvg location of file, umvg name of the vg to backup.
To list out the contents of backup, use the following command
#vgcfgrestore -l /opt/umvg


Now delete the vg and restore it from backup using the command
#vgcfgrestore -f /opt/umvg umvg.

where /opt/umvg is the location of backup file and umvg is the name of vg to restore

Remove the VG

Restoring the vg

As the vg is restored successfully, but the lvs will still be in deactivated mode. To mount the lv, first activate them and then mount it, your data is restored.

 
Ta-da!!!!, keep on learning.
Do visit for more.
Thank you
  1. Anonymous

    May 6, 2014 at 11:32 am

    Thank you sir…

  2. Musabuddin Syed

    May 7, 2014 at 6:16 am

    Thank you very much dear,
    Can I know your name please.

    Much obliged

  3. siddharth goutam

    March 9, 2016 at 12:55 pm

    Sir,
    Please could you explain why /boot cannot reside in a LVM partition.

    Your's sincerely
    Siddharth

  4. Musabuddin Syed

    March 25, 2016 at 5:05 am

    HI siddharth,
    Thanks for your question.
    The reason why /boot should not be on lvm on linux, is /boot should be sitting on bootstrap on the top of bootable disk,whereas if it is in lvm, then first disk gets activated , thereafter vg and finally lv will be active, hence till this how booting procedure will get activated.

    So it is recommended to keep /boot on standard to get bootable files immediately during boot from bootstrap.

    hope answer your question.

    Thanks and regards
    Musab

Comments are closed.