Skip to content

Commit 4769fe2

Browse files
authored
Merge pull request #395 from cgwalters/doc-filesystem
docs: Expand on filesystem /var
2 parents 983ffa0 + 24aed43 commit 4769fe2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

docs/src/filesystem.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,16 @@ mount points (whether network or `tmpfs`)
3535

3636
As of OSTree v2024.3, by default [content in /var acts like a Docker VOLUME /var](https://github.com/ostreedev/ostree/pull/3166/commits/f81b9fa1666c62a024d5ca0bbe876321f72529c7).
3737

38-
This means that the content from the container image is copied at *initial installation time*, and not updated thereafter.
38+
This means that the content from the container image is copied at initial installation time, and *not updated thereafter*.
39+
40+
The rationale for this is to keep operating system upgrades from touching machine-local data by default.
41+
If the system is rolled back to a previous bootloader entry, the `/var` content remains. This also
42+
makes it possible to "stage" new operating system updates in an alternative root without affecting `/var` content.
43+
44+
A common case is for applications to want some directory structure (e.g. `/var/lib/postgresql`) to be pre-created.
45+
It's recommended to use [systemd tmpfiles.d](https://www.freedesktop.org/software/systemd/man/latest/tmpfiles.d.html)
46+
for this. An even better approach where applicable is [StateDirectory=](https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#RuntimeDirectory=)
47+
in units.
3948

4049
## Other directories
4150

0 commit comments

Comments
 (0)