I always thought this was hard to do until I found this little tidbit on Stack Exchange. Credit to : Julien Palard
Here's how you can do it
First you'll need to know the size of the file:
stat -c '%s' ~/Downloads/kubuntu-18.04-desktop-amd64.iso
In this case, the results are
1868038144
You need a reasonable byte count to work with so the process doesn't take too long. 4096 is a good place to start. Your file size divided by the byte count must have a zero remainder or you'll check too few or too many bytes, yielding a wrong checksum.
1868038144 / 4096 = 456064.000000
Since 4096 * 456064 = 1868038144, 4096 is good for this example, so I can use a block size of 4096 (typical) and a block count of 456064.
Now I can check the written USB stick with
dd if=/dev/sdb bs=4096 count=$(($(stat -c '%s' ~/Downloads/kubuntu-18.04-desktop-amd64.iso) / 4096)) | sha1sum
and compare the output to the published sha1sum.
I think this will have to be put into a Dolphin Service Menu soon!
Here's how you can do it
First you'll need to know the size of the file:
stat -c '%s' ~/Downloads/kubuntu-18.04-desktop-amd64.iso
In this case, the results are
1868038144
You need a reasonable byte count to work with so the process doesn't take too long. 4096 is a good place to start. Your file size divided by the byte count must have a zero remainder or you'll check too few or too many bytes, yielding a wrong checksum.
1868038144 / 4096 = 456064.000000
Since 4096 * 456064 = 1868038144, 4096 is good for this example, so I can use a block size of 4096 (typical) and a block count of 456064.
Now I can check the written USB stick with
dd if=/dev/sdb bs=4096 count=$(($(stat -c '%s' ~/Downloads/kubuntu-18.04-desktop-amd64.iso) / 4096)) | sha1sum
and compare the output to the published sha1sum.
I think this will have to be put into a Dolphin Service Menu soon!
Comment