Swizzling.org

Welcome to swizzling kids. The site with no real purpose and shocking low levels of content.

Clone disk over SSH

December 13th, 2008 . by Dave

This is pretty handy. It will make an exact copy of a disk on your local machine to a disk on a machine anywhere running Linux with an SSH server running.

Because we’re playing with filesystems I strongly recommend you only do this when both machines are booted off live CD’s. Trying to do a disk dump of a mounted volume is the doings of a mad man and will surely end up in data curruption.

dd if=/dev/sda ibs=32k obs=2k | ssh root@192.168.1.10 “dd of=/dev/sda obs=32k”

This will dump the content of your local disk, /dev/sda to a local disk on a remote machine, also /dev/sda in this case.

You will need root access on the remote machine.

I find this will very useful when migrating virtual machines where you can be sure the hardware on source and destination machines are the same.