Resin for device with frequent power loss

I have a headless RPi Zero W project that I would like to migrate to resin. The project is expected to experience sudden power loss as the user will likely just cut the power whenever he want to turn of the board.

In the Raspbian Stretch Lite I have handled this by mounting the SD card as read only after proper setup which works well. I know Resin can handle network loss etc. during download and handover etc. But how is Resin likely to handle frequent power loss?

ResinOS creates partitions based around their function to contain the risk from write interruption. There is a /data partition that the running application can write to, which persists across application updates. There are also image downloads, which are independently stored and managed. However the HostOS and application image are kept separate from these.

@sqweelygig

Do I interpret your answer correctly, if I believe I’m safe?

I can’t help but feel like I’m walking into a trap here, but one of the things ResinOS tries its best to protect against is unexpected power outages.

I completely realize that there are no guarantees :slight_smile:

I just needed a little clarification on the matter. I’ll give it a try at some point!

From one of my colleagues (pasted verbatim because it has no secrets and mildly amuses me)

@sqweelygig you can tell them that:

  • balena adds some changes to docker specifically to avoid problems with power outages
  • the supervisor is designed with atomicity in mind so that power outages don’t cause invalid states
  • everything else in resinOS is designed with this in mind, and the rootfs is read-only (with a read-write overlay for the few things that do need to change over time)

And that that being said, Linux is a very complex system so we probably can’t protect against all possible problems with power outages, especially if the storage hardware itself might break.

That way you can give a sense of security without falling into a trap :slight_smile:

Great response.

Thanks for your always great support!