]> git.ipfire.org Git - thirdparty/util-linux.git/blob - misc-utils/findmnt.8
libmount: remove fstab.d support
[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\-r, \-\-raw\fP"
141 Use raw output format.
142 .IP "\fB\-a, \-\-ascii\fP"
143 Use ascii characters for tree formatting.
144 .IP "\fB\-t, \-\-types \fIlist\fP"
145 Limit the set of printed filesystems. More than one type may be
146 specified in a comma-separated list. The list of filesystem types can be
147 prefixed with
148 .I no
149 to specify the filesystem types on which no action should be taken. For
150 more details see
151 .BR mount (8).
152 .IP "\fB\-R, \-\-submounts\fP"
153 Print recursively all submounts for the selected filesystems. The restrictions
154 defined by options \fB\-t\fP, \fB\-O\fP, \fB\-S\fP, \fB\-T\fP and
155 \fB\--direction\fP are not applied to submounts. All submounts are always
156 printed in tree-like order. The option enables the tree-like output format by
157 default. This option has no effect for \fB\-\-mtab\fP or \fB\-\-fstab\fP.
158 .IP "\fB\-S, \-\-source \fIspec\fP"
159 Explicitly define the mount source. Supported are \fIdevice\fR, \fILABEL=\fR and \fIUUID=\fR.
160 .IP "\fB\-T, \-\-target \fIdir\fP"
161 Explicitly define the mount target (mountpoint directory).
162 .IP "\fB\-w, \-\-timeout \fImilliseconds\fP"
163 Specify an upper limit on the time for which \fB--poll\fR will block, in milliseconds.
164 .SH EXAMPLES
165 .IP "\fBfindmnt \-\-fstab \-t nfs\fP"
166 Prints all nfs filesystems defined in
167 .IR /etc/fstab .
168 .IP "\fBfindmnt \-\-fstab /mnt/foo\fP"
169 Prints all
170 .IR /etc/fstab
171 filesystems where the mountpoint directory is /mnt/foo. It also prints bind mounts where /mnt/foo
172 is a source.
173 .IP "\fBfindmnt \-\-fstab --target /mnt/foo\fP"
174 Prints all
175 .IR /etc/fstab
176 filesystems where the mountpoint directory is /mnt/foo.
177 .IP "\fBfindmnt --fstab --evaluate\fP"
178 Prints all
179 .IR /etc/fstab
180 filesystems and converts LABEL= and UUID= tags to the real device names.
181 .IP "\fBfindmnt -n --raw --evaluate --output=target LABEL=/boot\fP"
182 Prints only the mountpoint where the filesystem with label "/boot" is mounted.
183 .IP "\fBfindmnt --poll --target /mnt/foo\fP"
184 Monitors mount, umount, remount and move on /mnt/foo.
185 .IP "\fBfindmnt --poll=umount --first-only --target /mnt/foo\fP"
186 Waits for /mnt/foo umount.
187 .IP "\fBfindmnt --poll=remount -t ext3 -O ro\fP"
188 Monitors remounts to read-only mode on all ext3 filesystems.
189 .SH ENVIRONMENT
190 .IP LIBMOUNT_FSTAB=<path>
191 overrides the default location of the fstab file
192 .IP LIBMOUNT_MTAB=<path>
193 overrides the default location of the mtab file
194 .IP LIBMOUNT_DEBUG=0xffff
195 enables debug output
196 .SH AUTHORS
197 .nf
198 Karel Zak <kzak@redhat.com>
199 .fi
200 .SH SEE ALSO
201 .BR mount (8),
202 .BR fstab (5)
203 .SH AVAILABILITY
204 The findmnt command is part of the util-linux package and is available from
205 ftp://ftp.kernel.org/pub/linux/utils/util-linux/.