How to transfer your physical disk content to a virtual machine.

Create a image of the disk

There are several tools that we can use to create a clone of our disk, like clonezilla, g4l, or dd. This wiki will focus on dd but there maybe other simple and more efficient ways of doing this.

Assuming a full disk image with all the partitions:

Local storage:

dd if=/dev/<disk device> ( of=/dev/<external disk> | of=/tmp/disk_image.img ) bs=<block size> <other options if needed>

Remote storage:

dd if=/dev/<disk device> bs=16065b | nc <ip of the remote machine> <port>  => Source machine

nc -l <port> | ( dd of=/dev/<device> | dd of=/tmp/disk_image.img) bs=16065b => Target machine (Execute this one first)

If you can't use nc because of firewall, use the following method:

dd if=/dev/<disk device> | ssh root@<remote-machine> 'dd of=/tmp/<disk image>' bs=<block size>

Example

Ramdisk image

Setup the configuration

Boot the virtual machine

Extras

-- RicardoMendes - 27 May 2008

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 2008-05-27 - RicardoMendes
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Virtualization All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback