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