summaryrefslogtreecommitdiff
path: root/misc-utils/findmnt.8
blob: 8c4f2bef6bec5114f93f98bacfd1a719873ddedd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
.\" -*- nroff -*-
.TH FINDMNT 8 "Apr 2010" "Version 1.0"
.SH NAME
findmnt \- find a filesystem
.SH SYNOPSIS
.B findmnt
.RB [ options ]
.sp
.B findmnt
.RB [ options ]
.IR device | mountpoint
.sp
.B findmnt
.RB [ options ]
.RB [ \--source ]
.IR device
.RB [ \--target ]
.IR mountpoint
.SH DESCRIPTION
.B findmnt
will list all mounted filesytems or search for a filesystem.  The
.B findmnt
command is able to search in
.IR /etc/fstab ,
.IR /etc/fstab.d ,
.IR /etc/mtab
or
.IR /proc/self/mountinfo .
If
.IR device
or
.IR mountpoint
is not given, all filesystems are shown.
.PP
The command prints all mounted filesystems in the tree-like format by default.
.SH OPTIONS
.IP "\fB\-h, \-\-help\fP"
Print help and exit.
.IP "\fB\-s, \-\-fstab\fP"
Search in
.IR /etc/fstab
and
.IR /etc/fstab.d .
The output is in the list format (see --list).
.IP "\fB\-m, \-\-mtab\fP"
Search in
.IR /etc/mtab .
The output is in the list format (see --list).
.IP "\fB\-k, \-\-kernel\fP"
Search in
.IR /proc/self/mountinfo .
The output is in the tree-like format.  This is the default.
.IP "\fB\-c, \-\-canonicalize\fP"
Canonicalize all printed paths.
.IP "\fB\-d, \-\-direction \fIword\fP"
The search direction -
.IR forward
or
.IR backward .
.IP "\fB\-e, \-\-evaluate\fP"
Convert all tags (LABEL or UUID) to the device names.
.IP "\fB\-f, \-\-first-only\fP"
Print the first matching filesystem only.
.IP "\fB\-i, \-\-invert\fP"
Invert the sense of matching.
.IP "\fB\-l, \-\-list\fP"
Use the list output format. This output format is automatically enabled if the
output is restricted by \fB\-t\fP, \fB\-O\fP, \fB\-S\fP or \fB\-T\fP
option and the option \fB\-\-submounts\fP is not used.
.IP "\fB\-v, \-\-nofsroot\fP"
Do not print a [/dir] in the SOURCE column for bind-mounts or btrfs subvolumes.
.IP "\fB\-n, \-\-noheadings\fP"
Do not print a header line.
.IP "\fB\-u, \-\-notruncate\fP"
Do not truncate text in columns.  The default is to not truncate the
.BR TARGET ,
.BR SOURCE ,
.BR UUID
and
.BR LABEL
columns.  This option disables text truncation also in all other columns.
.IP "\fB\-O, \-\-options \fIlist\fP"
Used to limit the set of printed filesystems.  More than one option
may be specified in a comma-separated list.  The
.B \-t
and
.B \-O
options are cumulative in effect.  It is different from
.B \-t
in that each option is matched exactly; a leading
.I no
at the beginning
of one option does not negate the rest.  For more details see
.BR mount (8).
.IP "\fB\-o, \-\-output \fIlist\fP"
Define output columns.  Currently supported are
.BR SOURCE ,
.BR TARGET ,
.BR FSTYPE ,
.BR OPTIONS ,
.BR VFS-OPTIONS ,
.BR FS-OPTIONS ,
.BR LABEL
and
.BR UUID .
The
.BR TARGET
column contains tree formatting if the
.B \-\-list
or
.B \-\-raw
options are not specified.
.IP "\fB\-r, \-\-raw\fP"
Use raw output format.
.IP "\fB\-a, \-\-ascii\fP"
Use ascii characters for tree formatting.
.IP "\fB\-t, \-\-types \fIlist\fP"
Used to limit the set of printed filesystems.  More than one type may be
specified in a comma-separated list.  The list of filesystem types can be
prefixed with
.I no
to specify the filesystem types on which no action should be taken.  For
more details see
.BR mount (8).
.IP "\fB\-R, \-\-submounts\fP"
Print recursively all submounts for the selected filesystems. The restictions
defined by options \fB\-t\fP, \fB\-O\fP, \fB\-S\fP, \fB\-T\fP and
\fB\--direction\fP are not applied to submounts. All submounts are always
printed in tree-like order. The option enables the tree-like output format by
default. This option has no effect for \fB\-\-mtab\fP or \fB\-\-fstab\fP.
.IP "\fB\-S, \-\-source \fIspec\fP"
Explicitly define the mount source.  Supported are device, LABEL= or UUID=.
.IP "\fB\-T, \-\-target \fIdir\fP"
Explicitly define the mount target (mountpoint directory).
.SH EXAMPLES
.IP "\fBfindmnt \-\-fstab \-t nfs\fP"
Prints all nfs filesystems defined in
.IR /etc/fstab .
.IP "\fBfindmnt \-\-fstab /mnt/foo\fP"
Prints all
.IR /etc/fstab
filesystems where the mountpoint directory is /mnt/foo.  It also prints bind mounts where /mnt/foo
is a source.
.IP "\fBfindmnt \-\-fstab --target /mnt/foo\fP"
Prints all
.IR /etc/fstab
filesystems where the mountpoint directory is /mnt/foo.
.IP "\fBfindmnt --fstab --evaluate\fP"
Prints all
.IR /etc/fstab
filesystems and converts LABEL= and UUID= tags to the real device names.
.IP "\fBfindmnt -n --raw --evaluate --output=target LABEL=/boot
Prints only the mountpoint where the filesystem with label "/boot" is mounted.
.SH AUTHORS
.nf
Karel Zak <kzak@redhat.com>
.fi
.SH SEE ALSO
.BR mount (8),
.BR fstab (5)
.SH AVAILABILITY
The findmnt command is part of the util-linux package and is available from
ftp://ftp.kernel.org/pub/linux/utils/util-linux/.