JS Ext

Friday, October 5, 2012

The importance of regular backups

I previously discussed my love of virtual disk snapshots.  This is a story of how snapshots can go wrong.  I recently found some free Windows 95 programs hosted on a Microsoft ftp server.  Some of the software were demo's but some were the full versions of some old school software that I wasted a lot of my youth on.  Naturally, I wanted to install some of these games.  Before installing new software into my Windows VM, I like to take a snapshot, just because I can.  Actually, its because some software can be detrimental to the operating system, so I want a way to uninstall that software without the uninstaller leaving behind dll's that slow my VM down.

I shut down my VM, then start taking a snapshot.  All of a sudden, the qemu-img program crashed with a Segmentation Fault.  I tried booting my VM and it wouldn't boot.  It claimed the disk was invalid.  I decided to apply my previous snapshot (from a week earlier) but the VM still wouldn't boot.  Luckily, I do perform other types of backups.  Since the VM disk is just a file on the filesystem, I have been copying the entire file onto another hard disk.  Creating a snapshot backup uses almost no hard disk space, due to the nature of the copy-on-write design of the file format.  Copying an entire virtual disk uses a lot of disk space.  Therefore, I didn't use this form of backup as frequently.  My previous backup using the disk copy was two months ago.  So, due to a Segmentation Fault, I lost two months of progress on Angry Birds!

Now, I have set up a weekly cron job that shuts down all my VMs, makes a complete copy of the virtual disk, then makes a snapshot.  If the snapshot fails, it copies the new backup of the virtual disk back.  It finally starts the Windows VM back up again (so my wife can always play Angry Birds whenever she wants).

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.