dd errors with certain DVDs

Cameron Simpson cs at zip.com.au
Sun Mar 25 23:26:05 UTC 2007


On 25Mar2007 14:49, Paul Smith <phhs80 at gmail.com> wrote:
| On 3/25/07, Charles Curley <charlescurley at charlescurley.com> wrote:
| >The dd command is quite reliable. It does exactly what you tell it to
| >do, not what you think you told it to do. Had you given it a count of
| >sectors to read (calculated to match exactly the size of the ISO), it
| >would have read only those sectors. [...]
|
| The script I use is the following:
| 
| -------------------------------------------
| #!/bin/sh
| 
| blocos=`echo $(( $(ls -l "$1" | awk '{ print $5 }') / 2048 ))`
| disksum=`dd if=/dev/dvd bs=2048 count=$blocos | md5sum - "$1"`
| 
| echo "$disksum"
| -------------------------------------------
| 
| So, it does give the bs and count parameters to dd. Notwithstanding, I
| get an error with dd. For other DVDs, this very script has worked
| fine.

Your script is buggy (and needlessly complex). It can round the block
count down by one.  Try this:

  blocos=$(ls -l "$1" | awk '{ print ($5+2047) / 2048 }')

It is at least arithmetically correct. Whether it changes real world
behaviour remains to be seen - the depend on how the contructor of the
ISO image works.
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

Don't part with your illusions.  When they are gone, you may still exist, but
you have ceased to live.        - Mark Twain




More information about the fedora-list mailing list