The lsblk command shows all the disks, partitions and other storage devices that Linux knows about. It only reads information and changes nothing, so it is a safe first step before you format, mount or split up a disk.
What it does
Every computer stores its files on one or more storage devices. Think of an internal drive, a USB stick or a memory card. Linux often divides a drive into parts called partitions, and each part can hold its own files.
lsblk gives you an overview of all of this. It is like the directory board in the lobby of an office building. The board lists each floor and the offices on it, but you never have to open a door to read it. In the same way, lsblk shows each drive and the partitions inside it, and it opens or changes nothing.
In the terminal (the text window where you type commands), you type one short word to see the list:
lsblk
The result is a small tree. Each drive appears on its own line, with its partitions indented under it. It can also show the size of each item and its mount point: the place where Linux makes the files on that item visible.
Most people never need this command for everyday work. It becomes important when you want to install Linux, prepare a USB stick or add a new drive. In those moments, picking the wrong device can erase the wrong files. Checking with lsblk first is like reading the label on a box before you throw it away.
How to use it
lsblk is part of util-linux, a basic set of system tools that Linux distributions build on. The project lives in the util-linux repository on GitHub. You can run every example below as a normal user.
lsblk
This prints all block devices as a tree, with partitions under their parent disk.
lsblk -f
This shows filesystem details: the type, version, label, UUID (a unique ID for the filesystem), free space, percentage used and all mount points.
lsblk -o NAME,SIZE,TYPE,MOUNTPOINTS
The -o option replaces the default columns with only the columns you name, here name, size, type and mount points.
lsblk -o +UUID
The + before the column list keeps the default columns and adds the UUID column to them.
lsblk -d
This leaves out partitions and other dependent devices, so you see only the whole disks.
lsblk -p
This prints the full device path, such as /dev/sdX1, instead of the short name.
lsblk -a
By default, lsblk hides empty devices and RAM disks; -a disables those filters and lists everything.
lsblk --list-columns
This shows every column name that you can use with -o, for example MODEL, SERIAL, ROTA and TRAN.
A few more options are useful in daily work. -l prints a flat list instead of a tree. -b shows sizes in bytes instead of human-readable units. -J prints JSON, which other programs can read. -m shows the owner, group and permissions of each device.
Before you partition or format a disk, run lsblk -f and compare the size, label and mount points with the disk you expect. If anything does not match, stop and check again. The command works the same way on every distribution that ships util-linux, so you do not need different commands per distro family. Older util-linux releases may lack some of the newer columns.
How it works
A block device is storage that the kernel reads and writes in blocks: a disk, a partition, an LVM volume or a loop device. In normal use, lsblk does not read the devices directly. It collects its data from sysfs and the udev database. To find devices, it looks up /sys/dev/block, so the kernel must be built with CONFIG_SYSFS.
Some values belong to the whole disk, not to a single partition. Partitions inherit these from their parent device, for example the queue attributes.
Root access and fallback probing
Normal users can see filesystem types, labels and UUIDs because lsblk reads them from udev. Root becomes necessary only in a fallback case. That happens when there is no udev database, or when lsblk was built without udev support. Then lsblk reads the labels, UUIDs and filesystem types directly from the device.
The --properties-by option controls the order of these methods. Its default is file,udev,blkid. The file method only applies together with --sysroot. For filesystem and RAID details, the Debian man page names blkid(8) as the authoritative source, so use it when the two tools disagree.
Columns and filters
-f is a shortcut for -o NAME,FSTYPE,FSVER,LABEL,UUID,FSAVAIL,FSUSE%,MOUNTPOINTS. Likewise, -m stands for -o NAME,SIZE,OWNER,GROUP,MODE. -O prints every available column at once.
Note the difference between two similar columns. MOUNTPOINT shows a single mount point, usually the last one mounted. MOUNTPOINTS shows all of them, in a cell that spans several lines. A filesystem that is mounted in more than one place will therefore look different in each column.
The tree is drawn in the NAME column. --tree forces a tree, -l gives a flat list, and -i uses plain ASCII characters for the tree lines. -s turns the tree around and shows dependencies in inverse order. That helps when you start from a partition and want to see what it belongs to.
-e hides devices by major number and takes a comma-separated list. RAM disks have major number 1 and are hidden by default; -a shows them again.
-t adds topology columns. These include alignment, I/O sizes, sector sizes, the rotational flag and the I/O scheduler.
Use in scripts
The man page warns that the default output can change between releases. A script should never depend on it. Always name the columns with --output and use --list, or use -J when another program parses the result. Add -b when you need exact sizes instead of rounded units.
The environment variable LSBLK_COLUMNS sets a default column list, separated by commas. Be careful with it in scripts, because a value set by the user changes the default output.
The exit codes let a script check the result:
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Failure |
| 32 | None of the given devices was found |
| 64 | Some of the given devices were found, others not |
The man7.org copy of the man page is dated 2026-05-24 and describes util-linux 2.43.devel.
Still unclear:
- Which util-linux release first added the FSVER, FSAVAIL and FSUSE% columns that
-fnow shows. Older systems may lack them.
Sources
- lsblk(8) - Linux manual page — man7.org
- lsblk(8) - util-linux man page — manpages.debian.org
- tldr lsblk (linux) — tldr-pages (GitHub)
