> For the complete documentation index, see [llms.txt](https://davidjosearaujo.gitbook.io/notes-mcs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://davidjosearaujo.gitbook.io/notes-mcs/secure-execution-environments/linux-kernel-namespaces/mount-namespace.md).

# Mount namespace

**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.

<figure><img src="https://234178705-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSLj4wxc6NsT415otBid%2Fuploads%2FuEbdXHSr2QVsMNiFXzHf%2F2024-04-20_16-05.png?alt=media&amp;token=a819bc96-5d5f-4574-9f49-3be01c4382a9" alt=""><figcaption></figcaption></figure>
