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 nc Command: Test TCP and UDP Connections

Linux nc Command: Test TCP and UDP Connections

Learn how to test TCP and UDP Connections with the Linux nc command, including practical examples, key options, and important precautions.

Linux apropos Command: Search Commands by Description

Linux apropos Command: Search Commands by Description

Learn how to use the Linux apropos command to find relevant manual pages by searching description keywords, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux cat Command: Display and Concatenate File Contents

Linux cat Command: Display and Concatenate File Contents

Learn how to use the Linux cat command to display text files, concatenate multiple files, number lines, reveal hidden characters, and avoid unsafe redirection mistakes.

Linux comm Command: Compare Two Sorted Files

Linux comm Command: Compare Two Sorted Files

Learn how to compare Two Sorted Files with the Linux comm command, including practical examples, key options, and important precautions.

Linux Tutorial / Install and Update Packages with APT and DNF

Linux Tutorial / Install and Update Packages with APT and DNF

Compare APT on Debian or Ubuntu with DNF on Rocky Linux for searching, installing, updating, and removing packages, including repository and transaction checks.

Linux Tutorial / Inspect, Pause, and Stop Processes

Linux Tutorial / Inspect, Pause, and Stop Processes

Inspect Linux processes with ps, top, and pgrep, then safely pause, resume, and terminate a practice process while distinguishing shell jobs from services.

Linux Administration Memo: Essential Commands and System Checks

Linux Administration Memo: Essential Commands and System Checks

A compact Linux administration reference for checking system information, processes, storage, networking, users, permissions, services, and logs.

Linux hostnamectl Command: Show and Change the Host Name

Linux hostnamectl Command: Show and Change the Host Name

Learn how to show and Change the Host Name with the Linux hostnamectl command, including practical examples, key options, and important precautions.

Linux Tutorial / Understand systemd Services, Boot, and Logs

Linux Tutorial / Understand systemd Services, Boot, and Logs

Understand Linux boot stages and systemd units, distinguish active services from boot enablement, and inspect current-boot logs with systemctl and journalctl.

Linux type Command: Identify How a Command Is Resolved

Linux type Command: Identify How a Command Is Resolved

Learn how to use the Linux type command to identify aliases, functions, built-ins, keywords, and executable paths, with essential options, practical examples, output interpretation, and common troubleshooting tips.