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.

What is the lsblk command?

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.

More in This Category
Linux rsync Command: Synchronize Files and Directories

Linux rsync Command: Synchronize Files and Directories

Learn how to synchronize Files and Directories with the Linux rsync command, including practical examples, key options, and important precautions.

Linux chgrp Command: Change a File's Group

Linux chgrp Command: Change a File's Group

Learn how to change a File's Group with the Linux chgrp command, including practical examples, key options, and important precautions.

Linux Tutorial / File Permissions and Safe sudo Use

Linux Tutorial / File Permissions and Safe sudo Use

Learn to read file and directory permissions, practice chmod safely, and understand when to use sudo and how to diagnose access errors.

Linux tac Command: Print Lines in Reverse Order

Linux tac Command: Print Lines in Reverse Order

Learn how Linux tac prints records from last to first, handles multiple files and custom separators, and helps inspect recent log entries in reverse order.

Linux dd Command: Copy and Convert Data by Blocks

Linux dd Command: Copy and Convert Data by Blocks

Learn how to copy and convert files or block devices with Linux dd, choose block sizes and ranges, display progress, verify results, and avoid overwriting the wrong device.

Linux ss Command: Inspect Open Ports and Sockets

Linux ss Command: Inspect Open Ports and Sockets

Learn how to inspect Open Ports and Sockets with the Linux ss command, including practical examples, key options, and important precautions.

Linux w Command: Show Logged-In Users and Their Processes

Linux w Command: Show Logged-In Users and Their Processes

Learn how to show Logged-In Users and Their Processes with the Linux w command, including practical examples, key options, and important precautions.

Linux touch Command: Create Files and Change Timestamps

Linux touch Command: Create Files and Change Timestamps

Learn how to use the Linux touch command to create empty files and change access or modification timestamps, including reference times, date formats, and symlink handling.

Linux reboot Command: Restart the System Safely

Linux reboot Command: Restart the System Safely

Learn how to restart the System Safely with the Linux reboot command, including practical examples, key options, and important precautions.

Linux chmod Command: Change File and Directory Permissions

Linux chmod Command: Change File and Directory Permissions

Learn how to change File and Directory Permissions with the Linux chmod command, including practical examples, key options, and important precautions.