lsblk
Overview
lsblk lists block devices (disks, partitions, LVM, loop, ROM) as a tree. First stop when you plug in a disk, build fstab entries, or figure out “what is /dev/sdb1?”.
Syntax
lsblk [options] [device...]Common Options
| Option | Description |
|---|---|
-f |
Filesystem type, LABEL, UUID, FSAVAIL, mountpoints |
-o COLS |
Custom columns |
-p |
Full device paths |
-a |
Empty devices too |
-d |
Devices only (no holders/slaves tree expansion styles) |
-e 7 |
Exclude major numbers (e.g. loop) |
-J / -O |
JSON / all columns |
-t |
Topology (alignment, sched) |
-S |
SCSI devices only |
Useful columns: NAME,SIZE,TYPE,FSTYPE,LABEL,UUID,MOUNTPOINTS,MODEL,TRAN,ROTA.
Examples with Explanations
Everyday inventory
lsblk
lsblk -f
lsblk -pUUID-ready view for fstab
lsblk -o NAME,SIZE,FSTYPE,LABEL,UUID,MOUNTPOINTSHide loop noise (snaps)
lsblk -e 7
# or: lsblk | grep -v loopJSON for scripts
lsblk -J -o NAME,SIZE,TYPE,MOUNTPOINTS | jq .Topology / rotational?
lsblk -d -o NAME,SIZE,ROTA,TYPE,TRAN,MODEL
# ROTA=0 often SSD/NVMe; TRAN=nvme|sata|usbOne device
lsblk -f /dev/nvme0n1Understanding Output
- Tree shows parent disk → partitions → LVM/mapper children.
- Multiple
MOUNTPOINTSpossible with bind mounts (util-linux recent).
- Empty FSTYPE usually means raw/unformatted or special.
Notes & Pitfalls
- Kernel names (
sdX,nvme0n1p1) can change; prefer UUID/LABEL in fstab.
lsblkdoes not free space of filesystems — usedffor that.
- Needs permissions for some details; usually fine unprivileged for listing.