Search code examples
linuxmd5dd

How to MD5 a partial dd-image


I have received a .dd-image of an sd-card. Along with it came the MD5 checksum of the entire file, and what appears to be MD5 sums of the partial file, every gigabyte to be precise.

Can anybody tell me how I check the MD5 sums of a partial .dd-image?

The md5-sums:

0 - 1073741824: ba2b47b7daa8e17f06d654fd4b65ebe0
1073741824 - 2147483648: cfa0a3db105c939db30506cd320f7e6c
2147483648 - 3221225472: 7c26b8750884026ee625928ff4eb56a2
3221225472 - 4294967296: 97371e4896c4237f13688caba3be6fd0
4294967296 - 5368709120: 591aef42a58947529dcc1e69833db41d
5368709120 - 6442450944: 18e133d3d403e9f3fe6de83dbeb85446
6442450944 - 7516192768: cfa0a3db105c939db30506cd320f7e6c
7516192768 - 8589934592: 7c26b8750884026ee625928ff4eb56a2
8589934592 - 9663676416: 97371e4896c4237f13688caba3be6fd0
9663676416 - 10737418240: 591aef42a58947529dcc1e69833db41d
10737418240 - 11811160064: 18e133d3d403e9f3fe6de83dbeb85446
11811160064 - 12884901888: cfa0a3db105c939db30506cd320f7e6c
12884901888 - 13958643712: 7c26b8750884026ee625928ff4eb56a2
13958643712 - 15032385536: 97371e4896c4237f13688caba3be6fd0
15032385536 - 15931539456: dbde266ea52d67cb3c125cf418161e29

Solution

  • You can try something like that:

    dd if=your.bin ibs=1 count=1073741824 | md5sum
    dd if=your.bin ibs=1 skip=1073741824 count=1073741824 | md5sum
    ...
    

    If this is working, you could try to optimize the speed of dd by changing the size of the block:

    dd if=your.bin bs=1024 count=1048576 | md5sum
    dd if=your.bin bs=1024 skip=1048576 count=1048576 | md5sum
    ...