1 .TH LSBLK 8 "February 2013" "util-linux" "System Administration"
3 lsblk \- list block devices
10 lists information about all available or the specified block devices. The
16 to gather information.
18 The command prints all block devices (except RAM disks) in a tree-like format
21 to get a list of all available columns.
23 The default output, as well as the default output from options like
27 is subject to change. So whenever possible, you should avoid using default
28 outputs in your scripts. Always explicitly define expected columns by using
31 in environments where a stable output is required.
35 might be executed in time when
37 does not have all information about recently added or modified devices yet. In this
38 case it is recommended to use
40 before lsblk to synchronize with udev.
44 Also list empty devices. (By default they are skipped.)
46 .BR \-b , " \-\-bytes"
47 Print the SIZE column in bytes rather than in a human-readable format.
49 .BR \-D , " \-\-discard"
50 Print information about the discarding capabilities (TRIM, UNMAP) for each device.
52 .BR \-d , " \-\-nodeps"
53 Do not print holder devices or slaves. For example, \fBlsblk --nodeps /dev/sda\fR prints
54 information about the sda device only.
56 .BR \-e , " \-\-exclude " \fIlist\fP
57 Exclude the devices specified by the comma-separated \fIlist\fR of major device numbers.
58 Note that RAM disks (major=1) are excluded by default. The filter is applied to the
59 top-level devices only.
62 Output info about filesystems. This option is equivalent to
63 .BR -o\ NAME,FSTYPE,LABEL,UUID,MOUNTPOINT .
64 The authoritative information about filesystems and raids is provided by the
69 Display help text and exit.
71 .BR \-I , " \-\-include " \fIlist\fP
72 Include devices specified by the comma-separated \fIlist\fR of major device numbers.
73 The filter is applied to the top-level devices only.
75 .BR \-i , " \-\-ascii"
76 Use ASCII characters for tree formatting.
79 Use JSON output format.
82 Produce output in the form of a list.
84 .BR \-m , " \-\-perms"
85 Output info about device owner, group and mode. This option is equivalent to
86 .BR -o\ NAME,SIZE,OWNER,GROUP,MODE .
88 .BR \-n , " \-\-noheadings"
89 Do not print a header line.
91 .BR \-o , " \-\-output " \fIlist\fP
92 Specify which output columns to print. Use
94 to get a list of all supported columns.
96 The default list of columns may be extended if \fIlist\fP is
97 specified in the format \fI+list\fP (e.g. \fBlsblk -o +UUID\fP).
99 .BR \-O , " \-\-output\-all "
100 Output all available columns.
102 .BR \-P , " \-\-pairs"
103 Produce output in the form of key="value" pairs.
104 All potentially unsafe characters are hex-escaped (\\x<code>).
106 .BR \-p , " \-\-paths"
107 Print full device paths.
110 Produce output in raw format. All potentially unsafe characters are hex-escaped
111 (\\x<code>) in the NAME, KNAME, LABEL, PARTLABEL and MOUNTPOINT columns.
113 .BR \-S , " \-\-scsi"
114 Output info about SCSI devices only. All partitions, slaves and holder devices are ignored.
116 .BR \-s , " \-\-inverse"
117 Print dependencies in inverse order.
119 .BR \-t , " \-\-topology"
120 Output info about block-device topology.
121 This option is equivalent to
122 .BR -o\ NAME,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,ROTA,SCHED,RQ-SIZE,RA,WSAME .
124 .BR \-V , " \-\-version"
125 Display version information and exit.
127 .BR \-x , " \-\-sort " \fIcolumn\fP
128 Sort output lines by \fIcolumn\fP. This option enables \fB\-\-list\fR output.
130 For partitions, some information (e.g. queue attributes) is inherited from the
135 command needs to be able to look up each block device by major:minor numbers,
136 which is done by using
138 This sysfs block directory appeared in kernel 2.6.27 (October 2008).
139 In case of problems with a new enough kernel, check that CONFIG_SYSFS
140 was enabled at the time of the kernel build.
148 not found all specified devices
150 some specified devices found, some not found
154 Milan Broz <mbroz@redhat.com>
155 Karel Zak <kzak@redhat.com>
158 .IP LIBBLKID_DEBUG=all
159 enables libblkid debug output.
160 .IP LIBMOUNT_DEBUG=all
161 enables libmount debug output.
162 .IP LIBSMARTCOLS_DEBUG=all
163 enables libsmartcols debug output.
164 .IP LIBSMARTCOLS_DEBUG_PADDING=on
165 use visible padding characters. Requires enabled LIBSMARTCOLS_DEBUG.
171 The lsblk command is part of the util-linux package and is available from
172 https://www.kernel.org/pub/linux/utils/util-linux/.