🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

lsblk Command

Beginner System Information man(1)

List information about block devices (disks)

👁 10 views 📅 Updated: Mar 15, 2026
SYNTAX
lsblk [OPTION]...

What Does lsblk Do?

lsblk lists information about all available block devices (disks, partitions, LVM volumes, etc.). It shows device names, sizes, types, mount points, and filesystem types in a tree format.

lsblk is the primary tool for understanding disk layout — which disks are present, how they are partitioned, and where they are mounted. It presents information in a clear hierarchical tree showing disks and their partitions.

lsblk reads from sysfs and does not require root privileges, making it safer and faster than fdisk -l for viewing disk information.

Options & Flags

OptionDescriptionExample
-f Show filesystem type, label, UUID, and mount point lsblk -f
-l List format (no tree) lsblk -l
-o Specify output columns lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,FSTYPE
-d Show only disk devices (no partitions) lsblk -d
-p Print full device paths lsblk -p
-J JSON output lsblk -J
-b Print sizes in bytes lsblk -b

Practical Examples

#1 List all block devices

Shows disks and partitions in tree format.
$ lsblk
Output: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 500G 0 disk ├─sda1 8:1 0 512M 0 part /boot/efi ├─sda2 8:2 0 499G 0 part / sdb 8:16 0 1T 0 disk /data

#2 Show filesystems

Shows filesystem type, label, UUID, and mount point.
$ lsblk -f

#3 Custom columns

Shows only specific columns.
$ lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,FSTYPE

#4 Disks only

Shows only disk devices with model names.
$ lsblk -d -o NAME,SIZE,MODEL
Output: NAME SIZE MODEL sda 500G Samsung SSD 870 sdb 1T WD Blue

#5 JSON output

Outputs device information in JSON format for scripting.
$ lsblk -J

#6 Full paths

Shows full device paths (/dev/sda1 instead of sda1).
$ lsblk -p -o NAME,SIZE,MOUNTPOINT

Tips & Best Practices

Use -f for UUIDs: lsblk -f shows filesystem UUIDs needed for /etc/fstab entries. More reliable than device names which can change.
lsblk vs fdisk: lsblk shows device info without root. fdisk -l shows partition tables but requires root. Use lsblk for viewing, fdisk for modifying.
Not all devices shown: lsblk shows block devices only. Network mounts (NFS), tmpfs, and other non-block filesystems are not shown. Use df for mount points.

Frequently Asked Questions

How do I see all disks and partitions?
Run lsblk to see the tree view, or lsblk -f to include filesystem types and mount points.
How do I find the UUID of a partition?
Use lsblk -f or blkid. UUIDs are needed for reliable /etc/fstab entries.
How do I check disk sizes?
lsblk -d shows only disk devices with sizes. lsblk shows all devices including partitions.

Master Linux with Professional eBooks

Curated IT eBooks covering Linux, DevOps, Cloud, and more

Browse Books →