Announcement

Collapse
No announcement yet.

Verifying a checksum after burning an ISO to a thumb drive.

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Verifying a checksum after burning an ISO to a thumb drive.

    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!
    Last edited by oshunluvr; Feb 13, 2021, 05:24 PM.

    Please Read Me

    #2
    Hi

    I just wish I could do the kelp farms...cold water...doing the Keys and Cozumel this summer...

    but...I STILL do not get all of "this stuff" about installing on a usb...

    I just install on a usb and it works...

    woodprobablystupidsmoke

    Comment


      #3
      is there a reason you can't do
      Code:
       sha1sum /dev/USBDRIVE
      ? after making the drive
      Mark Your Solved Issues [SOLVED]
      (top of thread: thread tools)

      Comment


        #4
        Originally posted by sithlord48 View Post
        is there a reason you can't do
        Code:
         sha1sum /dev/USBDRIVE
        ? after making the drive
        Yes, surely, if I understand your question. The physical device has no notion of the size of what's on it, only the size of the device.

        For an example (slightly extreme), I have just yesterday downloaded the super grub2 iso, and wrote it to a USB stick. The iso is only about 20 MB, tiny as isos go. When I plug it in, it is /dev/sdd. If I read /dev/sdd, say by
        Code:
           sudo dd if=/dev/sdd of=/dev/null bs=1M status=progress
        It reads all 7.7 GB at about 15 MB/s taking about 8-1/2 minutes. Cheapskate crappy stick, it was sold to me as 8 GB...
        Last edited by oshunluvr; Feb 13, 2021, 05:25 PM.
        Regards, John Little

        Comment


          #5
          Originally posted by jlittle View Post
          It reads all 7.7 GB at about 15 MB/s taking about 8½ minutes. Cheapskate crappy stick, it was sold to me as 8 GB...
          LOL - cheap or not this is probably normal. I assume you knew this, but if you're getting 7.7GB you're better than most.

          Open up Kpartition manager and look at what it says the size is in GiB and check the math.

          GiB
          = 1 Gibibyte = 1,073,741,824 bytes
          GB = 1 Gigabyte = 1,000,000,000 bytes

          My old 16GB USB stick I plugged in is actually reported as 14.91GiB.

          14.91*1073741824=1,600,090,595.84
          16*1000000000=1,600,000,000

          An acceptable difference of 90,596 bytes. The further away you get from 1 the greater the gap between the numbers. Generally, you can expect a capacity of 90% of the advertised size at the Terabyte level. My new 10TB hard drive shows 9.1T (TiB) when using df.

          Please Read Me

          Comment

          Working...
          X