lsblk — List Block Devices as a Tree
Practical guide to lsblk — show disks, partitions and mount points as a readable tree and pick the right device before running dd, fdisk or mount.
lsblk lists every block device on your system – hard disks, SSDs, partitions, loop devices and USB sticks – as a readable tree with name, size, type and mount point. It reads its information straight from the kernel (sysfs/udev) and is a pure read-only command: it changes nothing and is safe to run as often as you like. That makes lsblk the ideal sanity check before you operate on a device with dd, fdisk or mount – you confirm exactly which /dev/… you are dealing with and avoid grabbing the wrong disk by accident.
Basic Usage
lsblk — List all block devices in tree format.
lsblklsblk -a — Show all devices including empty ones.
lsblk -alsblk <device> — Show info for a specific device.
lsblk /dev/sdalsblk -l — List format (flat, no tree).
lsblk -lOutput Columns
lsblk -f — Show filesystem type, label, UUID, and mount point.
lsblk -flsblk -o <columns> — Show specific columns.
lsblk -o NAME,SIZE,FSTYPE,MOUNTPOINT,UUIDlsblk -o NAME,SIZE,TYPE,TRAN,MODEL — Show device model and transport type.
lsblk -o NAME,SIZE,TYPE,TRAN,MODELlsblk -O — Show all available columns.
lsblk -Olsblk --help — Show help, including the list of all available column names.
lsblk --helpOutput Formats
lsblk -J — Output in JSON format.
lsblk -Jlsblk -P — Output in key=value pairs format.
lsblk -Plsblk -r — Raw output (for scripting).
lsblk -r -o NAME,SIZE,MOUNTPOINTlsblk -b — Show sizes in bytes instead of human-readable.
lsblk -bFiltering
lsblk -d — Show only whole disks (no partitions).
lsblk -dlsblk -n — Suppress the header line.
lsblk -n -o NAME,SIZElsblk -e <major> — Exclude devices by major number (7=loop).
lsblk -e 7lsblk -I <major> — Include only devices with a specific major number (8=SCSI/SATA).
lsblk -I 8Common Patterns
lsblk -d -o NAME,SIZE,MODEL,TRAN — List physical disks with model and interface type.
lsblk -d -o NAME,SIZE,MODEL,TRANlsblk -f -o NAME,FSTYPE,SIZE,MOUNTPOINT,FSUSE% — Show filesystem usage per partition.
lsblk -f -o NAME,FSTYPE,SIZE,MOUNTPOINT,FSUSE%lsblk -o NAME,UUID -n -l | grep -v '^$' — List all partition UUIDs (for fstab).
lsblk -o NAME,UUID -n -l | grep -v '^$'lsblk -S — Show SCSI/SATA device information.
lsblk -S Conclusion
lsblk is one of those commands worth picking up early: a single call gives you a clear overview of every disk, its partitions and where they are mounted. Day to day you mostly need plain lsblk for the tree and lsblk -f to see filesystems, labels and UUIDs; with -o and -J you tailor the output for reports or scripts. Its biggest value is as a safe sanity check: always confirm with lsblk which /dev/… device you are looking at before you touch it with dd, fdisk or mount. lsblk itself writes nothing and does no harm – the danger only arises when you hand the wrong device to a destructive command.
Further Reading
- lsblk(8) — man page – complete reference of all options and output columns
- Arch Wiki: Persistent block device naming – how UUIDs and labels from lsblk map to stable device names in fstab