Compress dd backups with sha1sum checksum

Instead of storing whole dd images, even if they’re just backups of small partitions, you can save space and bandwidth by piping dd into a compression utility like gzip.

# dd if=/dev/sda3 | gzip -c > sda3-home.dd.gz
11597258+0 records in
11597258+0 records out
5937796096 bytes (5.9 GB) copied, 10.1747 s, 584 MB/s

The partition was about six gigabytes, but compressed it’s a lot smaller.

# ls -lh sda3-home.dd.gz
total 3.8G
-rw-r–r– 1 root root 3.8G Feb 19 06:47 sda3-home.dd.gz

I can get a checksum of the image to verify it is what I expect it to be, by using sha1sum.

# gzip -cd sda3-home.dd.gz | sha1sum
f0fe480abc1489dfac379b68f6095a7fd6c0c959 -

Posted by admica   @   19 February 2010

Related Posts

Like this post? Share it!

Digg Twitter StumbleUpon Delicious Technorati Facebook RSS

2 Comments

Comments
Mar 24, 2011
6:35 pm
#1 Ikem :

And I had thought you use sha1sum to compress the files..

Mar 24, 2011
7:22 pm
#2 admica :

You can calculate the cryptographic hash for your iso when you’re done creating or modifying it with sha1sum. Then anyone can calculate the hash again in the future to make sure it’s still the same. If the file has been changed in any way the hash won’t be the same.

Leave a Comment

Name

Email

Website

Previous Post
« Windows Live Hotmail is Garbage
Next Post
Exploitable Adobe Download Manager »
Powered by Wordpress   |   Lunated designed by ZenVerse