This site is run on my very own web server. I keep backups (of course) with the help of the magic tools rsync and tar. But I also like to make an image of the operating system disc with the help of dd. When dd is done creating the raw image file I sometimes like to create a test system, a replica of the production environment. It’s fun to be able to play around knowing you can’t destroy anything, because if you do you just start over. I use vmware for my playground test system.
To easily convert a dd raw image to a vmware vmdk hard disk file you first must install qemu:
sudo apt-get install qemu
With qemu you can do a lot of things and convert from many file formats, but in this post we’ll only show how to convert to vmdk, but you should really have a look round the qemu help for more information.
Now how to convert:
qemu-img convert -pO vmdk /path/disk.raw /path/hard_disk.vmdk
The commands:
-p | Progress. Not necessary but its nice to see when the conversion will be done. | ||||||||||||||||||
-O |
Output format. We want the output file in this case to be a vmdk file. Valid output formats: (copied from here)
|
That’s it. You now have a new hard disk drive ready to be used by vmware.
Cheers
/jima