Mount namespace
A Linux mount namespace gives its member processes a particular view of the mount hierarchy.
Creating a namespace with CLONE_NEWNS copies the existing mount list, not the underlying file contents. Processes in different namespaces can therefore still reach the same filesystem data. [1] [2]
Propagation is a separate property of each mount. Shared mounts propagate mount and unmount events immediately beneath them among peers, potentially across namespaces; private mounts do not propagate those events. A separate namespace alone does not establish a private tree or a storage snapshot. [2]
/proc/PID/mountinfo describes the target process's mount namespace, including mount roots, propagation fields and separate per-mount and per-superblock options. Inspecting the observer's own list can miss the target's view. [3]
Command defaults differ from the system call. The util-linux unshare command makes propagation recursively private for a new mount namespace by default (since 2.27). --propagation unchanged disables that extra step. Record the entry point and options when interpreting namespace isolation. [4]
Relations
- related
- Bind mount, Read-only mount, Mount propagation
Citations
- Linux man-pages: mount_namespaces(7), namespace creation and mount-list scope
- Linux man-pages: proc_pid_mountinfo(5), per-process view and option layers
Sources & caveats
- Documentation synthesis; no namespace creation, privileged mounting or recovery experiment was performed. Rolling documentation was checked on the access date.