Block copy disk over SSH with gzip

Software

We haven’t had a things you already know, unless you don’t installment since March. So many things have happened in the interim, not least the need to copy disks over a network.

$SOURCE

$ dd if=$SOURCE_DISK | gzip -1 - | pv | ssh $TARGET_SERVER "gunzip -1 - | dd of=$TARGET_DISK"

This will copy a block device across SSH to a remote server, compressing with gzip to remove empty space, and pv to show progress.

Author bio and support

Me!

Ruben Schade is a technical writer and infrastructure architect in Sydney, Australia who refers to himself in the third person. Hi!

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite bespoke cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or send a comment. Thanks ☺️.