]> git.ipfire.org Git - thirdparty/util-linux.git/blame - misc-utils/lsblk.8
dmesg: add missing include
[thirdparty/util-linux.git] / misc-utils / lsblk.8
CommitLineData
2a4c734b 1.\" -*- nroff -*-
ceefa682 2.TH LSBLK 8 "February 2013" "util-linux" "System Administration"
2a4c734b
MB
3.SH NAME
4lsblk \- list block devices
5.SH SYNOPSIS
6.B lsblk
7.RB [ options ]
ceefa682 8.RI [ device ...]
2a4c734b
MB
9.SH DESCRIPTION
10.B lsblk
ceefa682 11lists information about all available or the specified block devices. The
2a4c734b 12.B lsblk
8d7f2904 13command reads the
2a4c734b
MB
14.I sysfs
15filesystem to gather information.
16.PP
8d7f2904
BS
17The command prints all block devices (except RAM disks) in a tree-like format
18by default. Use
2a4c734b 19.B "lsblk --help"
8d7f2904 20to get a list of all available columns.
980358f1 21.PP
ceefa682
BS
22The default output, as well as the default output from options like
23.BR \-\-fs
24and
25.BR \-\-topology ,
26is subject to change. So whenever possible, you should avoid using default
27outputs in your scripts. Always explicitly define expected columns by using
980358f1 28.B \-\-output
ceefa682
BS
29.I columns-list
30in environments where a stable output is required.
2a4c734b 31.SH OPTIONS
ceefa682
BS
32.TP
33.BR \-a , " \-\-all"
34Also list empty devices. (By default they are skipped.)
35.TP
36.BR \-b , " \-\-bytes"
37Print the SIZE column in bytes rather than in a human-readable format.
38.TP
39.BR \-D , " \-\-discard"
40Print information about the discarding capabilities (TRIM, UNMAP) for each device.
41.TP
42.BR \-d , " \-\-nodeps"
43Do not print holder devices or slaves. For example, \fBlsblk --nodeps /dev/sda\fR prints
f31505fe 44information about the sda device only.
ceefa682
BS
45.TP
46.BR \-e , " \-\-exclude " \fIlist\fP
47Exclude the devices specified by the comma-separated \fIlist\fR of major device numbers.
48Note that RAM disks (major=1) are excluded by default. The filter is applied to the
49top-level devices only.
50.TP
51.BR \-f , " \-\-fs"
52Output info about filesystems. This option is equivalent to
53.BR -o\ NAME,FSTYPE,LABEL,MOUNTPOINT .
8d7f2904 54The authoritative information about filesystems and raids is provided by the
2a4c734b
MB
55.BR blkid (8)
56command.
ceefa682
BS
57.TP
58.BR \-h , " \-\-help"
b4362b6f 59Display help text and exit.
ceefa682
BS
60.TP
61.BR \-I , " \-\-include " \fIlist\fP
62Include devices specified by the comma-separated \fIlist\fR of major device numbers.
63The filter is applied to the top-level devices only.
64.TP
65.BR \-i , " \-\-ascii"
6ea1bdd3 66Use ASCII characters for tree formatting.
ceefa682
BS
67.TP
68.BR \-l , " \-\-list"
69Produce output in the form of a list.
70.TP
71.BR \-m , " \-\-perms"
72Output info about device owner, group and mode. This option is equivalent to
73.BR -o\ NAME,SIZE,OWNER,GROUP,MODE .
74.TP
75.BR \-n , " \-\-noheadings"
2a4c734b 76Do not print a header line.
ceefa682
BS
77.TP
78.BR \-o , " \-\-output " \fIlist\fP
8d7f2904 79Specify which output columns to print. Use
ceefa682 80.B \-\-help
8d7f2904 81to get a list of all supported columns.
36fb1007 82
37684203
BS
83The default list of columns may be extended if \fIlist\fP is
84specified in the format \fI+list\fP (e.g. \fBlsblk -o +UUID\fP).
ceefa682
BS
85.TP
86.BR \-P , " \-\-pairs"
87Produce output in the form of key="value" pairs.
88All potentially unsafe characters are hex-escaped (\\x<code>).
89.TP
c7e76cd1
KZ
90.BR \-p , " \-\-paths"
91Print full device paths.
92.TP
ceefa682
BS
93.BR \-r , " \-\-raw"
94Produce output in raw format. All potentially unsafe characters are hex-escaped
95(\\x<code>) in the NAME, KNAME, LABEL, PARTLABEL and MOUNTPOINT columns.
96.TP
97.BR \-S , " \-\-scsi"
98Output info about SCSI devices only. All partitions, slaves and holder devices are ignored.
99.TP
100.BR \-s , " \-\-inverse"
8265242b 101Print dependencies in inverse order.
ceefa682
BS
102.TP
103.BR \-t , " \-\-topology"
104Output info about block-device topology.
105This option is equivalent to
106.BR -o\ NAME,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,ROTA,SCHED,RQ-SIZE,WSAME .
107.TP
108.BR \-V , " \-\-version"
b4362b6f 109Display version information and exit.
9830eca5 110.SH NOTES
68eebd53
PU
111For partitions, some information (e.g. queue attributes) is inherited from the
112parent device.
f65b3bb6
SK
113.PP
114The
115.B lsblk
ceefa682
BS
116command needs to be able to look up each block device by major:minor numbers,
117which is done by using
f65b3bb6 118.BR /sys/dev/block .
ceefa682
BS
119This sysfs block directory appeared in kernel 2.6.27 (October 2008).
120In case of problems with a new enough kernel, check that CONFIG_SYSFS
121was enabled at the time of the kernel build.
2a4c734b
MB
122.SH AUTHORS
123.nf
124Milan Broz <mbroz@redhat.com>
125Karel Zak <kzak@redhat.com>
126.fi
ca3dbca1 127.SH ENVIRONMENT
ceefa682 128.IP "Setting LIBMOUNT_DEBUG=0xffff enables debug output."
2a4c734b
MB
129.SH SEE ALSO
130.BR findmnt (8),
131.BR blkid (8),
132.BR ls (1)
133.SH AVAILABILITY
601d12fb
KZ
134The lsblk command is part of the util-linux package and is available from
135ftp://ftp.kernel.org/pub/linux/utils/util-linux/.