]> git.ipfire.org Git - thirdparty/util-linux.git/blob - misc-utils/findmnt.8
findmnt: add -P, --pairs to the man page
[thirdparty/util-linux.git] / misc-utils / findmnt.8
1 .\" -*- nroff -*-
2 .TH FINDMNT 8 "April 2010" "util-linux" "System Administration"
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
21 will list all mounted filesytems or search for a filesystem. The
22 .B findmnt
23 command is able to search in
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
32 is not given, all filesystems are shown.
33 .PP
34 The command prints all mounted filesystems in the tree-like format by default.
35 .SH OPTIONS
36 .IP "\fB\-h, \-\-help\fP"
37 Print help and exit.
38 .IP "\fB\-s, \-\-fstab\fP"
39 Search in
40 .IR /etc/fstab .
41 The output is in the list format (see --list).
42 .IP "\fB\-m, \-\-mtab\fP"
43 Search in
44 .IR /etc/mtab .
45 The output is in the list format (see --list).
46 .IP "\fB\-k, \-\-kernel\fP"
47 Search in
48 .IR /proc/self/mountinfo .
49 The output is in the tree-like format. This is the default.
50 .IP "\fB\-c, \-\-canonicalize\fP"
51 Canonicalize all printed paths.
52 .IP "\fB\-d, \-\-direction \fIword\fP"
53 The search direction -
54 .IR forward
55 or
56 .IR backward .
57 .IP "\fB\-e, \-\-evaluate\fP"
58 Convert all tags (LABEL or UUID) to the device names.
59 .IP "\fB\-F, \-\-tab\-file \fIpath\fP"
60 Search in an alternative file, if used with \fB\-\-fstab\fP, \fB\-\-mtab\fP
61 or \fB\-\-kernel\fP then overwrites the default paths.
62 .IP "\fB\-f, \-\-first\-only\fP"
63 Print the first matching filesystem only.
64 .IP "\fB\-i, \-\-invert\fP"
65 Invert the sense of matching.
66 .IP "\fB\-l, \-\-list\fP"
67 Use the list output format. This output format is automatically enabled if the
68 output is restricted by \fB\-t\fP, \fB\-O\fP, \fB\-S\fP or \fB\-T\fP
69 option and the option \fB\-\-submounts\fP is not used.
70 .IP "\fB\-v, \-\-nofsroot\fP"
71 Do not print a [/dir] in the SOURCE column for bind-mounts or btrfs subvolumes.
72 .IP "\fB\-n, \-\-noheadings\fP"
73 Do not print a header line.
74 .IP "\fB\-u, \-\-notruncate\fP"
75 Do not truncate text in columns. The default is to not truncate the
76 .BR TARGET ,
77 .BR SOURCE ,
78 .BR UUID
79 and
80 .BR LABEL
81 columns. This option disables text truncation also in all other columns.
82 .IP "\fB\-O, \-\-options \fIlist\fP"
83 Limit the set of printed filesystems. More than one option
84 may be specified in a comma-separated list. The
85 .B \-t
86 and
87 .B \-O
88 options are cumulative in effect. It is different from
89 .B \-t
90 in that each option is matched exactly; a leading
91 .I no
92 at the beginning does not have global meaning. The "no" could used for
93 individual items in the list. The "no" prefix interpratation could be disabled
94 by "+" prefix.
95 .IP "\fB\-o, \-\-output \fIlist\fP"
96 Define output columns. Currently supported are
97 .BR ACTION,
98 .BR SOURCE ,
99 .BR TARGET ,
100 .BR OLD-TARGET,
101 .BR FSTYPE ,
102 .BR OPTIONS ,
103 .BR OLD-OPTIONS,
104 .BR VFS-OPTIONS ,
105 .BR FS-OPTIONS ,
106 .BR LABEL
107 and
108 .BR UUID .
109 The
110 .BR TARGET
111 column contains tree formatting if the
112 .B \-\-list
113 or
114 .B \-\-raw
115 options are not specified.
116 .IP "\fB\-p, \-\-poll\fR[\fI=list\fR]\fP"
117 Monitor changes in the /proc/self/mountinfo file. Supported actions are: mount,
118 umount, remount and move. More than one action may be specified in a
119 comma-separated list. All actions are monitored by default.
120
121 The time for which \fB--poll\fR will block can be restricted with the \fB\-\-timeout\fP
122 or \fB\-\-first-only\fP options.
123
124 The standard columns always use the new version of the information from the
125 mountinfo file, except the umount action which is based on the original
126 information cached by
127 .BR findmnt (8) .
128 The poll mode allows to use extra columns:
129 .RS
130 .TP
131 .B ACTION
132 mount, umount, move or remount action name; this column is enabled by default
133 .TP
134 .B OLD-TARGET
135 available for umount and move actions
136 .TP
137 .B OLD-OPTIONS
138 available for umount and remount actions
139 .RE
140 .IP "\fB\-P, \-\-pairs\fP"
141 Use key="value" output format.
142 .IP "\fB\-r, \-\-raw\fP"
143 Use raw output format.
144 .IP "\fB\-a, \-\-ascii\fP"
145 Use ascii characters for tree formatting.
146 .IP "\fB\-t, \-\-types \fIlist\fP"
147 Limit the set of printed filesystems. More than one type may be
148 specified in a comma-separated list. The list of filesystem types can be
149 prefixed with
150 .I no
151 to specify the filesystem types on which no action should be taken. For
152 more details see
153 .BR mount (8).
154 .IP "\fB\-R, \-\-submounts\fP"
155 Print recursively all submounts for the selected filesystems. The restrictions
156 defined by options \fB\-t\fP, \fB\-O\fP, \fB\-S\fP, \fB\-T\fP and
157 \fB\--direction\fP are not applied to submounts. All submounts are always
158 printed in tree-like order. The option enables the tree-like output format by
159 default. This option has no effect for \fB\-\-mtab\fP or \fB\-\-fstab\fP.
160 .IP "\fB\-S, \-\-source \fIspec\fP"
161 Explicitly define the mount source. Supported are \fIdevice\fR, \fILABEL=\fR and \fIUUID=\fR.
162 .IP "\fB\-T, \-\-target \fIdir\fP"
163 Explicitly define the mount target (mountpoint directory).
164 .IP "\fB\-w, \-\-timeout \fImilliseconds\fP"
165 Specify an upper limit on the time for which \fB--poll\fR will block, in milliseconds.
166 .SH EXAMPLES
167 .IP "\fBfindmnt \-\-fstab \-t nfs\fP"
168 Prints all nfs filesystems defined in
169 .IR /etc/fstab .
170 .IP "\fBfindmnt \-\-fstab /mnt/foo\fP"
171 Prints all
172 .IR /etc/fstab
173 filesystems where the mountpoint directory is /mnt/foo. It also prints bind mounts where /mnt/foo
174 is a source.
175 .IP "\fBfindmnt \-\-fstab --target /mnt/foo\fP"
176 Prints all
177 .IR /etc/fstab
178 filesystems where the mountpoint directory is /mnt/foo.
179 .IP "\fBfindmnt --fstab --evaluate\fP"
180 Prints all
181 .IR /etc/fstab
182 filesystems and converts LABEL= and UUID= tags to the real device names.
183 .IP "\fBfindmnt -n --raw --evaluate --output=target LABEL=/boot\fP"
184 Prints only the mountpoint where the filesystem with label "/boot" is mounted.
185 .IP "\fBfindmnt --poll --target /mnt/foo\fP"
186 Monitors mount, umount, remount and move on /mnt/foo.
187 .IP "\fBfindmnt --poll=umount --first-only --target /mnt/foo\fP"
188 Waits for /mnt/foo umount.
189 .IP "\fBfindmnt --poll=remount -t ext3 -O ro\fP"
190 Monitors remounts to read-only mode on all ext3 filesystems.
191 .SH ENVIRONMENT
192 .IP LIBMOUNT_FSTAB=<path>
193 overrides the default location of the fstab file
194 .IP LIBMOUNT_MTAB=<path>
195 overrides the default location of the mtab file
196 .IP LIBMOUNT_DEBUG=0xffff
197 enables debug output
198 .SH AUTHORS
199 .nf
200 Karel Zak <kzak@redhat.com>
201 .fi
202 .SH SEE ALSO
203 .BR mount (8),
204 .BR fstab (5)
205 .SH AVAILABILITY
206 The findmnt command is part of the util-linux package and is available from
207 ftp://ftp.kernel.org/pub/linux/utils/util-linux/.