Skip to content

how to create entire disk image backups across a network

using command line utilities to perform powerful tasks brings about a special bit of joy that only a geek can truly enjoy. I shall spare you my story (for now) and simply present the research and study that led to these short and slick commands:

to create entire disk image:
server: nc -l -p 12345 > image.bz2
client: dd if=/dev/sda bs=4M | bzip -9z | nc server's-ip-address 12345

to copy created disk image to new client hard drive:
client: nc -l -p 12345 | dd of=/dev/sda
server: bzip2 -dc image.bz2 | nc client's-ip-address 12345

assumptions & prerequisites:

  1. intermediate Linux/unix knowledge (this aint no point ‘n’ click guide)
  2. two networked computers on the same IP subnet; a “server” with ample free disk space and a “client” who’s hard disk you wish to backup/image
  3. client computer must be bootable by USB or CD/DVD – I used a Ubunutu install CD
  4. each computer must have utilities dd, nc, and/or bzip2 or gzip (compression utility)
  5. note: though the compression utility is not required, it is highly recommended as the image you create will be the same size as the hard drive capacity – i.e. 120G drive will create a 120G image file without compression.
  6. you may want to tweak which compression method you use and examine the dd syntax, particularly the bs= portion
  7. it is important to watch the network or process I/O for progress meter as these processes will not terminate automatically due to the nature of nc which maintains a connection until manually broken.

updated 9/24/08: fixed copy created image to new hard drive server steps and added another assumption step. good luck!

Post a Comment

You must be logged in to post a comment.