Mount namespace
Last updated
Last updated
Mount namespaces provide isolation of the list of mount points seen by the processes in each namespace instance. The processes in each of the mount namespace instances will see distinct single-directory hierarchies.
The views provided by the /proc/[pid])/mounts, mountinfo, and mountstats files correspond to the mount namespace in which the process with the PID [pid] resides.
If a namespace is created using a clone, the mount point list of the child's namespace is a copy of the mount point list in the parent's namespace. If it is created using unshare, the mount point list of the new namespace is a copy of the mount point list in the caller's previous mount namespace.
A file system includes many mounts.
Namely / is usually mounted on a storage device.
A new mount namespace allows processes in inner namespaces to change mount points without affecting outer namespaces.
This is beneficial to mount entire file systems to different devices or even files.