# CD / DVD verfiy mystery

## xiber

Burned CD/DVD verfication inconsistancy. Burned a lot of cd's/dvd's in my time, first time I really noticed this issue.

The Setup: (the LITE-ON drive is hdc)

```
-> cdrecord -scanbus

Cdrecord-ProDVD-ProBD-Clone 2.01.01a57 (i686-pc-linux-gnu) Copyright (C) 1995-2009 Jörg Schilling

Linux sg driver version: 3.5.27

Using libscg version 'schily-0.9'.

scsibus1001:

        1001,0,0 100100) 'LITE-ON ' 'DVDRW SHW-160P6S' 'PS0C' Removable CD-ROM

        1001,1,0 100101) 'SONY    ' 'DVD-ROM DDU1611 ' 'GYS1' Removable CD-ROM

        1001,2,0 100102) *

        1001,3,0 100103) *

        1001,4,0 100104) *

        1001,5,0 100105) *

        1001,6,0 100106) *

        1001,7,0 100107) *
```

Verify Method 1:

```
md5sum /dev/hdc
```

Verify Method 2:

```
device=/dev/hdc

blocksize=`isoinfo -d -i $device | grep "^Logical block size is:" | cut -d " " -f 5`

blockcount=`isoinfo -d -i $device | grep "^Volume size is:" | cut -d " " -f 4`

readcd -v dev=$device f=- sectors=0-$blockcount | md5sum
```

ISO (1):

```
mkdir test

dd if=/dev/zero of=./test/test_file bs=1024K count=600

mkiosfs -J -r -l -iso-level 2 -o test.iso ./test

md5sum test1.iso

6ac39ef29adbc99a52b0ac19c000e150  test1.iso

```

ISO (2): (pre-made, 3.7GB)

```
md5sum test2.iso

6b41448e4cb81f643230f7b971b169c3  test2.iso
```

CD-R Media burning test results for ISO (1):

Verify Method 1 and Verify Method 2 both yeild (correct):

```
6ac39ef29adbc99a52b0ac19c000e150
```

DVD+R Media burning test results for ISO (1):

Verify Method 1 yeilds (incorrect):

```
18b8c23517447283c4d41f1c425da2e2
```

Verify Method 2 yeilds (correct):

```
6ac39ef29adbc99a52b0ac19c000e150
```

DVD+R Media burning test results for ISO (2):

Verify Method 1 yeilds (correct):

```
6b41448e4cb81f643230f7b971b169c3
```

Verify Method 2 yeilds (incorrect):

```
5eb31609a3d4e2d839fbf6e083dd4470
```

With the DVD+R burn, ISO (1) and ISO (2) can be verified as correct but just not using the same method.  So what am I missing here? What's the best verfication method for burned DVD media?

----------

## eccerr0r

I've had some really weird issues with verifying burned images that I tracked down to defective IDE ports (random corruption) and defective RAM (one bad bit in RAM).  Not sure if you're seeing the same issues I saw when I couldn't get my ISO images to verify.

----------

## xiber

Perhaps not a mystery, just my lack of understanding. For ISO (2), isoinfo -d -i /dev/hdc and isoinfo -d -i big.iso both yeild:

```
Logical block size is: 2048

Volume size is: 1813689
```

So with blocksize=2048 and blockcount=1813689, using dd:

```
$ dd if=$device bs=$blocksize count=$blockcount conv="notrunc,noerror" | md5sum

5eb31609a3d4e2d839fbf6e083dd4470  -

1813689+0 records in

1813689+0 records out
```

Which is the same incorrect md5sum as with readcd.

But if I do the following, (without specifing blockcount):

```
dd if=$device bs=$blocksize conv="notrunc,noerror" | md5sum

6b41448e4cb81f643230f7b971b169c3  -

1813760+0 records in

1813760+0 records out
```

Which is the corrent md5sum but with a different blockcount. I guess I can attribute these extra blocks to the method used to write the DVD, clv/cav/etc, I think. Which means specifing the blockcount taken from the original iso may NOT yeild the desired result.

But this still dosen't explain (to me) why 

```
md5sum /dev/hdc
```

yeilds the wrong results on DVD ISO(1).

----------

