After power failure (RPi4) can only reboot after repairing SSD on my PC

Have been running Home Assistant successfully for some months.

Core 11.2
Raspberry Pi4
SSD (USB NVMe), filesystem FAT

After a power failure, the server would not start. I waited many hours, SSD / networks lights were blinking, but I could not ping the server and could not connect to it.

I disconnected the SSD, connected it to my windows 11 computer (it could not recognize the files on SSD), and repaired the disk (properties->tools_>check)

It took only a few seconds, and the files appeared on my PC explorer.

After that the homeassistant server started after immediately.

Question: is there some option to recover automatically? Without having to repair the disk on a separate device?

FAT is not the best filesystem to handle power failures.
FAT filesystems have a file allocation list in the beginning and end of the system and whenever a file is changed then first one file allocation list is updated then the other.
If a power failure is happening when the tables are updated then when the system gets power again it will have 2 different tables and it gets confused and stops.
You then need a repair to select the correct list and overwrite the wrong one with the correct one. The two lists is actually an improvement over earlier versions with only one list, which meant everything was often lost when a power failure occured .
The problem is that HA is writing a lot, so you are likely to end up in a situation with a confused OS.
There are other systems that handle it better due to a journaling setup, like NTFS (Microsoft’s version of such one), EXT4 (Linux’s version) and HPFS (I think that is what Apple calls their version).

How did you even install HA (what type?) that you end up having your OS on a FAT partition? Is it a windows 98 with HA in python :crazy_face:

Or was it just the boot partition of HaOS that the raspberries still need to be FAT even in 2023?

I donwloaded from Raspberry Pi imager v1,7,5 the homeassistant image and flashed it to my SSD.

image

HaOS that it is. So you are forced to the fat partition because of your raspberry not being able to use a journaling file system for the boot partition but needs that ancient fat one.

You can only try to don’t have power interrupts with a help of a UPS so your drive is in best case always shut down gracefully.