← Back to issue list

More robust chroot unmounting

View original Github issue

Metadata

Project
craft-parts
Number
#1344
Type
issue
State
closed
Author
upils
Labels
Status: Triaged Type: Bug
Created
Updated
Closed

Current evaluation

Fixed in canonical/craft-parts#1348 (commit aea85f07) by making chroot mounts private before recursively unmounting package-created submounts.

Resolution: closed resolved

Reason: Merged PR canonical/craft-parts#1348 implemented the fix in commit aea85f07, remounting targets with --make-rprivate and unmounting them recursively.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### What needs to get done Rework the unmounting strategy to account for additional mounts created by the installed packages. Adopt a similar strategy as Imagecraft, always remounting the target with `--make-rprivate` and always unmounting with `--recursive`. This approach should also make use of the `--lazy` flag not needed anymore, making the unmounting safer. ### Why it needs to get done Package installation using the `chroot` mechanism of craft-parts can lead to additional mounts created under `/sys` of the chroot. The current approach to unmount `/sys` fail, in turn failing the tool's execution and leaving the building system in a inconsistent state (other mounts not unmounted). This is currently preventing imagecraft from safely using the `overlay-packages` stanza to install packages in the image.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed in canonical/craft-parts#1348 (commit aea85f07) by making chroot mounts private before recursively unmounting package-created submounts.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR canonical/craft-parts#1348 (commit aea85f07), which makes chroot mounts private and recursively unmounts package-created submounts.
qwen/qwen3.6-35b-a3b — — Closed and superseded by internal Jira ticket CRAFT-4804. No code changes were merged. The proposed --make-rprivate and --recursive unmounting fix remains unimplemented.
qwen/qwen3.6-35b-a3b — — Closed and superseded by internal Jira ticket CRAFT-4804. No code changes were merged. The issue proposed remounting with --make-rprivate and recursive unmounting to fix chroot failures during package installation.
qwen/qwen3.6-35b-a3b — — Closed and deferred to internal Jira tracking (CRAFT-4804). No GitHub fix or merge was applied, leaving the chroot unmounting bug unresolved in this repository.
qwen3.6-35b-a3b-mtp-q6 — — Closed without documented resolution or merge. The proposed chroot unmounting improvements using --make-rprivate and --recursive were not implemented.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/craft-parts#1348 (confidence 100%)

    The merged PR added private remounting and recursive unmounting for chroot mounts.

Related issues

Issue Project State Summary Similarity
#1348 fix: Make mounted devices private before recursively unmounting the chroot craft-parts merged Merged PR #1348 fixed chroot cleanup by making device mounts private and recursively unmounting package-created submounts; commit aea85f07 closes #1344.
78%
#401 Release 1.18.4 craft-parts merged Merged release PR #401 published craft-parts 1.18.4, incorporating the fix from #400 (commit 21bbb6dd) to make the chroot /dev mount private.
74%
#118 Be stricter when mounting and safer when umounting imagecraft closed Fixed by merged canonical/imagecraft#126 (15871f5): missing mountpoints now fail early, and chroot cleanup attempts every unmount before reporting errors.
74%
#400 chroot: mark /dev mount as private craft-parts merged Merged PR #400 as commit 21bbb6dd, making chroot /dev bind mounts recursively private to prevent shared-mount unmount propagation.
72%