My RPi HASSio started to keep rebooting every minute or so in a vicious cycle due to squashfs errors. Taking card out with following partitions
❯ sudo file -s /dev/mmcblk0p*
/dev/mmcblk0p1: DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "mkfs.fat", sectors/cluster 4, reserved sectors 4, root entries 512, Media descriptor 0xf8, sectors/FAT 64, sectors/track 32, heads 64, sectors 65536 (volumes > 32 MB), serial number 0xed2c3766, label: "hassos-boot", FAT (16 bit)
/dev/mmcblk0p2: Squashfs filesystem, little endian, version 4.0, lzo compressed, 10035612 bytes, 2 inodes, blocksize: 131072 bytes, created: Wed Mar 13 12:14:48 2024
/dev/mmcblk0p3: Squashfs filesystem, little endian, version 4.0, lz4 compressed, 147597885 bytes, 6513 inodes, blocksize: 131072 bytes, created: Wed Mar 13 12:14:46 2024
/dev/mmcblk0p4: Squashfs filesystem, little endian, version 4.0, lzo compressed, 10060442 bytes, 2 inodes, blocksize: 131072 bytes, created: Thu Apr 11 10:41:13 2024
/dev/mmcblk0p5: Squashfs filesystem, little endian, version 4.0, lz4 compressed, 154625010 bytes, 6575 inodes, blocksize: 131072 bytes, created: Thu Apr 11 10:41:12 2024
/dev/mmcblk0p6: OpenPGP Public Key
/dev/mmcblk0p7: Linux rev 1.0 ext4 filesystem data, UUID=a8b08e9b-eb96-41f3-89bc-30f39c592e14, volume name "hassos-overlay" (extents) (64bit) (large files) (huge files)
/dev/mmcblk0p8: Linux rev 1.0 ext4 filesystem data, UUID=d561dff3-3389-47ac-8225-fc8f0c7ea53b, volume name "hassos-data" (needs journal recovery) (errors) (extents) (64bit) (large files) (huge files)
I saw that it is 3 and 5 which are bad:
❯ sudo unsquashfs /dev/mmcblk0p3
Parallel unsquashfs: Using 20 processors
6336 inodes (7027 blocks) to write
[==============- ] 2907/13363 21%
lz4 uncompress failed with error code -15
FATAL ERROR: writer: failed to read/uncompress file squashfs-root/usr/bin/dirname
❯ sudo cat squashfs-root/etc/issue
Welcome to Home Assistant
and
❯ sudo unsquashfs /dev/mmcblk0p5
Parallel unsquashfs: Using 20 processors
6385 inodes (7171 blocks) to write
[================\ ] 3232/13556 23%
lz4 uncompress failed with error code -30307
FATAL ERROR: writer: failed to read/uncompress file squashfs-root/usr/bin/dockerd
I would expect to make it back into working solution if I dump some correct/fixed squashfs images to them (possibly moving those partitions around on sd, but may be no need) and trying to boot again. But how to determine which images to use and where to get them?
If that would work – I wonder if it might be writing a simple generic script which given SD card would “fix it up” that way having determined that some image is bad.