You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bootc install to-existing-root fails when the target's parent mount has MS_SHARED propagation #2455
error: Installing to filesystem: Creating imgstorage: Initializing images: No such file or directory (os error 2)
on any host where / (or /run) has MS_SHARED mount propagation, which is systemd's default on most modern Linux distributions. mount --make-private / /run before running the install works around it completely.
Environment
bootc 1.16.10 and 1.16.12 (both affected)
Fedora 44 Cloud Base, reproduced identically on x86_64 (KVM) and aarch64 (TCG)
Fails with the error above, before ever reaching the image pull.
Root cause
CStorage::create() (crates/lib/src/podstorage.rs) spawns podman --root /run/bootc/storage --runroot /proc/self/fd/N images to initialize image storage. The fd is handed to the child via bind_storage_roots()'s pre_exec hook: fchdir(storage_root), unshare(CLONE_NEWNS), mount_bind(".", STORAGE_ALIAS_DIR).
The comment above that code already names the exact failure mode:
EINVAL A bind operation (MS_BIND) was requested where source referred to a mount namespace magic link, but the propagation type of the parent mount of target was MS_SHARED...
Both shared. Running mount --make-private / and mount --make-private /run before bootc install makes the failure disappear. Confirmed with repeated clean installs afterward, on both bootc versions and both architectures.
Since shared is systemd's standard default, this doesn't look like an edge case specific to constrained or virtualized environments. It looks like it would affect most freshly-booted systems attempting to-existing-root.
Suggested fix
bind_storage_roots() (or CStorage::create() before calling it) could make the target's parent mount private itself before the bind-mount, rather than relying on the caller's environment already being private. Happy to help test a patch.
I reproduced this on a fresh Fedora 44 VM (aarch64, SELinux enforcing, / and /run shared) with bootc 1.16.10 and 1.17.1.
A first install doesn't fail. It leaks a mount instead. --source-imgref skips bootc's own mount namespace unshare, and the namespace that bind_storage_roots() creates for podman keeps shared propagation. So the bind onto /run/bootc/storage propagates back and stays mounted on the host after bootc exits, at both /run/bootc/storage and /target/run/bootc/storage.
If the storage directory is then removed, for example rm -rf /ostree before retrying, the leaked mount points at a deleted directory (.../ostree/bootc/storage//deleted in mountinfo), and the next bind fails:
mount(".", "/run/bootc/storage", NULL, MS_BIND, NULL) = -1 ENOENT (No such file or directory)
error: Installing to filesystem: Creating imgstorage: Initializing images: No such file or directory (os error 2)
It keeps failing until reboot, which matches "reproducibly", and it's why mount --make-private / /run beforehand avoids it.
Making the child namespace recursively private right after the unshare, as ChrootCmd already does, fixes it in my testing: no leaked mount, and the retry installs cleanly. I'll open a PR with the fix and a regression test. I also saw the triage in cgwalters-forge/tracker#312; this matches its lead.
Activity
Sam071100 commentedon Oct 24, 2026
I reproduced this on a fresh Fedora 44 VM (aarch64, SELinux enforcing,
/and/runshared) with bootc 1.16.10 and 1.17.1.A first install doesn't fail. It leaks a mount instead.
--source-imgrefskips bootc's own mount namespace unshare, and the namespace thatbind_storage_roots()creates for podman keeps shared propagation. So the bind onto/run/bootc/storagepropagates back and stays mounted on the host after bootc exits, at both/run/bootc/storageand/target/run/bootc/storage.If the storage directory is then removed, for example
rm -rf /ostreebefore retrying, the leaked mount points at a deleted directory (.../ostree/bootc/storage//deletedin mountinfo), and the next bind fails:It keeps failing until reboot, which matches "reproducibly", and it's why
mount --make-private / /runbeforehand avoids it.Making the child namespace recursively private right after the unshare, as
ChrootCmdalready does, fixes it in my testing: no leaked mount, and the retry installs cleanly. I'll open a PR with the fix and a regression test. I also saw the triage in cgwalters-forge/tracker#312; this matches its lead.podstorage: Make the storage bind mount namespace private