Dd - Destroyer of Disks
From Noah.org
Revision as of 13:11, 19 October 2007 by Root (talk | contribs) (→Image a drive over a network with dd and nc)
Image a drive over a network with dd and nc
Start the receiving side first. This assumes machine 192.168.1.100:
nc -l -p 2222 > disk_image.gz
Then start sending:
dd bs=1M if=/dev/sda | gzip -c - | nc 192.168.1.100 2222
Notes
If you are doing this on a live server you will need to unmount the drive or switch to single user mode (reboot and set single for boot option in GRUB) or you can boot from a live CD. If you boot into single user mode, don't forget to manually start the network. I have not done a lot of testing with copying a mounted disk in single user mode. This is not the ideal way, but it seems to work. It's better if the drive is not mounted.