lsblk Command Cheat Sheet
The lsblk command lists information about block devices such as disks, partitions, and logical volumes.
It displays the device hierarchy in a tree-like format.
Basic Usage
Lists all block devices.
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 100G 0 disk
├─sda1 8:1 0 96G 0 part /
└─sda2 8:2 0 4G 0 part [SWAP]
List All Devices Including Empty
Shows devices even if they have no filesystem or mountpoint.
lsblk -a
loop0 7:0 0 55M 1 loop
Show Filesystem Information
Displays filesystem type, UUID, and labels.
lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda1 ext4 9e3b...
Show Permissions and Ownership
Includes device permissions, owner, and group.
lsblk -m
NAME MODE OWNER GROUP
sda brw-rw---- root disk
Show Only Disks
Filters output to show disks only.
lsblk -d
NAME SIZE TYPE
sda 100G disk
Output as List (No Tree)
Displays output without the tree hierarchy.
lsblk -l
sda disk 100G
sda1 part 96G
Select Specific Columns
Shows only specified columns.
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT
NAME SIZE TYPE MOUNTPOINT
sda1 96G part /
Show Transport Type
Displays the transport type (USB, SATA, NVMe).
lsblk -o NAME,TRAN
NAME TRAN
sdb usb
Show JSON Output
Outputs device information in JSON format.
lsblk -J
{
"blockdevices": [
{
"name": "sda",
"size": "100G",
"type": "disk"
}
]
}
Exclude Loop Devices
Hides loop devices from output.
lsblk -e 7
sda
├─sda1