This is the simple case where all we have is one disk that needs cloning.
Assumptions for the following example
- Tools including backtrack distro available and permissible by company policy ( some c**ts get all agitated when sysadmins use a ‘knife’ to cut the ‘bread’ so be warned)
- Networking in place for the transfer preferable pre-organized IPs, gatway , DNS for resolving the updates like ssh etc.. , also verify the level of traffic your network guys are willing to tolerate for a long time this should be your –rate-limit value (remember this value is in Mega bytes so 9-10x the Megabit bandwidth.
- Cloning one disk is enough for the volumes to move. Compex LVM / software raids and concats or stripes need further steps.
- For the sake of example i assume this is a P2V but it’s just as good an approach in a V2V.
Points to perform :
- Download / Burn Backtrack or Knoppix
- Create a VM with large enough a disk and closely supported disk subsystem and NICs eg. SCSI and e1000
- Boot the two machines e.g. physical (source) and VM (target) with BT
- Enable ssh on both machines for a third person point of view even for monitoring the transfer
- Connect to the receiving VM booting into the live CD.
- Setup a screen session to avoid your disconnection from the session affecting the transit. Using screen -S transfer.
- run nc -l -p 19000 | bzip2 -d | dd bs=16M of =/dev/sda replacing the 19000 with the port you want to use and /dev/sda with the disk you want to clone.
- Connect to the transmitting side.
- Setup a screen session to avoid your disconnection from the session affecting the transit. Using screen -S transfer.
- run dd bs=16M if=/dev/sda | pv –rate-limit 1M | bzip2 -c | nc 192.168.1.24 19000
replacing the ip with the ip of the listener connected in point 5, and you can skip the rate limit thingy (–rate-limit 1M) if you want full throttle.. - Once finished you can boot the target VM and reconfigure it as you please.
An extra help might be connecting to the target box in a target session and run iftop to see the transfers.
Njoy.