In ISO-8859-1 and related character encodings, the letter ÿ is byte 0xFF (all bits set). That could be consistent with a block of Flash that was erased and never successfully written to. (Pi OS should normally be using UTF-8 encoding, but the byte 0xFF is never valid in UTF-8, so vim will assume the text must be in a legacy encoding, and convert it.)The error at line 604 is the same in both cases, and the error is actually a few lines above 604 and it's a bunch of "Ÿ" characters in vi, in the middle of two package descriptions. I had to delete that package description and the fragment of the one following it to get further.
It is fascinating that multiple people reported the same error at the same place. Assuming image 2025-05-13-raspios-bookworm-arm64.img (desktop, but not the "full" with recommended software version), the <FF>s in the OP start at byte 28672 of /var/lib/dpkg/status. That is exactly seven times the block size of 4096. The file is not fragmented, so there is nothing special about the placement of that block.
I think you are saying that the some of the rest of the file is okay (it should be 35330 lines total)? So it not just that the whole image was truncated at that point?
It is not really possible for a compressed image to give errors in the middle of a file, even if corrupted. After any error the entire rest of the image would be garbage, and not predictable garbage like <FF><FF><FF><FF>.
Statistics: Posted by jojopi — Sat Jul 26, 2025 10:24 pm