lsblk is a Linux command-line utility that lists block devices, such as disks, partitions, logical volumes and loop devices, and shows how they relate to one another in a tree view. In filesystem administration, it is usually the first command an administrator runs to answer a basic question: which storage devices exist, how large they are and where they are mounted.
The tool is part of the util-linux package, so it is present on virtually every Linux distribution. It reads information from sysfs and the udev database rather than probing the disks directly, which makes it fast, safe to run and usable without root privileges for most columns.
How lsblk gathers block device information
A block device is a storage device that the kernel accesses in fixed-size blocks, such as an SSD, an NVMe namespace, a USB stick or a device-mapper volume. The kernel publishes each one under `/sys/block` and /sys/dev/block, together with attributes such as size, rotational flag and the list of holders and slaves.
lsblk walks this sysfs hierarchy and builds the parent-child relationships: a partition is a child of its disk, a LUKS mapping is a child of its partition, and an LVM logical volume is a child of the physical volume beneath it. Filesystem labels, UUIDs and types come from the udev database or, when that is unavailable, from libblkid. Mount points are read from `/proc/self/mountinfo`.
Because the command does not open the devices themselves, it neither wakes sleeping disks for most columns nor risks modifying data. The trade-off is that its view is only as current as udev: on a freshly attached device, some fields may appear empty until udev finishes processing the event.
The table below lists the data sources and what each contributes to the output.
| Source | Information provided | Note |
|---|---|---|
| sysfs | Device names, sizes, hierarchy, rotational flag | Always available on a running kernel |
| udev database | Filesystem type, label, UUID, model, serial | May lag behind hot-plug events |
| libblkid | Filesystem signatures as a fallback | Needs read access to the device |
| mountinfo | Current mount points | Reflects the caller’s mount namespace |
Output columns and useful options
By default, lsblk prints seven columns: NAME, MAJ:MIN, RM, SIZE, RO, TYPE and MOUNTPOINTS. The TYPE column distinguishes disk, part, lvm, crypt, loop and rom, which immediately shows how a storage stack is assembled.
The following table explains the columns that administrators request most often with the `-o` option.
| Column | Meaning | Typical value |
|---|---|---|
| NAME | Kernel device name in tree form | nvme0n1p2 |
| SIZE | Capacity in binary units | 476.9G |
| TYPE | Kind of block device | disk, part, lvm, crypt |
| FSTYPE | Filesystem or signature type | ext4, xfs, LVM2_member |
| UUID | Filesystem UUID used in fstab | 36-character identifier |
| MOUNTPOINTS | All current mount locations | /, /home, [SWAP] |
| ROTA | Rotational device flag | 1 for HDD, 0 for SSD |
| MODEL | Device model string | Vendor model name |
Several options change the format rather than the content. `-f` shows filesystem details, `-p` prints full paths such as /dev/sda1, `-J` produces JSON, `-P` produces key-value pairs, and `-b` reports sizes in bytes. For scripts, the combination `lsblk -J -b -o NAME,SIZE,TYPE` gives stable, machine-readable output that does not depend on locale or human-readable rounding.
lsblk compared with related storage commands
lsblk is an inventory tool, not a partitioning or diagnostic tool. Its neighbors in the filesystem toolset each answer a narrower question, and knowing which one to run saves time and avoids running privileged tools unnecessarily.
The comparison below places lsblk among the commands most often confused with it.
| Command | Main question answered | Root needed | Changes data |
|---|---|---|---|
| lsblk | Which block devices exist and how they nest | No, for most columns | No |
| blkid | Which filesystem signature and UUID a device has | Often yes | No |
| fdisk -l | What the partition table contains | Yes | No, in list mode |
| df | How much space mounted filesystems use | No | No |
| findmnt | What is mounted where, with options | No | No |
| mount | Attach a filesystem to a mount point | Yes | Yes, changes mount state |
A common source of confusion is the difference between lsblk and df. lsblk reports the size of the device, while df reports the used and free space inside a mounted filesystem. A 500 GB partition can show 500G in lsblk and only 120G used in df, and both values are correct.
Typical tasks and recommended invocations
In daily administration, lsblk is used to identify the correct device before a destructive action, such as formatting with mkfs, writing an image or extending a logical volume. Running it before and after plugging in a device is the most reliable way to see which name the kernel assigned.
The decision table below matches common tasks with the most useful invocation.
| Task | Command | Why |
|---|---|---|
| Find a new USB drive | lsblk -o NAME,SIZE,RM,MODEL | RM and MODEL reveal removable media |
| Write an fstab entry | lsblk -f | Shows UUID and filesystem type |
| Inspect an LVM or LUKS stack | lsblk with no options | Tree shows each layer |
| Check SSD versus HDD | lsblk -d -o NAME,ROTA | ROTA flag separates disk types |
| Feed a script | lsblk -J -b | JSON with exact byte sizes |
| Check discard support | lsblk --discard | Shows TRIM granularity values |
- Use `-d` to hide partitions and list only whole disks.
- Use `-e7` to exclude loop devices, which clutter output on systems with snap packages.
- Use `-T` with a column list to control the tree output in newer util-linux versions.
Limitations and common mistakes
lsblk shows what the kernel currently knows, so it can be misleading right after changes. A new partition created with a partitioning tool may not appear until the kernel rereads the partition table, for example with partprobe, and empty FSTYPE fields often mean the udev database has not been updated rather than that the device is blank.
The table below lists symptoms that administrators frequently misread.
| Symptom | Real cause | Fix |
|---|---|---|
| FSTYPE and UUID are empty | udev data missing or no read access | Run as root or udevadm settle |
| New partition is missing | Kernel still uses the old table | Run partprobe or reboot |
| Many loop devices listed | Snap or image mounts | Exclude major number 7 with -e7 |
| Device names changed after reboot | Kernel names are not persistent | Use UUID or LABEL in fstab |
| Mount point missing in a container | Different mount namespace | Run lsblk in the host namespace |
The most serious mistake is relying on device names such as `/dev/sdb` in scripts or fstab. These names depend on detection order and can change between boots, so persistent identifiers like UUID, PARTUUID or LABEL are the safe choice.
A non-technical view
lsblk is like a floor plan of the storage in a computer. It shows every disk, how each disk is divided into sections, and which folder each section is connected to. It only looks; it never changes anything.
People run it whenever they need to be sure which disk is which, for example before erasing a USB stick. The key takeaway is simple: check with lsblk first, then act on the right device.
A concrete example
A support technician must write a Linux installer image to a 16 GB USB stick on a workstation that also contains two internal drives. Choosing the wrong target with dd would erase the internal data.
Before inserting the stick, the technician runs lsblk -d -o NAME,SIZE,RM,MODEL and sees nvme0n1 at 953.9G and sda at 1.8T, both with RM set to 0. After inserting the stick, the same command shows a new device `sdb` at 14.6G with RM set to 1, which matches a removable 16 GB stick reported in binary units.
The technician then writes the image to /dev/sdb and runs lsblk again to confirm the new partitions. The internal drives remain untouched, and the whole check takes less than a minute.