k3os config partition: persisting /var/lib development state across reboots without manual disk orchestration
0 reputation · 09 Jan 2026, 19:41 UTC
Repeatable dev environment on k3os
I am setting up a repeatable development environment on k3os (v0.21.x-era releases, k3s v1.21+ assumed) and want host-level state to survive reboots the same way the OS configuration does. My understanding is that k3os keeps its declarative config on a dedicated partition mounted at /k3os/config, so kernel parameters, the packages: list, and runtime settings persist across rebuilds while the root filesystem stays read-only.
Where the model breaks down
The unresolved part for me is stateful data. Changes under /var/lib or /etc appear to be lost on reboot unless a separate block device is mounted via the disks: section of the config. That makes a single-node dev box awkward: I would like container images, local volumes, and a few host-side tools to persist without hand-managing extra disks on every machine I provision.
Questions
- Is mounting a dedicated device at
/var/lib(or a subpath) through thedisks:section the only supported way to keep stateful development data across reboots, or does the config partition itself allow any writable host paths? - If a
packages:entry diverges from k3s default data directories, are there documented overlayFS precedence conflicts I should verify before relying on this in a repeatable setup?