Kernel panic every time i reboot system

I am using Home Assistant OS on a rapsberry pi5, everything has worked perfectly for weeks.

A few days ago I had a power outage and on rebooting HA never recovered and went into kernel panic loop.

I thought maybe HA was writing to the sd at the time of the outage and therefore the filesystem was corrupted.

I reformatted the sd, put the image back from scratch and did a backup restore. For another couple of days everything seemed normal, but I noticed that the add-ons would not start.

When I tried to start them manually the logs told me that “Add-on xxx is already running” even though from the interface it looked like it wasn’t.

To try to fix it I tried a full reboot (system restart), but again it has died and still gives me the Kernel Panic looping screen.

I really don’t feel like re-installing again is there anything I can do to fix the sd? And why can a complete reboot corrupt the filesystem?

I won’t pretend that I can tell you what the output means on your screen, but I will tell you that in my experience of running HA on a Pi/SD card, it kinda sucks. My SD card died after only a few months of running a fairly small HA instance (few lights, sensors, etc, nothing crazy compared to most).

If you’ve been using this Pi for more than a few months, even if the SD card was brand new, it may be that your SD card is on the way out. The same thing happened to me when mine was dying. HA would crash, wouldn’t boot etc. I was fortunate that I was able to make a backup from the commandline and copy it off to migrate it. I would do the same ASAP and try to move to an SSD or x86 PC/Notebook before it gives up for good. Just my 2 cents.

The error says your file system can’t be mounted. I’d try using a new SD card and follow the process to create and verify a new image. Or try the card in a different slot if there is more than one.

It’s also possible the power surge fried some components of the computer. These things really should be behind a UPS/surge protector.

I would agree with you if it was an old or cheap SD card, but I bought a new one specifically for this purpose, so I chose a very good one with a focus on “high write endurance” to use with the rpi5 I received 1 month ago.
The fact that the problems were never “triggered” by the sd, but it just seems that every time you do a reboot cycle it corrupts the filesystem.

For the future I will definitely think about adding an ssd and an ups will be included in the final installation although I don’t think it is correct that an OS is not able to recover after a power outage. Millions of devices do it without a problem

Does anyone know if I can do anything by putting the sd in the pc to recover or do I necessarily have to start from scratch?

My SD card was already old when I used it so this may be the case, but I’ve heard others report that even these “endurance” SD cards may not last long with HA. Seems to be a lottery where some people get 6 months, others get years from their SD cards. I would imagine this is especially true if your instance is somewhat matured and has lots of historical logs or long term statistics, these things are constantly being written.

In my case, I was able to boot my Pi to commandline where HA wasn’t running but I could use the ha backup command to make a new backup. I then put the SD card in my Windows machine and used DiskInternals Linux Reader to pull the zip file out.

This was also the case for me though. Seemed to work fine once the system was up but it would sometimes crash overnight or if it was rebooted, there was only about a 30% chance it would come back on any single attempt. It took lots of tries to get it back online.

If I were you, my next steps would be making a backup if possible, trying a health check on the SD card (if a bad sector scan for SD cards exists?) and if it’s healthy, following one of the numerous guides online about moving your data disk to an SSD and only using the SD card to boot.