Checksums differ afer Etching Ubuntu img onto microSD for RPi

Dear community member, I have a problem that I can’t solve myself and would like to ask you for help.

I constantly run into an error when flashing an Ubuntu Server image for a Raspberry Pi (32 bit) to a SanDisk micro SD card.

balena_failure_after_flash_message_Screenshot 2023-03-14 130743

The detailed error is:
Source and destination checksums do not match: 0ceb241e68c609ff !== 03671af93c12efc5
(Found with the dev console in balena Etcher’s log.
see: BalenaEtcher-1678796059697.log (20.3 KB)).

This happens when I try to flash “ubuntu-22.04.2-preinstalled-server-armhf+raspi.img” to a SanDisk Ultra 32GB microSDHC card (model: SDSQUNR-032G-GN3MA).

I’m running:
Balena Etcher v1.18.4 (windows installer version)
On Windows 10 Pro (x64), 21H2, OS-build: 19044.2604
The hardare IDs of my SD cardreader hub are:

USB\VID_05E3&PID_0751&REV_1402
USB\VID_05E3&PID_0751

What I’ve excluded so far:

  1. I’ve checked and validated the integrity of the img file:

$ echo “45b2fb10f63fa2e820d0bd34693d86a507499f6efae1f4848af6601ebfaf8745 *ubuntu-22.04.2-preinstalled-server-armhf+raspi.img.xz” | shasum -a 256 --check
ubuntu-22.04.2-preinstalled-server-armhf+raspi.img.xz: OK

It checks out to be good.

  1. I fully tested the working of the SD card with h2testw.exe (from CT! magazine). All blocks reported in good working order.

  2. I also tested image writing with Etcher setting:
    Trim allocated space on raw images (in ext-type partitions): OFF
    It made no difference. Balena Etcher still reported “Something went wrong”.

  3. After flashing Windows did not auto-mount the SD card, so the SD could not have been altered by Windows before the verification process by Balena Etcher.

Who knows what’s causing this stubborn failure and how can one fix it?

Hello, thank you for the thorough description of the issue and your troubleshooting steps thus far. Have you tried flashing a completely different image to the same SD card to see if it succeeds? Also, although all blocks were reported in good working order, I would try another SD card/reader just to be sure. It sounds like you may have already seen this explanation for the “checksum error”: Checksums do not match - #82 by zvin including a possible cause and workaround for Windows, but if not it’s worth a look as well.

@ alanb128 Thanks for your reply. I devised the following new tests (hypothesis H1-H4) based on it.

  • H1 Try another SD card.
  • H2 Flash a different image file.
  • H3 Exclude Windows interference with Linux
  • H4 Try another SD card reader

H1 It’s the SanDisk card:

See test summary

Turn off Defender real time protection.
Test flashing with a Samsung EVO 32 GB card:
Wipe card quickly with SD formatter.
Write the same image with Balena Etcher via a Trust cardreader.

Result:
Failure in log:

Error: UNKNOWN: unknown error, read
code: "UNKNOWN"
description: "Generic STORAGE DEVICE USB Device"
device: "\\\\.\\PhysicalDrive4"
errno: -4094
name: "Error"
syscall: "read"
message: "UNKNOWN: unknown error, read"
stack: "Error: UNKNOWN: unknown error, read"

Result: Flashing also fails with a Samsung Evo 32GB card.

See Discussion about Windows interference

Discussion:
As soon as the microSD card is mounted a System Volume Information folder is created by Windows. When I check the timestamps of “System Volume Information” then it was created about 7 minutes after validating flashing by Balena Etcher. Inserting another USB device might have triggered it.

7 -rw-r--r-- 1 Marty None     6434 Feb 17 17:29  README
0 drwxr-xr-x 1 Marty None        0 Mar 17 09:24 'System Volume Information'
0 dr-xr-xr-x 1 Marty None        0 Mar 17 09:44  ..

H2 It’s the image.

Test: Flash another image to the same SD card

Result: It FAILS with error: Error: UNKNOWN: unknown error, read

Result: It FAILS with error:

Object
cancelled: false
results:
averageFlashingSpeed: 23578558.323751118
bytesWritten: 53477376
devices: {failed: 1, successful: 0}
errors: Array(1)
0: Error: UNKNOWN: unknown error, read
length: 1
[[Prototype]]: Array(0)
sourceMetadata: {size: 1854418944, name: 'decompressed-image-a9896fd8f75f.tmp', blocks: Array(8), blockmappedSize: 1107296256}
[[Prototype]]: Object
skip: false
[[Prototype]]: Object

H3 Windows interferes and writes in the just written FAT32 partition after flashing.

Also under Linux flashing fails.

As seen by Checksums do not match - #82 by zvin
Test: Write from another platform: Linux.
Result: flashing fails also.

H4 It’s the Trust cardreader.

Try the built in card reader hub: Multiple flash reader USB device:
USB\VID_058F&PID_6363

Result: SUCCESS!!!

Conclusion: The Trust cardreader in combination with Balena Etcher results in flashing failures.

Details about the faulty card reader:
Hardware ID:
USB\VID_05E3&PID_0751&REV_1402
Presumable contains the following chip:
Genesys Logic, Inc. GL835T

Discussion

Discussion
I’ve written many images with the card reader in the past (with Rufus and dd amongst others but also older versions of Balena Etcher). Validating the microSD card reported no failures. Somehow flashing with Balena results in errors, and flashing with RPi imager also results in an error. (BTW When I flash the utbuntu-22.04.2-preinstalled-server-armhf+raspi directly from the RPi on-line repository with the built in Card reader it also works, but it results in version 20.04 being flashed instead of 22.04. So RPi imager has the wrong Server image version in its repository under 22.04.)

@ alanb128 Thank you very much for your help.
I hope others running into the same problem can benefit from my findings.