Network streamed whole disk backup

You fiddled for some days to get all needed operating systems installed on your new portable? Got dual, triple or whatever boot manager set up properly? It was a painful process, your fingers, brain are still hurting? Backup the whole disk on some storage near you (some Unix-like OS required):

On the target:

netcat  -l -p 6666 > your-portable.img.gz

On the source:

cat /dev/sda | gzip -1 | netcat the-nas-name-or-ip 6666

On very low end (read Intel Atom & Co) this might be CPU bound. If you have LZO / LZOP around it might speedup the backup process somewhat - while still compressing to a reasonable degree (on the wire or over-the-air and on the remote storage):

cat /dev/sda | lzop | netcat the-nas-name-or-ip 6666

Optimizing compression ratio

If you want to optimize the compression ratio and thus storage space you should zero out the whole disk before installing the systems:

Most Unix’s, including Linux:

dd if=/dev/zero of=/dev/sda

Mac OS X:

Disk Utility: Security options: Overwrite with zeros.

You can archive the same with slightly lower efficiency in the running operating systems by creating a file with just zeros:

dd if=/dev/zero of=file-with-zeros ; rm file-with-zeros

This has a slightly lower compression ratio, because it usually leaves a little noise in the file-system (allocation bookkeeping) meta data. However, it’s better than not zeroing out formerly random data at all.

Update: And LZO is still good enough to compress my now triple booting (3 OSs, Linux, Mac OS X, Windows 7) Nokia Booklet 3G 120 GB disc down to just 19GB on the server. (And I even haven’t zeroed out the HD too carefully, because I actually had to re-install Windows 7 quite some times to get rid of the recovery, as well as the extra boot loader partition, and until it was able to be loaded by the external boot loader all right, …)

Leave a Reply

You must be logged in to post a comment.