On Fri, 2010-11-19 at 15:25 +1100, david wrote:
> Is it possible to use MondoRescue or some other software to clone the 
> server hard drive, preferably without shutting it down, and then create 
> a virtual machine from the resulting image?

If you don't mind free-as-in-beer, we've used VMWare's vCenter Converter
to migrate a big chunk of our Windows and Linux machines to guests -
http://www.vmware.com/products/converter/ .

Before that, my quick, dirty but effective way to do it was:
- create the new virtual guest
- boot it using your favourite liveCD, partition drives and create
filesystems
- use tar and netcat to transfer the running system across the network:
  - on guest, mount the new root filesystem and run `nc -l -p 1717 | tar
-C /mountpoint xvf -
  - on old server, run something like `tar cf - --one-file-system / | nc
address_of_guest 1717`. You'll need to tune the tar command to make sure
you include all of the server's mounted filesystems.
- edit the new /etc/fstab on the guest as appropriate
- install a bootloader in the guest, usually by editing grub config
files in /boot/grub and running grub-install.

Note that I made no attempt to keep any services running on the old
server during this process. So all but the bare minimum was shut down,
and there weren't any critical files being written to. On a real running
system, you're more than likely going to end up with some files in an
inconsistent state doing this if the old server is trying to write to
them.

-- 
Pete

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to