Composefs backend: /var unmount fails (at first)

Open
#2,345 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet

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.

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.

Dominant language
Rust
Stars
2.3k
Forks
230
Avg merge
2d 11h
Merged PRs (30d)
42

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bootc-dev/bootc

All issues in bootc-dev/bootc

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.