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