On Mon, 26 Jun 2023 11:34:45 +0200, Axel Braun <axel.braun@gmx.de> wrote:
Am 26. Juni 2023 10:56:21 MESZ schrieb "Carlos E. R." <robin.listas@telefonica.net>:
Only the DVD can be verified on boot. AFAIK, the USB can not be verified, and last time I tried it will say that the verification failed. The correct result would be that the boot option should refuse to do the verification unless it is an actual DVD, it confuses users. I have not tried this in recent years, though.
With installation media check I meant the downloaded ISO. For sure the checksum will be different *after* burned to the DVD / USB stick
But, if you only read the number of bytes that were written, the size of the ISO file, everything will match, and DVDs and thumbdrives can be verified. This will verify the checksum of a USB stick: #!/bin/bash limited_read() { # usage: limited_read <byte_limit> <device> #sudo dd bs=2K count="${1:?}"B if="${2:?}" status=progress sudo pv -B 2K -S -s "${1:?}" "${2:?}" } USBSTICK_DEVICE=/dev/<sdX> ISO="openSUSE-Leap-15.5-Rescue-CD-x86_64-Media.iso" CHKFILE="$ISO".sha256 ISOSIZE="$(stat -c '%s' -- "$ISO")" # Need a separate directory to create a "fake" Iso file for 'sha256sum' mkdir check || exit ln -s -t check -- ../"$CHKFILE" ln -sT -- /dev/stdin check/"$ISO" # sudo umount "$USBSTICK_DEVICE" ( cd check || exit limited_read "$ISOSIZE" "$USBSTICK_DEVICE" \ |sha256sum -c "$CHKFILE" ) rm -r check The problem is, you need to know the size of the original iso file. If you only have a written USB stick, and a checksum file, is there a way to determine the size of the image on the USB stick? -- Robert Webb