Persistent storage for app data when image is updated?

Hi

Our application stores some configuration data for the system. It runs in a Docker Container using a volume from the system for storing this persistent data.

How can we make this data persistent when we update the Torizone image?

Make a small partiotion for that?
Use the 2Kb I2C EEPROM on the Versin module?

Thomas

Hi,

So the 2Kb EEPROM is not intended to be used by the user it is more for config data from toradex.
On the other topic I need to check with a torizon expert.

Regards,

Matthias

Greetings @TJO,

Regarding persistent data that isn’t affected by updates. It sounds like you are already utilizing Container volumes, which is good. The question is where are the volumes located on the host system?

The update mechanism we use (OSTree), treats certain directories “specially”. For example the /etc directory does a 3 way merge during an update, retaining previous information instead of overwriting it completely. Then there is also /var which is completely ignored in updates. This is why containers are retained after an update since /var is where container metadata is stored.

I would suggest you use /etc as your bind-mount/volume location. This will give you persistent container data that shouldn’t be wiped out by an update.

Best Regards,
Jeremias

Hi Jeremias,

Thanks for the answer. I will locate my containers volume in “/etc” directory

What if I bundle our application container as part of the complete image/system and than do an update? Does this still not overwrite the volumes at “\etc”?

Thomas

and also. If I do a recovry update. Do all data in “\etc” get deleted?

Does this still not overwrite the volumes at “\etc”?

If you design your system carefully it shouldn’t. To explain further when OSTree does an update of the system it performs a 3-way merge at /etc. It merges the local /etc content, the /etc content from the 1st version of the system, and then the /etc content from the 2nd version you are updating to. Say for example you’re volume is at /etc/myapp, if you update to a version of the system that has content at /etc/myapp then it may get overwritten during the update. Otherwise if you’re careful about this then you should be fine.

If I do a recovry update. Do all data in “\etc” get deleted?

I assume you mean do a recovery then flash a new image with Easy Installer? In this case the entire filesystem gets wiped out. Easy Installer is a flashing tool not an updating tool.

Best Regards,
Jeremias