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