Tuesday, 17 July 2007

Backup and Virtual Machine Images

In a development environment is now common the use of virtualization software for different reasons (testing the application in an another OS, made an IDE available to an OS that lacks that software, etc).
When I create a fresh guest installation, I like to backup the virtual disk image. If the virtualization app doesn't allow you to split the virtual disk in smaller files (like VMWare does), you have to do it by your self. If you don't split images greater than 2GB, you will exceed the ISO filesystem maximum allowed size.
In linux (or in Windows with Cygwin) you can use the split command to reduce these images:

split -db100000000 big_file.ext big_file.ext-

The number is a 1 followed by 8 zeroes and is expressed in bytes ('b' option), the 'd' switch tells split to use numeric suffix and the third parameter is the prefix. This command will produce n-files of 100MB named big_file.ext-00, big_file.ext-01, etc.
To join these file use the following command:

cat big_file.ext-* >big_file.ext

For completeness I must say that UDF filesystem supports files greater than 2GB, but in linux I had some problems with udftools (some blog post talks about a bug that limits again the file size - I've verified and it's true).

If you are searching a good virtualization product you can try VirtualBox. It's available in an opensource edition under GPL license.

No comments:

Post a Comment