Clone a disk or write a disk image over the network
January 25, 2016

Sometimes, there are times when you need to clone a disk or write a disk image over the network. One option would be downloading the disk image to your computer using ftp or scp and then transferring it to the disk, but that method would take up disk space which you might not have, and it is also twice as slow.

The command is below:

ssh yourusername@hostnameorip "sudo dd if=sourcepath " | sudo dd of=destpath
  • This command requires SSH to be enabled on the host computer
  • Replace yourusername with your user name you use to login
  • Replace hostnameorip with the IP address of your computer or the host name
  • Replace sourcepath with either the path to the source disk image, or the device name(example:/dev/sdb)
  • Replace destpath with the path to the destination device name(example:/dev/sdb)
Patrick G
Patrick G
I like to write code. I love open source software. I like to self-host stuff.