SQUASHFS error: Unable to read fragment cache entry

Anyone else seeing lots of squashfs errors in dmesg? I see lots of these, both when booting from SD or EMMC so I don’t think it’s media related.

[   33.237519] SQUASHFS error: xz decompression failed, data probably corrupt
[   33.244357] SQUASHFS error: squashfs_read_data failed to read block 0xa36ee
[   33.251366] SQUASHFS error: Unable to read fragment cache entry [a36ee]
[   33.258112] SQUASHFS error: Unable to read page, block a36ee, size 17028
[   33.264783] SQUASHFS error: Unable to read fragment cache entry [a36ee]
[   33.271428] SQUASHFS error: Unable to read page, block a36ee, size 17028
[   40.966062] SQUASHFS error: xz decompression failed, data probably corrupt
[   40.972891] SQUASHFS error: squashfs_read_data failed to read block 0xa36ee
[   40.979821] SQUASHFS error: Unable to read fragment cache entry [a36ee]
[   40.986421] SQUASHFS error: Unable to read page, block a36ee, size 17028
[  119.288760] SQUASHFS error: xz decompression failed, data probably corrupt
[  119.295607] SQUASHFS error: squashfs_read_data failed to read block 0xa36ee
[  119.302513] SQUASHFS error: Unable to read fragment cache entry [a36ee]
[  119.309092] SQUASHFS error: Unable to read page, block a36ee, size 17028
[  119.315765] SQUASHFS error: Unable to read fragment cache entry [a36ee]
[  119.322324] SQUASHFS error: Unable to read page, block a36ee, size 17028
[  119.328999] SQUASHFS error: Unable to read fragment cache entry [a36ee]
[  119.335572] SQUASHFS error: Unable to read page, block a36ee, size 17028
[  312.872034] SQUASHFS error: Unable to read fragment cache entry [a36ee]
[  312.878634] SQUASHFS error: Unable to read page, block a36ee, size 17028
[  312.885314] SQUASHFS error: Unable to read fragment cache entry [a36ee]
[  312.891874] SQUASHFS error: Unable to read page, block a36ee, size 17028

Please run badblocks and fsck on your media…maybe rewrite your image

It will be helpful if we know the image

Hi @frank-w, I am pretty sure the media is not the problem as I am seeing those errors on both SD card and eMMC but I did compile badblocks binary to run it on the system. It produced nothing, which makes sense since both my SD card and eMMC on my board are brand new.

root@LEDE:~# badblocks -sv /dev/mmcblk0
Checking blocks 0 to 7634943
Checking for bad blocks (read-only test): done                                                 
Pass completed, 0 bad blocks found. (0/0/0 errors)

The images that I used are the openwrt images:

build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32/mtk-bpi-r2-SD.img
build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/linux-mediatek_32/mtk-bpi-r2-EMMC.img

As far as I am aware there is no “fsck.squashfs”, so which device would you like me to run fsck on?:

root@LEDE:~# lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mtdblock0     31:0    0  512K  1 disk 
mtdblock1     31:1    0  512K  1 disk 
mtdblock2     31:2    0  512K  1 disk 
mtdblock3     31:3    0  512K  1 disk 
mtdblock4     31:4    0   32M  0 disk 
mtdblock5     31:5    0   32M  0 disk 
mtdblock6     31:6    0    1G  0 disk /rom
mtdblock7     31:7    0 1001M  0 disk /overlay
mtdblock8     31:8    0    2G  0 disk 
mtdblock9     31:9    0  4.2G  0 disk 
mmcblk0      179:0    0  7.3G  0 disk 
mmcblk0boot0 179:8    0    4M  1 disk 
mmcblk0boot1 179:16   0    4M  1 disk 
mmcblk0rpmb  179:24   0  512K  0 disk 
root@LEDE:~# mount
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/mtdblock7 on /overlay type jffs2 (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
root@LEDE:~# 

Rewriting the image doesn’t really help as this tends to show up again and again.

System tries to load an xz-compressed file as squashfs…so you need to find this file and check/replace it. This is the first error you see…maybe there was a problem while building the image

No this didn’t happen during build, this system booted fine with no errors. It seems to happen once I edit something on the /, like settings in /etc and so forth.

That’s when I start seeing those problems.

So I did a little test, I wrote the SD image onto an SD card. Booted the system. Waited until jjfs2 initialized it’s empty space.

Then I logged into the system, ran dmesg to verify that there were no squashfs errors. There weren’t.

I typed in poweroff, once the system printed out “system halted” I unplugged the power. Waited couple of seconds. Inserted the power again, booted the system and when the system got the last printout that it usually does, which is about br-lan, (13 seconds later) I hit enter on the serial and that’s when the squashfs errors popped up on the console.

[   42.968274] br-lan: port 3(lan2) entered forwarding state
[   55.830058] SQUASHFS error: xz decompression failed, data probably corrupt
[   55.836941] SQUASHFS error: squashfs_read_data failed to read block 0xa36ee
[   55.843854] SQUASHFS error: Unable to read fragment cache entry [a36ee]
[   55.850494] SQUASHFS error: Unable to read page, block a36ee, size 1708c
[   55.857229] SQUASHFS error: Unable to read fragment cache entry [a36ee]
[   55.863795] SQUASHFS error: Unable to read page, block a36ee, size 1708c
[   55.870519] SQUASHFS error: Unable to read fragment cache entry [a36ee]
[   55.877138] SQUASHFS error: Unable to read page, block a36ee, size 1708c
[  117.786206] SQUASHFS error: Unable to read fragment cache entry [a36ee]
[  117.792777] SQUASHFS error: Unable to read page, block a36ee, size 1708c
[  117.799476] SQUASHFS error: Unable to read fragment cache entry [a36ee]
[  117.806078] SQUASHFS error: Unable to read page, block a36ee, size 1708c

Then ssh-ed into the system and that gave out an io error.

test@test:~$ ssh [email protected]


BusyBox v1.26.2 () built-in shell (ash)

cat: read error: I/O error
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@LEDE:~# dmesg|grep "SQUASHFS error"
[   55.830058] SQUASHFS error: xz decompression failed, data probably corrupt
[   55.836941] SQUASHFS error: squashfs_read_data failed to read block 0xa36ee
[   55.843854] SQUASHFS error: Unable to read fragment cache entry [a36ee]
[   55.850494] SQUASHFS error: Unable to read page, block a36ee, size 1708c
[   55.857229] SQUASHFS error: Unable to read fragment cache entry [a36ee]
[   55.863795] SQUASHFS error: Unable to read page, block a36ee, size 1708c
[   55.870519] SQUASHFS error: Unable to read fragment cache entry [a36ee]
[   55.877138] SQUASHFS error: Unable to read page, block a36ee, size 1708c
[  117.786206] SQUASHFS error: Unable to read fragment cache entry [a36ee]
[  117.792777] SQUASHFS error: Unable to read page, block a36ee, size 1708c
[  117.799476] SQUASHFS error: Unable to read fragment cache entry [a36ee]
[  117.806078] SQUASHFS error: Unable to read page, block a36ee, size 1708c

So this doesn’t seem a build or media problem, this seems to be a run-time code problem. It must be that jjfs2 block init that is causing issues. I’m surprised nobody else is seeing this on openwrt branch by @garywang