Hi,

Lee wrote:
> [...] I'd spin my wheels trying to
> figure out what's wrong and not too much later say f*kkit and boot off
> my just written USB drive.
> [...]
> $ check_debian_iso SHA512SUMS debian-12.7.0-amd64-netinst.iso /dev/sdb
> ...
> 661651456 bytes (662 MB, 631 MiB) copied, 7.11874 s, 92.9 MB/s
> MISMATCH: '/dev/sdb' checksum differs from 'debian-12.7.0-amd64-netinst.iso' 
> in 'SHA512SUMS'
> [...]
> $ check_debian_iso SHA512SUMS debian-12.7.0-amd64-netinst.iso
> ...
> 661651456 bytes (662 MB, 631 MiB) copied, 2.65785 s, 249 MB/s
> Ok: 'debian-12.7.0-amd64-netinst.iso' matches 
> 'debian-12.7.0-amd64-netinst.iso' in 'SHA512SUMS'

The script correctly truncated the data stream from /dev/sdb to the
size that it read from the superblock of its ISO filesystem.
If the checksums do not match, then some bytes in that range on /dev/sdb
are not as they are in debian-12.7.0-amd64-netinst.iso.


If you are interested in learning where, please keep the stick as it is
now. Especially do not mount its EFI partition and do not plug it into
a running MS-Windows system, which would happily alter bytes in that
partition.

The ISO contains a file /md5sum.txt with MD5 checksums for most of the
files in the ISO. Although MD5 is nowadays easy to counterfei, it still is
a useful transport checksum.

For using that file, i choose two file names which suit me:

  mountpoint=/mnt/iso
  report_file=/tmp/md5_report

and mount the ISO filesystem. You would probably do:

  sudo mount /dev/sdb "$mountpoint"

I let md5sum verify the listed files

  cd "$mountpoint"
  md5sum -c ./md5sum.txt >"$report_file" 2>&1

Finally i look into "$report_file" by a text editor

  view "$report_file"

I search for lines which end by the text snipped ": FAILED".

My report file from debian-12.6.0-amd64-netinst.iso instead of /dev/sdb
shows one failure, to my surprise:
  ./boot/grub/efi.img: FAILED
That's the file which holds the EFI partition. I must have played with it.
The sha256sum result with the .iso file does not match the one in
  
https://cdimage.debian.org/mirror/cdimage/archive/12.6.0/amd64/iso-cd/SHA256SUMS
any more.

So i download debian-12.7.0-amd64-netinst.iso, check its SHA256,
and repeat above check procedure.
This time no lines with ": FAILED" at their end.


Have a nice day :)

Thomas

Reply via email to