]>
Commit | Line | Data |
---|---|---|
9421a1a3 | 1 | .TH FINDMNT 8 "June 2014" "util-linux" "System Administration" |
62b4550f KZ |
2 | .SH NAME |
3 | findmnt \- find a filesystem | |
4 | .SH SYNOPSIS | |
5 | .B findmnt | |
f49ccec2 | 6 | [options] |
62b4550f KZ |
7 | .sp |
8 | .B findmnt | |
f49ccec2 | 9 | [options] |
62b4550f KZ |
10 | .IR device | mountpoint |
11 | .sp | |
12 | .B findmnt | |
f49ccec2 BS |
13 | [options] |
14 | .RB [ \-\-source ] | |
62b4550f | 15 | .IR device |
f49ccec2 | 16 | .RB [ \-\-target ] |
62b4550f KZ |
17 | .IR mountpoint |
18 | .SH DESCRIPTION | |
19 | .B findmnt | |
d0bb6987 | 20 | will list all mounted filesytems or search for a filesystem. The |
62b4550f | 21 | .B findmnt |
d0bb6987 | 22 | command is able to search in |
62b4550f KZ |
23 | .IR /etc/fstab , |
24 | .IR /etc/mtab | |
25 | or | |
26 | .IR /proc/self/mountinfo . | |
27 | If | |
28 | .IR device | |
29 | or | |
30 | .IR mountpoint | |
d0bb6987 | 31 | is not given, all filesystems are shown. |
62b4550f | 32 | .PP |
469202cd BS |
33 | The device may be specified by device name, maj:min, filesystem LABEL or UUID, |
34 | or partition PARTUUID or PARTLABEL. Note that a device name may be interpreted | |
35 | as a mountpoint (and vice versa) if the \fB--target\fR or \fB--source\fR options | |
36 | are not specified. | |
cd492186 | 37 | .PP |
d0bb6987 | 38 | The command prints all mounted filesystems in the tree-like format by default. |
62b4550f | 39 | .SH OPTIONS |
4b44c245 BS |
40 | .TP |
41 | .BR \-A , " \-\-all" | |
cd4ed46f | 42 | Disable all built-in filters and print all filesystems. |
4b44c245 BS |
43 | .TP |
44 | .BR \-a , " \-\-ascii" | |
cd4ed46f | 45 | Use ascii characters for tree formatting. |
4b44c245 | 46 | .TP |
2b6759df KZ |
47 | .BR \-b , " \-\-bytes" |
48 | Print the SIZE, USED and AVAIL column in bytes rather than in a human-readable format. | |
49 | .TP | |
097e7f2f | 50 | .BR \-C , " \-\-nocanonicalize" |
9421a1a3 BS |
51 | Do not canonicalize paths at all. This option affects the comparing of paths |
52 | and the evaluation of tags (LABEL, UUID, etc.). | |
097e7f2f | 53 | .TP |
4b44c245 | 54 | .BR \-c , " \-\-canonicalize" |
62b4550f | 55 | Canonicalize all printed paths. |
4b44c245 BS |
56 | .TP |
57 | .BR \-D , " \-\-df" | |
469202cd BS |
58 | Imitate the output of |
59 | .BR df (1). | |
60 | This option is equivalent to | |
61 | .B -o SOURCE,FSTYPE,SIZE,USED,AVAIL,USE%,TARGET | |
62 | but excludes all pseudo filesystems. | |
63 | Use \fB\-\-all\fP to print all filesystems. | |
4b44c245 BS |
64 | .TP |
65 | .BR \-d , " \-\-direction \fIword\fP" | |
469202cd | 66 | The search direction, either |
9421a1a3 | 67 | .B forward |
62b4550f | 68 | or |
9421a1a3 | 69 | .BR backward . |
4b44c245 BS |
70 | .TP |
71 | .BR \-e , " \-\-evaluate" | |
090b5e84 | 72 | Convert all tags (LABEL, UUID, PARTUUID or PARTLABEL) to the device names. |
4b44c245 BS |
73 | .TP |
74 | .BR \-F , " \-\-tab\-file \fIpath\fP" | |
469202cd BS |
75 | Search in an alternative file. If used with \fB\-\-fstab\fP, \fB\-\-mtab\fP |
76 | or \fB\-\-kernel\fP, then it overrides the default paths. If specified more | |
77 | than once, then tree-like output is disabled (see the \fB\-\-list\fP option). | |
4b44c245 BS |
78 | .TP |
79 | .BR \-f , " \-\-first\-only" | |
62b4550f | 80 | Print the first matching filesystem only. |
4b44c245 BS |
81 | .TP |
82 | .BR \-h , " \-\-help" | |
b4362b6f | 83 | Display help text and exit. |
4b44c245 BS |
84 | .TP |
85 | .BR \-i , " \-\-invert" | |
d0bb6987 | 86 | Invert the sense of matching. |
4b44c245 BS |
87 | .TP |
88 | .BR \-k , " \-\-kernel" | |
469202cd BS |
89 | Search in |
90 | .IR /proc/self/mountinfo . | |
91 | The output is in the tree-like format. This is the default. | |
4b44c245 BS |
92 | .TP |
93 | .BR \-l , " \-\-list" | |
469202cd BS |
94 | Use the list output format. This output format is automatically enabled if the |
95 | output is restricted by the \fB\-t\fP, \fB\-O\fP, \fB\-S\fP or \fB\-T\fP | |
aca72ac2 KZ |
96 | option and the option \fB\-\-submounts\fP is not used or if more that one |
97 | source file (the option \fB\-F\fP) is specified. | |
4b44c245 BS |
98 | .TP |
99 | .BR \-m , " \-\-mtab" | |
469202cd BS |
100 | Search in |
101 | .IR /etc/mtab . | |
102 | The output is in the list format (see \fB\-\-list\fP). | |
4b44c245 BS |
103 | .TP |
104 | .BR \-N , " \-\-task \fItid\fP" | |
c7fcc830 | 105 | Use alternative namespace /proc/<tid>/mountinfo rather than the default |
469202cd BS |
106 | /proc/self/mountinfo. If the option is specified more than once, then |
107 | tree-like output is disabled (see the \fB\-\-list\fP option). See also the | |
c7fcc830 KZ |
108 | .BR unshare (1) |
109 | command. | |
4b44c245 BS |
110 | .TP |
111 | .BR \-n , " \-\-noheadings" | |
d0bb6987 | 112 | Do not print a header line. |
4b44c245 BS |
113 | .TP |
114 | .BR \-O , " \-\-options \fIlist\fP" | |
de9501ab | 115 | Limit the set of printed filesystems. More than one option |
d0bb6987 | 116 | may be specified in a comma-separated list. The |
62b4550f KZ |
117 | .B \-t |
118 | and | |
119 | .B \-O | |
d0bb6987 | 120 | options are cumulative in effect. It is different from |
62b4550f KZ |
121 | .B \-t |
122 | in that each option is matched exactly; a leading | |
123 | .I no | |
469202cd BS |
124 | at the beginning does not have global meaning. The "no" can used for |
125 | individual items in the list. The "no" prefix interpretation can be disabled | |
ede8a60e | 126 | by "+" prefix. |
4b44c245 BS |
127 | .TP |
128 | .BR \-o , " \-\-output \fIlist\fP" | |
469202cd BS |
129 | Define output columns. See the \fB\-\-help\fP output to get a list of the |
130 | currently supported columns. The | |
62b4550f KZ |
131 | .BR TARGET |
132 | column contains tree formatting if the | |
133 | .B \-\-list | |
134 | or | |
135 | .B \-\-raw | |
136 | options are not specified. | |
36fb1007 | 137 | |
37684203 BS |
138 | The default list of columns may be extended if \fIlist\fP is |
139 | specified in the format \fI+list\fP (e.g. \fBfindmnt -o +PROPAGATION\fP). | |
4b44c245 BS |
140 | .TP |
141 | .BR \-P , " \-\-pairs" | |
469202cd | 142 | Use key="value" output format. All potentially unsafe characters are hex-escaped (\\x<code>). |
4b44c245 BS |
143 | .TP |
144 | .BR \-p , " \-\-poll\fR[\fI=list\fR]" | |
469202cd BS |
145 | Monitor changes in the /proc/self/mountinfo file. Supported actions are: mount, |
146 | umount, remount and move. More than one action may be specified in a | |
147 | comma-separated list. All actions are monitored by default. | |
582a5006 | 148 | |
de9501ab | 149 | The time for which \fB--poll\fR will block can be restricted with the \fB\-\-timeout\fP |
b06c1ca6 | 150 | or \fB\-\-first\-only\fP options. |
582a5006 KZ |
151 | |
152 | The standard columns always use the new version of the information from the | |
153 | mountinfo file, except the umount action which is based on the original | |
154 | information cached by | |
a8862fab KZ |
155 | .BR findmnt (8) . |
156 | The poll mode allows to use extra columns: | |
157 | .RS | |
158 | .TP | |
159 | .B ACTION | |
de9501ab | 160 | mount, umount, move or remount action name; this column is enabled by default |
a8862fab KZ |
161 | .TP |
162 | .B OLD-TARGET | |
163 | available for umount and move actions | |
164 | .TP | |
165 | .B OLD-OPTIONS | |
166 | available for umount and remount actions | |
167 | .RE | |
4b44c245 BS |
168 | .TP |
169 | .BR \-R , " \-\-submounts" | |
de9501ab | 170 | Print recursively all submounts for the selected filesystems. The restrictions |
049caefd | 171 | defined by options \fB\-t\fP, \fB\-O\fP, \fB\-S\fP, \fB\-T\fP and |
de9501ab BS |
172 | \fB\--direction\fP are not applied to submounts. All submounts are always |
173 | printed in tree-like order. The option enables the tree-like output format by | |
174 | default. This option has no effect for \fB\-\-mtab\fP or \fB\-\-fstab\fP. | |
4b44c245 BS |
175 | .TP |
176 | .BR \-r , " \-\-raw" | |
469202cd | 177 | Use raw output format. All potentially unsafe characters are hex-escaped (\\x<code>). |
4b44c245 BS |
178 | .TP |
179 | .BR \-S , " \-\-source \fIspec\fP" | |
cd492186 KZ |
180 | Explicitly define the mount source. Supported are \fIdevice\fR, \fImaj:min\fR, |
181 | \fILABEL=\fR, \fIUUID=\fR, \fIPARTLABEL=\fR or \fIPARTUUID=\fR. | |
4b44c245 BS |
182 | .TP |
183 | .BR \-s , " \-\-fstab" | |
469202cd BS |
184 | Search in |
185 | .IR /etc/fstab . | |
186 | The output is in the list format (see \fB--list\fR). | |
4b44c245 | 187 | .TP |
48367e2d KZ |
188 | .BR \-T , " \-\-target \fIpath\fP" |
189 | Explicitly define the mount target (mountpoint directory). If the \fIpath\fR | |
190 | is not a mountpoint file or directory than | |
191 | .B findmnt | |
192 | checks \fIpath\fR elements in reverse order for get the mountpoint (this feature is | |
193 | supported only if search in kernel files and unsupported for \fB\-\-fstab\fP). | |
4b44c245 BS |
194 | .TP |
195 | .BR \-t , " \-\-types \fIlist\fP" | |
469202cd BS |
196 | Limit the set of printed filesystems. More than one type may be |
197 | specified in a comma-separated list. The list of filesystem types can be | |
198 | prefixed with | |
199 | .I no | |
200 | to specify the filesystem types on which no action should be taken. For | |
201 | more details see | |
202 | .BR mount (8). | |
4b44c245 | 203 | .TP |
169b85c9 BV |
204 | .BR \-U , " \-\-uniq" |
205 | Ignore filesystems with duplicate mount targets, thus effectively skipping | |
206 | over-mounted mount points. | |
207 | .TP | |
4b44c245 | 208 | .BR \-u , " \-\-notruncate" |
469202cd BS |
209 | Do not truncate text in columns. The default is to not truncate the |
210 | .BR TARGET , | |
211 | .BR SOURCE , | |
212 | .BR UUID , | |
213 | .BR LABEL , | |
214 | .BR PARTUUID , | |
215 | .BR PARTLABEL | |
216 | columns. This option disables text truncation also in all other columns. | |
4b44c245 BS |
217 | .TP |
218 | .BR \-v , " \-\-nofsroot" | |
469202cd | 219 | Do not print a [/dir] in the SOURCE column for bind-mounts or btrfs subvolumes. |
4b44c245 BS |
220 | .TP |
221 | .BR \-w , " \-\-timeout \fImilliseconds\fP" | |
de9501ab | 222 | Specify an upper limit on the time for which \fB--poll\fR will block, in milliseconds. |
62b4550f KZ |
223 | .SH EXAMPLES |
224 | .IP "\fBfindmnt \-\-fstab \-t nfs\fP" | |
469202cd | 225 | Prints all NFS filesystems defined in |
62b4550f KZ |
226 | .IR /etc/fstab . |
227 | .IP "\fBfindmnt \-\-fstab /mnt/foo\fP" | |
228 | Prints all | |
229 | .IR /etc/fstab | |
d0bb6987 | 230 | filesystems where the mountpoint directory is /mnt/foo. It also prints bind mounts where /mnt/foo |
62b4550f KZ |
231 | is a source. |
232 | .IP "\fBfindmnt \-\-fstab --target /mnt/foo\fP" | |
233 | Prints all | |
234 | .IR /etc/fstab | |
d0bb6987 | 235 | filesystems where the mountpoint directory is /mnt/foo. |
62b4550f KZ |
236 | .IP "\fBfindmnt --fstab --evaluate\fP" |
237 | Prints all | |
238 | .IR /etc/fstab | |
239 | filesystems and converts LABEL= and UUID= tags to the real device names. | |
582a5006 | 240 | .IP "\fBfindmnt -n --raw --evaluate --output=target LABEL=/boot\fP" |
d0bb6987 | 241 | Prints only the mountpoint where the filesystem with label "/boot" is mounted. |
582a5006 | 242 | .IP "\fBfindmnt --poll --target /mnt/foo\fP" |
469202cd | 243 | Monitors mount, unmount, remount and move on /mnt/foo. |
582a5006 | 244 | .IP "\fBfindmnt --poll=umount --first-only --target /mnt/foo\fP" |
469202cd | 245 | Waits for /mnt/foo unmount. |
582a5006 KZ |
246 | .IP "\fBfindmnt --poll=remount -t ext3 -O ro\fP" |
247 | Monitors remounts to read-only mode on all ext3 filesystems. | |
c0d2c6e1 KZ |
248 | .SH ENVIRONMENT |
249 | .IP LIBMOUNT_FSTAB=<path> | |
250 | overrides the default location of the fstab file | |
251 | .IP LIBMOUNT_MTAB=<path> | |
252 | overrides the default location of the mtab file | |
68e422ec KZ |
253 | .IP LIBMOUNT_DEBUG=all |
254 | enables libmount debug output | |
255 | .IP LIBSMARTCOLS_DEBUG=all | |
256 | enables libsmartcols debug output | |
62b4550f KZ |
257 | .SH AUTHORS |
258 | .nf | |
259 | Karel Zak <kzak@redhat.com> | |
260 | .fi | |
261 | .SH SEE ALSO | |
262 | .BR mount (8), | |
263 | .BR fstab (5) | |
264 | .SH AVAILABILITY | |
601d12fb KZ |
265 | The findmnt command is part of the util-linux package and is available from |
266 | ftp://ftp.kernel.org/pub/linux/utils/util-linux/. |