Read only image?


#1

I was just wondering how much writing to the SD cards goes on when using resin images. In my experience using SD cards on Raspberry Pi and other boards is a no-no for remote systems, they will corrupt themselves soon enough.
Ideally any files systems required for boot up should be mounted read only.


#2

Hey,

Thanks for the question. We are very careful not to write to the SD card at all as far as we can - the root file system is read-only.

However we do expose /data which allows persisting of data across power cycles, but this is entirely user-controlled.

Best, Lorenzo


#3

That is excellent. Thanks.

I will be avoiding /data

Presumably the Docker images are written to a different partition and there is some risk associated with upgrading that which cannot be avoided. Then there is environment variable setting.


#4

Yes, indeed the Docker images are located on a separate partition, with careful use of caching wear can be minimised here! See our docs on optimising builds and Docker best practices for tips.

Best, Lorenzo


#5

Correct me if I’m wrong, but it looks like resin.io is using the docker copy-on-write layer to persist runtime state also outside the data partition. This is the default docker behavior.

But I think it would be very useful to (optionally) mount / in the container as read-only. I would consider this best practice for all container based deployment, embedded or not.