Composefs backend: /var unmount fails (at first)
- Dominant language
- Rust
- Stars
- 2.3k
- Forks
- 230
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 38
Description
I think this is a systemd shortcoming but one the project should be aware of. I tried to start a discussion here: https://github.com/bootc-dev/bootc/discussions/2333 and after messing with it a lot came to the conclusion there is an issue.
When using composefs, systemd fails to unmount `/var` (I think it later successfully unmounts it during the shutdown/ramdisk phase).
On standard Silverblue installed with bootc it works fine.
I believe its because systemd is not aware of `/var` so much when using pure composefs.
with Ostree
```
$ cat /run/systemd/generator/var.mount
##
# Automatically generated by ostree-system-generator
##
[Unit]
Documentation=man:ostree(1)
DefaultDependencies=no
ConditionKernelCommandLine=!systemd.volatile
After=local-fs-pre.target sysroot.mount
Before=local-fs.target
[Mount]
Where=/var
What=/sysroot/ostree/deploy/default/var
Options=bind,slave,shared
```
With composefs (pure)
```
$ systemctl status var.mount
● var.mount - /var
Loaded: loaded (/proc/self/mountinfo)
Active: active (mounted) since Mon 2026-07-27 13:05:52 BST; 5min ago
Invocation: 2f58249fc3cb42b5a7a3082a8853152d
Where: /var
What: /dev/vda2
```
With composefs it has to learn about the mount retrospectively from `/proc/self/mountinfo` whereas something has generated the mount already for ostree.
## Workaround
Create: `/etc/systemd/system/systemd-journal-flush.service.d/override.conf`
```
[Unit]
Requires=var.mount
```
Most other workarounds for general `/var` not unmounting properly dont seem to work.
Contributor guide
Research direction
Start by reproducing the pure-composefs boot and comparing the generated /run/systemd/generator/var.mount behavior with the /proc/self/mountinfo entry. Read the linked discussion and examine the systemd-journal-flush.service.d/override.conf workaround. Done means the cause and an appropriate project-side fix or limitation are established, with /var unmounting correctly without the workaround if a fix is possible.
Written by the indexing model from the issue text.
Assessment
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100