[SOLVED] Making sure I'm backing up QEMU/KVM image correctly (when not live)
Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Making sure I'm backing up QEMU/KVM image correctly (when not live)
Quick background: after having the physical computer running my home networking stack fail a couple times, I wanted to run a VM so that I could still have DNS/file server/MYSQL/etc even if the hardware fails. And I wanted to have software backups in case an upgrade borks this (another problem I've had).
So, I want to make sure this is going to work correctly. Doing it live seems overly complicated what with LVM and all that. But that's OK, I already have a time it needs to be off - when upgrading the kernel. So I was figuring instead of a reboot, I'll shut it off for a minute or two and copy off a backup. The backup being the hard drive and the XML.
I started Googling and it turns out there's this whole sparse files thing to worry about.
I just want to make a backup that's going to work if something goes wrong either on the hardware or the OS.
What do I need to do? I've seen some stuff about needing to tar it up with the --sparse command or something.
It certainly agrees with what I've seen when Googling around. Am I interpreting this and other sources correctly in that the only "bad" thing that can happen is that a cp or a backup will copy a full-sized file? No corruption or anything, just a larger file to backup/copy/etc? That's OK with me. My VM in question is only 10GB if completely full anyway.
I've created a bash script that I'll link to in a few minutes when I get home (as long as I remember to do so). On the plus side because the VM is mostly 0s, when I gzip it, it goes from 10GB to 700MB.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.