CONTRIBUTING.d/patches: Please provide a git-range-diff(1)
[man-pages.git] / man5 / proc_pid_mountinfo.5
blob67806361752a37332a67ce73dd19e3f0865949fc
1 .\" Copyright (C) 1994, 1995, Daniel Quinlan <quinlan@yggdrasil.com>
2 .\" Copyright (C) 2002-2008, 2017, Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" Copyright (C) 2023, Alejandro Colomar <alx@kernel.org>
4 .\"
5 .\" SPDX-License-Identifier: GPL-3.0-or-later
6 .\"
7 .TH proc_pid_mountinfo 5 (date) "Linux man-pages (unreleased)"
8 .SH NAME
9 /proc/pid/mountinfo \- mount information
10 .SH DESCRIPTION
11 .TP
12 .IR /proc/ pid /mountinfo " (since Linux 2.6.26)"
13 .\" This info adapted from Documentation/filesystems/proc.txt
14 .\" commit 2d4d4864ac08caff5c204a752bd004eed4f08760
15 This file contains information about mounts
16 in the process's mount namespace (see
17 .BR mount_namespaces (7)).
18 It supplies various information
19 (e.g., propagation state, root of mount for bind mounts,
20 identifier for each mount and its parent) that is missing from the (older)
21 .IR /proc/ pid /mounts
22 file, and fixes various other problems with that file
23 (e.g., nonextensibility,
24 failure to distinguish per-mount versus per-superblock options).
25 .IP
26 The file contains lines of the form:
27 .IP
28 .EX
29 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 \- ext3 /dev/root rw,errors=continue
30 (1)(2)(3)   (4)   (5)      (6)      (7)   (8) (9)   (10)         (11)
31 .EE
32 .IP
33 The numbers in parentheses are labels for the descriptions below:
34 .RS 7
35 .TP 5
36 (1)
37 mount ID: a unique ID for the mount (may be reused after
38 .BR umount (2)).
39 .TP
40 (2)
41 parent ID: the ID of the parent mount
42 (or of self for the root of this mount namespace's mount tree).
43 .IP
44 If a new mount is stacked on top of a previous existing mount
45 (so that it hides the existing mount) at pathname P,
46 then the parent of the new mount is the previous mount at that location.
47 Thus, when looking at all the mounts stacked at a particular location,
48 the top-most mount is the one that is not the parent
49 of any other mount at the same location.
50 (Note, however, that this top-most mount will be accessible only if
51 the longest path subprefix of P that is a mount point
52 is not itself hidden by a stacked mount.)
53 .IP
54 If the parent mount lies outside the process's root directory (see
55 .BR chroot (2)),
56 the ID shown here won't have a corresponding record in
57 .I mountinfo
58 whose mount ID (field 1) matches this parent mount ID
59 (because mounts that lie outside the process's root directory
60 are not shown in
61 .IR mountinfo ).
62 As a special case of this point,
63 the process's root mount may have a parent mount
64 (for the initramfs filesystem) that lies
65 .\" Miklos Szeredi, Nov 2017: The hidden one is the initramfs, I believe
66 .\" mtk: In the initial mount namespace, this hidden ID has the value 0
67 outside the process's root directory,
68 and an entry for that mount will not appear in
69 .IR mountinfo .
70 .TP
71 (3)
72 major:minor: the value of
73 .I st_dev
74 for files on this filesystem (see
75 .BR stat (2)).
76 .TP
77 (4)
78 root: the pathname of the directory in the filesystem
79 which forms the root of this mount.
80 .TP
81 (5)
82 mount point: the pathname of the mount point relative
83 to the process's root directory.
84 .TP
85 (6)
86 mount options: per-mount options (see
87 .BR mount (2)).
88 .TP
89 (7)
90 optional fields: zero or more fields of the form "tag[:value]"; see below.
91 .TP
92 (8)
93 separator: the end of the optional fields is marked by a single hyphen.
94 .TP
95 (9)
96 filesystem type: the filesystem type in the form "type[.subtype]".
97 .TP
98 (10)
99 mount source: filesystem-specific information or "none".
101 (11)
102 super options: per-superblock options (see
103 .BR mount (2)).
106 Currently, the possible optional fields are
107 .IR shared ,
108 .IR master ,
109 .IR propagate_from ,
111 .IR unbindable .
113 .BR mount_namespaces (7)
114 for a description of these fields.
115 Parsers should ignore all unrecognized optional fields.
117 For more information on mount propagation see
118 .I Documentation/filesystems/sharedsubtree.rst
120 .I Documentation/filesystems/sharedsubtree.txt
121 before Linux 5.8)
122 in the Linux kernel source tree.
123 .SH SEE ALSO
124 .BR proc (5)