I’ve lost household power several times (so far no issue other than an IP address change) but would like to know if a loss of power/power cycle will corrupt the SD card/render Rhasspy unusable?
Currently, the headless RPi 4 is only used for Rhasspy (Docker + Node-RED) and I was reading the below as a possible solution if able?
Well, in general, cutting power to a machine like a Pi or laptop is potentially dangerous.
So yes, a power outage could corrupt the sd card.
That said, I often just pull the plug an a Pi instead of reboot/shutdown and never had any issues.
Using a SSD instead of the SD card is another popular approach. Fortunately there are a number of options (especially given that a RasPi 4 is fairly low power). It all comes down to the impact and risk of a failure vs the cost and complexity of a solution.
Personally I make sure I have a backup and a copy of the microSD card. Easy and cheap - but i expect it will take a while before I notice the outage and swap SD cards.
You’re correct that a sudden power-cycle can invalidate data in the SD card. We’ve actually designed balenaOS to mount root partition as read-only, to ensure the host OS is stateless. More information about the architecture here .
Moreover, balenaEngine syncs directly to disk as it pulls any image (as opposed to docker/moby, which pulls to memory first), and unless the whole of the image arrived it won’t be used.
The above means that the devices are protected against power-cycle/loss. This doesn’t include application data though. If your application does write to disk, you’ll need to make sure such cases are taken care of.