Kernel panic - SD Card superblock bad after power outage?

I recently began having issues with HomeAssistant crashing every few days or so. But after a quick power reset everything works perfectly again.

The system is set up on a Raspberry Pi 3 Model B via the recommended installation instructions.
Everything should be up to date:

arch	          armv7l
chassis           embedded
dev	              false
docker	          true
docker_version	  19.03.8
hassio            true
host_os	          HassOS 4.11
installation_type Home Assistant OS
os_name	          Linux
os_version	      4.19.127-v7
python_version	  3.8.3
supervisor	      229
timezone	      Europe/Berlin
version	          0.113.3
virtualenv	      false

After connecting a display to my Raspberry Pi, I waited for the next time the crash occurred and the following Console-Log was visible:

Every 120 Seconds it repeats:

INFO: task kworker/2:3:31414 blocked for more than 120 seconds.
Tainted: G  C  4.19.127-v7 #1
"echo 0 > proc/sys/kernel/hung_task_timeout_secs" disables this message. 
kworker/2:3 D 31414 2 0x00000020
Workqueue: events_freezable mmc_rescan
(<80988abc>] (schedule) from [<80989244>] (schedule+0x50/0xa8)
[<80989244>] (schedule) from [<8074ee38>] _nc_cat in_host+0xe4/0x238)
[<8074ee38>] (__mmc_claim_host) from [<8074efc4>](mc_get_card+0x38/0x3c)
[<8074efc4>] (mmc_get_card) from [<80758020>] (Anc_sd_detect+0x24/0x7c)
[<80758020>] (mmc_sd_detect) from [<80751474>] (mmc_rescan+0xe8/0x3f8)
[<80751474>] (mmc_rescan) from [<8013c49c>] (process_one_work+0x200/8x4c0) 
[<8013c49c>] (process_one_work) from [<80130568>] (worker_thread+@x4c/0x568) 
[<8013a568>] (uorker_thread) from [<8014305c>] (kthread +0x140/0x17O)
[<8014305c>] (kthread) from [<801010ac>] (ret_from_fork+0x14/0x28)
Exception stack(Ox90eddfb0 to Ox90eddff8)
dfa: 00000000 00000000 00000000 00000000 
dfco: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
dfeo: 00000000 00000000 00000000 00000000 00000013 00000000

(I copied this log from the picture via Google Lens, so this text may not be 100% accurate)

I read online that the “Tainted” part means that the superblock may be bad. I personally couldn’t fix it via “mke2fs” and “e2fsck”.
The SD card is only about half a year old, and is quite top of the line. And I have an external database, so there should be less strain on the SD card in general.
Is the SD card faulty?
HomeAssistant starts and works fine when i power cycle.

Has anybody ever had this problem before?

Thanks!

1 Like

Bad superblock on an SD card after a power failure ? I’ve had them before.

How did you handle it? Did you manage to repair it, or did you just format the card and reinstall?

Putting the card in my debian laptop and trying to repair did not help.Formatting is the only solution.

1 Like

Okay, I will try that next!

If you read the different blogs, having an SD card on the RPi is always a problem. I personally got two different SD cards corrupted and on top of that, I had to reformat a third one. This is in less than a year. The corruption of the card usually happens when you loose power. If you have a RPi3 then you can install HassIO on an USB SSD hard drive and boot directly without having to use a SD card. I highly recommend this option, not only that it will be faster but after I moved to an SSD then I haven’t had this problem.

Faster on a RPI3 using SSD on the USB2 bus. Not a hope. It would certainly be more reliable though. Faster and more reliable on the RPI4 using the USB3 bus. Definitely.

I’ve had 2 SD cards go bad in two different Raspberry Pi devices. Both were supposedly Samsung brand and were from a well known company that sells Pi bundles but I suspect they were counterfeit. They would boot and act like data was being written to files and everything looked good. Eventually, they’d hang and after a power cycle, all the new data was gone and the dates on what were supposed to be new files were several month old.

I tried several tool to repair them but ended up trashing them.

Just encountered this exact error. This is a week old SD card that ran 32 bit for a week and 64 bit for just over 24 hours on my Rpi 3. The green LED near the SD card on my Pi is solid green. I’m just gonna buy an SSD for this… I’ve put that off way too long. This is easily the 5th or higher SD card I’ve used for Home Assistant. Not sure what caused it. It’s on a decent USB power supply with a desktop UPS. Rebooting appears to fix it for now.