Copying or Backing up an image of an LVM-based Virtual Machine

By jbayer - Last updated: Wednesday, October 2, 2013 - Save & Share - Leave a Comment

If you are using virtual machines on a Linux system, you may be storing the VM image in an LVM partition.  This can make it difficult to copy or backup an image of the VM.

The attached script will do just that.  It displays the list of VMs running on the system and allows you to select which one to copy.  If the VM is currently running, it will optionally shut it down before doing the backup;  if it can’t or you don’t want it to shut it down, it will wait for you to shut it down manually.  When complete, it will optionally restart the vm (if it had been running when the script started) and compress the image file if desired.

The only hard-coded value is the DESTDIR, which is where the images are stored.

The script will NOT backup image files.

 

  makeimg.sh.gz (1.1 KiB, 427 hits)

Posted in Backup, Open Source, Virtulization • Tags: , , , Top Of Page
582 views

Write a comment

asd