Tip : Save and compress at the same time with dd and gzip

So here I will not revolutionize the principle of backups but rather to give the two commands that allow to save your map and compress the image at the same time. And ofcourse do the reverse operation !

To back up and compress, the command is as follows (replace xxx by the ID of your disk/card) :

dd if = / dev/xxx conv = sync,NOERROR bs = 4 m | gzip-c-  > xxx.img.gz

To decompress and restore, the command is as follows (replace xxx by the ID of your disk/card) :

gunzip-c-xxx.img.gz | DD of = / dev/xxx conv = sync,NOERROR bs = 4 m

Mac OS the bs setting takes values followed by a lowercase m. For other systems it will be an uppercase m.

Voilà, in the event that …

Like this article ? Bear with me on patreon!

You may also like...