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