Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Verifying a DVD is correctly created

  1. #1

    Default Verifying a DVD is correctly created

    opensuse v11.3
    linux 2.6.34.8-0.2-desktop x86_64

    It took me 3 tries to get is ISO image that matched the md5 checksum on the download site. At 8 - 10 hours each it was a PITA. The first simply aborted 1/3 of the way through (HTTP direct link). The second used wget, got a full file but the checksums didi not match. The magic method was Bitorrent.

    All this has left me with an uneasy feeling about the contents of the DVD created from the ISO. Is there a way to test the DVD contents?

  2. #2
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: Verifying a DVD is correctly created

    When you install openSUSE, there is an option at the front of the installation to check your media. Also, in YaST / Software / Media Check, can also check the media if you have a running openSUSE copy. I would assume a LiveCD would offer the same, but the media check during the installation may be your option. Just boot from the disk, select Installation and look for the media check option.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  3. #3
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Verifying a DVD is correctly created

    On 2011-04-30 22:06, jimoe666 wrote:

    > got a full file but the checksums didi not match. The magic method was
    > Bitorrent.


    Metalinks with aria2c.

    > All this has left me with an uneasy feeling about the contents of the
    > DVD created from the ISO. Is there a way to test the DVD contents?


    The program you used to burn dvds should have feature. K3b does.

    In console, I use this in a script:

    Code:
    ---------------
    cmp --bytes=$(wc -c <$1) /dev/dvd $1
    ---------------

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.2 x86_64 "Emerald" at Telcontar)

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Verifying a DVD is correctly created

    That --bytes=$(wc -c < $1) is redundant. If you assume that $1 is correct, and you do a normal cmp without --bytes, then

    if there is a mismatch anywhere, cmp will say so, same behvaviour
    if /dev/dvd is shorter, cmp will say EOF on /dev/dvd, same behaviour
    if /dev/dvd is the same size, and there is no mismatch, cmp will exit silently, same behaviour
    if /dev/dvd is longer, cmp will say EOF on $1, which is the case where there is a difference but it's good to know that something has been padded to the DVD (which shouldn't happen actually, but the DVD is still usable)

    So in short, if you don't mind ignoring EOF on $1 as correct, you can save one read of $1.

  5. #5
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Verifying a DVD is correctly created

    On 2011-05-01 02:06, ken yap wrote:
    >
    > That --bytes=$(wc -c < $1) is redundant. If you assume that $1 is
    > correct, and you do a normal cmp without --bytes, then


    No, it is not redundant.

    We discussed that code time ago in one of the mail lists. We had the
    problem that a direct cmp would fail, because, apparently, the burned image
    is sometimes bigger than the iso file, because the burner can round the
    size up to a figure multiple of 8 KiB or something. That tail is empty, not
    used, but still a direct compare will try to compare that part and say
    there is a size mismatch.


    > So in short, if you don't mind ignoring EOF on $1 as correct, you can
    > save one read of $1.


    No, it is instantaneous. Try.


    I'll save you time:

    cer@Telcontar:~> time wc -c <
    /home/cer/download/Firefox_downloads/openSUSE-11.4-DVD-x86_64.iso
    4614782976

    real 0m0.002s
    user 0m0.000s
    sys 0m0.002s

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.2 x86_64 "Emerald" at Telcontar)

  6. #6
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Verifying a DVD is correctly created

    That's what I meant by if you accept that EOF on $1 is harmless. BTW it's not the burner that pads the burn, it's the software. The image is already padded so that precaution is unnecessary, but harmless.

    You probably got an instantaneous response from the wc because you had the blocks cached in RAM.

    And if you really want to be more thorough with the checking you should only compare as many 2048 byte blocks as the ISO image specifies. That will also catch some $1 errors. But in this case $1 is known to be good.

  7. #7
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Verifying a DVD is correctly created

    On 2011-05-01 04:06, ken yap wrote:
    >
    > That's what I meant by if you accept that EOF on $1 is harmless. BTW
    > it's not the burner that pads the burn, it's the software. The image is
    > already padded so that precaution is unnecessary, but harmless.


    That's the theory, but not the fact. As I said, we had to made that code up
    because the images we had did not pass a plain cmp test. The line of code
    was not designed for pleasure, but because we had a problem.

    You can dig out the thread in the mail list where we discussed the matter
    and the explanations were found. I had images that did not compare to the
    dvd, I asked, and got answers. The why it happened and how to solve it.

    If you look up in the manuals, you will see that the padding is optional,
    at least with some CLUs.

    > You probably got an instantaneous response from the wc because you had
    > the blocks cached in RAM.


    Most certainly not. Thats the ~4 GiB iso of the distribution, and I haven't
    used it in two weeks. Look, I'll repeat the test with another file I
    haven't used in months:

    cer@Telcontar:~> time wc -c < /data/storage_a/imgs/crypta_f1_dvd.mm.xfs
    4700012544

    real 0m0.019s
    user 0m0.000s
    sys 0m0.002s

    By the way: the image above is for a DVD, but not ISO.

    Another one, 11GB in size:

    cer@Telcontar:~> time wc -c < /data/storage_b/copias_vmware/OpenSuSE\
    11.1/OpenSuSE\ 11.1-flat.vmdk
    11274289152

    real 0m0.002s
    user 0m0.001s
    sys 0m0.000s


    Try it yourself.


    > And if you really want to be more thorough with the checking you should
    > only compare as many 2048 byte blocks as the ISO image specifies. That
    > will also catch some $1 errors. But in this case $1 is known to be good.


    $1 is the image file, and its exact size determines the comparison. It
    doesn't matter if the DVD is bigger.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.2 x86_64 "Emerald" at Telcontar)

  8. #8
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Verifying a DVD is correctly created

    What I am pointing out is that $1 is sometimes larger than it needs to be due to padding added by the release and even if the pad blocks are in error, it will not affect correctness of the DVD. But that's a very small probability of a false negative.

    Looks like the GNU people coded cmp to look at FD 0 and if it's a file do a stat() for the size as an optimisation. It should be interesting to verify this by doing a strace on cmp.

  9. #9
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Verifying a DVD is correctly created

    Sorry, I meant wc, not cmp. The things you remember after the 10 minute deadline has passed.

  10. #10
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Verifying a DVD is correctly created

    On 2011-05-01 12:06, ken yap wrote:
    >
    > Sorry, I meant wc, not cmp. The things you remember after the 10 minute
    > deadline has passed.


    Yes, wc. I know, I was very surprised when they told me that trick. I
    thought the same as you did, that it would be very slow. And behind a pipe!
    But no, it simply reads the size somehow.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.2 x86_64 "Emerald" at Telcontar)

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •