How to save data persistently on Nerves?

I’d like to save my application data, which is changed on runtime, persistently on Nerves.
Could you tell me how to do it?

I noticed that VintageNet.configure saves its settings persistently.
The data is on /tmp/resolv.conf and /tmp/vintage_net/comms.

Could I use /tmp? Ahh, /tmp is tmpfs.

2 Likes

The app data partition described here is one way: https://hexdocs.pm/nerves/advanced-configuration.html#partitions

3 Likes

@lawik Thanks for the response.

I missed the sentence.

Because the root filesystem is read-only, we also add a read/write partition by default, called app_data and mounted at /root (the root user’s home directory).

/root can be used. vintage_net also use it.

Thanks!

3 Likes