You are not logged in.
Pages: 1
Hi,
Is there an alternative to md5sum for caclulating sums for a burned CD/DVD? Something in the line of
$ md5sum /dev/sr0
but another way? Without md5sum utility at all?
Last edited by Llama (2009-03-05 08:38:47)
Offline
There are many other "summing" utilities:
$ pacman -Ql coreutils | grep sum
Last edited by muczyjoe (2009-03-04 10:08:49)
Offline
Hi,
Is there an alternative to md5sum for caclulating sums for a burned CD/DVD? Something in the line of
$ md5sum /dev/sr0
but another way? Without md5sum utility at all?
Why?
And checksums utility are not only used for burned cd/dvd, they can be used with any files.
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline
Sorry, I meant a utility, doing the job of md5sum on md5 sums. Is it any of these:
coreutils /usr/bin/cksum
#coreutils /usr/bin/md5sum
coreutils /usr/bin/sha1sum
coreutils /usr/bin/sha224sum
coreutils /usr/bin/sha256sum
coreutils /usr/bin/sha384sum
coreutils /usr/bin/sha512sum
coreutils /usr/bin/sum
Offline
Why?
Because I'm having a lot of trouble with md5sum, checking burned CD/DVDs, like this:
$ md5sum /dev/sr0
the disk unmounted.
I run the md5sum utility this way on two different boxes, on apparently healthy CDs and DVDs, with unpredictable results. It's either a correct sum, or a wrong sum, or just Input/Output error. Sometimes md5sum takes some time calculating the sum; the result is usually either a correct sum, or an I/O error. Sometimes it gives me a wrong answer right away after giving the initial spin to the disk, without even making a decent show of calculation.
It looks like there's some context to the operation that I'm not aware of.
Offline
Ok so that's much clearer now. I felt like you were hiding something, please don't! Give as much information as you can in your first post and tell us the real problem you have.
Did you try google?
http://www.google.com/search?hl=en&q=md … tnG=Search
It seems like you are not the only one having this problem.
Do you get the same Input/Output error with
cat /dev/sr0 > /dev/null
dd if=/dev/sr0 of=/dev/null
?
Everything works fine on my box, no input/output error. It might only happen with specific drives.
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline
[me@my ~]$ cat /dev/sr0 > /dev/null
cat: /dev/sr0: Input/output error
[me@my ~]$ dd if=/dev/sr0 of=/dev/null
307040+0 records in
307040+0 records out
157204480 bytes (157 MB) copied, 78.3067 s, 2.0 MB/s
[me@my ~]$
For a given CD, at this moment the output is exactly the same for two boxes, one of them a laptop.
I did try google, but without much success. I still can't make much of all this.
Last edited by Llama (2009-03-04 12:00:59)
Offline
If you get I/O errors while reading from your CD (no matter if it's with md5sum, dd, cat or anything else), it's very clearly a hardware issue with your drive or disc.
1000
Offline
but the 'dd'-command went ok!
I haven't actually tested this - but I have a sneaking feeling that 'cat' might well produce an error if used on a plain 'device' (ie /dev/whatever)
To use something other than md5sum won't tell you anything at all, will it?
If we are talking about checking out a downloaded cd/dvd you want to check against the provided md5sum (or possibly the sha1sum).
Offline
The solution: http://forums.debian.net/viewtopic.php?p=213219#213219
#!/bin/bash
#shell script to verify a burned isoISOFILE=$1
echo "Isofile: " $ISOFILE
DVDDRIVE=/dev/sr0
BYTES=2048#Get the number of extends
NROFEXTENDS=$(($(ls -l $ISOFILE | awk '{ print $5 }') / $BYTES ))
echo "Nr of extends: " $NROFEXTENDS#Get MD5 sum of DVD
dd if=$DVDDRIVE bs=$BYTES count=$NROFEXTENDS | md5sum#Get MD5 sum of iso file
md5sum $ISOFILE
Last edited by Llama (2009-04-19 22:15:24)
Offline
I beg to disagree - you _should_ use cdrecord/wodim to burn a cd, _not_ dd though the latter is OK to _read_ from a cd.
If I remember correctly - the blocksize (as used by cdrecord/wodim) is somewhere around 2260 bytes. It most certainly is _not_ 2k.
In short, then:
cdrecord -v driveropts=burnfree dev=/dev/sr0 -dao -eject -data $ISOFILE
dd if=/dev/sr0 bs=4M of=$ISOFILE # you will (almost always) get a partial last block which doesn't matter
Offline
I beg to disagree - you _should_ use cdrecord/wodim to burn a cd
I've used either wodim or k3b for burning. There's not one ruined CD/DVD in evidence: the checking turned out to be a problem.
Offline
The solution: http://forums.debian.net/viewtopic.php?p=213219#213219
Oh, that is interesting
Seems like it might be safer to use isoinfo to find out the logical block size. Or is it always always always 2048? I have no idea
http://www.brunolinux.com/01-First_Thin … d_CDs.html
http://www.brunolinux.com/01-First_Thin … cript.html
Interesting info anyway, thanks.
pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))
Offline
sorry - didn't read the link properly :-(
I would still maintain that you can use 'dd' with _any_ blocksize and pipe the output through md5sum
ie:
dd if=/dev/sr0 bs=4M | md5sum
<edit>
looking at the 'bruno' links above - it would seem that my memory fails me (yet again)
just regard my two posts as 'utter rubbish' please ...
</edit>
Last edited by perbh (2009-03-05 17:13:49)
Offline
Here is another quick & dirty solution (without using isoinfo).
#!/bin/sh
device=$1
pmount $device /media/cd
cdsize=`df /media/cd | tail -n 1 | awk '{print $2}'`
pumount --yes-I-really-want-lazy-unmount /media/cd
dd if=$device bs=1K count=$cdsize | md5sum | cut -f 1 -d " "
Last edited by kfgz (2009-10-13 20:12:33)
Offline
Pages: 1