Copy hard disk over Ethernet (Linux)

Dec 2, 2016


Sometimes you need to move a server from one server to another. And the only thing you can do, is copy the content of the disks. What I sometimes do, is stream the disk content with netcat.

ServerA sends the content of the disks to ServerB. Over Ethernet. With the tool netcat. Which is very fast, because it’s using UDP.

I advice you to boot from a bootable Linux CD for streaming like that your hard disk (example: Knoppix)

ServerA:netcat ---> ServerB:netcat

To start that “migration”, run:

root@ServerB# nc -p 2222 -l | dd of=/dev/sda
root@ServerA# dd if=/dev/hda | nc 10.32.107.140 2222

After that ServerB got all the data, both servers will stop their running script.