dd Across The Internet With ssh and xz
23 Mar 2012
Here’s how you can back up an entire hard disk across the internet
(compressed with xz
to save as much bandwidth as possible, also
using pv
for progress):
$ ssh -p 2222 [email protected] 'dd if=/dev/xvda1 | xz -c' | pv > sonzonaroot.img.xz
To view your files on the other end:
$ xz -d sonzonaroot.img.xz
# mkdir /mnt/disk
# mount -o loop sonzonaroot.img /mnt/disk
You can always not xz
the image up if you happen to be limited by
CPU or RAM, rather than bandwidth.
Happy dd
‘ing!
Links
Projects
Work
- Co-Founder & CEO of Directangular, LLC.
- Previously: Linux Kernel development at Qualcomm, and embedded software at L3. Some of my work (a little stale) is available on the Code Aurora Forum, here, here, here, and here.
- Wild blue yonder: Creating and contributing to a variety of Open Source projects. See my GitHub profile.