Over in the real world, on the production server I help to administer in my spare time, the usual method to provision new VMs is to use
dd to clone whichever existing VM is “nearest” to what we’re trying to do. We
sync this archetypal VM (while it’s running), pause it,
dd if=/dev/raid/src of=/dev/raid/targ, boot the target and adjust its hostname.
Usually works well, except this afternoon I fat-fingered the
dd command, and overwrote the first 1.7 MB of disk on an existing virtual machine. ext3 filesystem not very happy about this.
So begins a lengthy rebuild process.
Now, where are those reproducible kickstart scripts again?
I managed to recover the wordpress directory and a few other things using guestfish:
$ guestfish -r -a /dev/raid/gallroot -m /dev/sda tar-out /usr/share/wordpress wordpress.tar $ ls -l wordpress.tar -rw-rw-r-- 1 rjones rjones 192901120 2009-10-16 23:04 wordpress.tar $ tar tf wordpress.tar | head ./ ./wp-settings.php ./wp-admin/ ./wp-admin/edit-link-categories.php ./wp-admin/edit-category-form.php ./wp-admin/edit-form-comment.php ./wp-admin/options-writing.php ./wp-admin/index-extra.php ./wp-admin/index.php ./wp-admin/admin-footer.php