Linux lsblk Command: Inspect Disks, Partitions, and Mounts

lsblk shows the hierarchy of block devices such as disks, partitions, and logical volumes. It is useful for checking the target device and mount points before formatting or partitioning.

The tree structure of the default output represents the relationships between devices. TYPE indicates types like disk, part, lvm, and MOUNTPOINTS shows the current mounted paths. A device can have relationships with multiple paths, and the name /dev/sdX may change depending on reboot or connection order.

Basic syntax

lsblk [options] [device]

The installed implementation and options may vary depending on the distribution. Check the description for your current system with man lsblk.

Examples

Viewing the device hierarchy

Check the relationships of currently recognized disks and partitions.

lsblk

File system identification information

View the format, label, UUID, and mount points together.

lsblk -f

Explicit column selection

Check the target device along with its size, type, and mount point side by side.

lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS

Reading Disk/Partition/Mount Relationships

The indentation in lsblk represents the parent-child relationship of block devices. The following columns show the device name, size, filesystem type, and mount point.

lsblk -o NAME,SIZE,FSTYPE,MOUNTPOINTS

Example output (device names and sizes vary depending on the environment):

NAME   SIZE FSTYPE MOUNTPOINTS
sda     40G
├─sda1   1G vfat   /boot/efi
└─sda2  39G ext4   /

sda means it is a disk, and sda1, sda2 are its partitions. Even if the mount column is empty, you should not assume the device is unused. Configurations with LVM, RAID, or encryption can be more complex, so check together with blkid and findmnt before making changes.

Main Options and Format

Options/Format Description
-f Displays file system information.
-o column_list Specifies the columns to output.
-p Displays the device name as the full path.
-J Outputs in JSON format.
-a Includes empty devices that are excluded from the default output.

Precautions when using

lsblk shows device relationships but does not guarantee data backup status or the purpose of devices. Before making changes, compare with results from blkid, findmnt, etc. In scripts for parsing, do not rely on the default column order; specify fields using -o.

Frequently Asked Questions

What does it mean if the TYPE is lvm in lsblk?

It is a virtual block device provided by the Logical Volume Manager (LVM). Check both the upper physical disks/partitions and the lower mount points together.

Official Documentation

You can check the exact behavior of the options and implementation-specific differences in the official lsblk documentation.