Is OS Corruption after Power Outage Typical with Pi Install on SD Card?

I've been running HA on a VirtualBox VM on Windows for years with few issues, but trying to reduce power consumption and don't need that PC running 24/7 so moved HA to a Raspberry Pi 4 with a 32GB SD Card.

Worked great several days until I unplugged power to re-arrange cables, plugged it back in and it was stuck in an endless boot loop. Errors like:

decompress mem failed to decompress
Failed to start HASS OS Zram temp
Failed to start config manager
Ensure rauc.db contains version information

Tried a few suggested fixes online and nothing worked.

Ended up re-flashing HA to the SD card and restoring from a backup. Not the end of the world but took a few hours and lost all my energy tracking data during that time, other automations were offline, etc.

I know unplugging a device isn't good practice, and I'll make sure to shut down HA next time, but kind of surprised something as simple as unplugging the power would cause the whole thing to get corrupted that easily. I powered off my VM without shutting down tons of times and nothing ever got corrupted. Is this pretty common or an SD card issue by chance? I've read a few posts that SSDs are better than SD cards so considering that.

Any recommendations are appreciated, thanks!

I've had some unplanned power outages over the years, I've never experienced OS corruption (I run mine on server hardware). Most likely SD-card related imo.

While this is not common, it’s not unexpected either. You did tempt murphy and lost.

Shutting down a computer is recommended because it allows the system to properly close programs, save data, and perform necessary cleanup tasks, which helps prevent data loss and potential hardware damage. Unplugging the computer can lead to data corruption and other issues.

If it’s importaint to you, put a ring or a battery on it :wink:

1 Like

Never trust an sd card to run any sort of OS... or anything that does regular writes - it'll kill it way sooner than you'd expect. As other stated, you were tempting fate with that one. I'm sure most of us have learned this the hard way once and then never did it again. Get yourself an ssd or nvme drive.