Hass.io goes down - memory card gets corrupted - how to avoid?

Hi,
Have experienced the same problem a couple of times, and want to see what you recommend to avoid it going forward. My hass.io system crashed overnight after an update (was working fine after update but was unreachable the day after). I couldn’t use SSH or any known way to reach it. Therefore, I pulled the power plug, and upon restart I couldn’t get the system to boot. Putting the card in a reader and into a PC gives me the “famous” write protected card error. This means the card is unusable to my knowledge (happened a couple of times).

So, why does this happen and how to avoid it? If I can’t reach the URL in a browser, OR by SSH, how can I shut down the system in a safe way for the future?

Any ideas appreciated!

TJ

Try repairing the filesystems, otherwise you are stuck with your backup.

Having your Pi lock up usually indicates a problem with the power supply. How are you powering the Pi?

1 Like

Change power supply, buy an ssd or buy a real home server.
I went with the third option, hass has been responsive and crash free for more than 3 years now…

1 Like

Running it from the official RPi PSU…
I’m at least getting a new card from the reseller and the other one changed on warranty. Will have to set things up again (hadn’t come to the point where I’ve set up backup).

Are there any ways to “safely” shut down the RPi if I can’t reach it?

TJ

I’ve been running several PI’s for several years without a single failure even with the frequent power outages here on the gulf coast island. I rack it up to buying not the cheapest MicroSD card.

I agree, but both cards that’s messed up here have been Samsung Evo and Evo+ 32gb cards, so they are not the cheapest or the ones with worst quality…

Those are the exact cards I use myself. Blame it on you got from a bad batch.
By the way, if you can SSH to the PI, use the old Unix sequence to safely shutdown;

sync
sync
halt

Some raspberry have power pin to which you can connect a switch to send a shut off signal. Not sure which version had or have that.
There is also ways to use the gpio as input pin for a safe shutdown.

I dont think your problem was caused directly by the power outage. Im was switching my RPi for HASS daily for a year and never experienced any data corruption.