List block devices in a tree view showing partitions and mount points.
low risk
lsblk displays block devices (disks, partitions, LVM, NVMe) in a tree structure with sizes, types, and mount points. Far clearer than parsing fdisk or df output for understanding disk layout. The -f flag adds filesystem and UUID info.
| Flag | Meaning |
|---|---|
-f --fs | Show filesystem type, UUID, and label |
-d --nodeps | Don't show device dependencies (list disks only) |
-J --json | JSON output |
-o --output | Select specific columns |
lsblkTree view of all block devices · explain & risk-check →lsblk -fInclude filesystem type, UUID, and mount points · explain & risk-check →lsblk -d -o NAME,SIZE,ROTA,TYPEList disks with rotation (HDD vs SSD) · explain & risk-check →lsblk -J | jq '.blockdevices[] | {name:.name, size:.size}'JSON output for scripting · explain & risk-check →Check `ROTA` column in `lsblk -d -o NAME,SIZE,ROTA` — ROTA=1 means HDD (spinning), ROTA=0 means SSD/NVMe. Critical for setting correct I/O scheduler and benchmark expectations.
Reference text is hand-written and may be incomplete — check man lsblk for your version. Test destructive commands on a non-production system first.