What the ls Block Command Does
The ls block command lists all the block devices on your Linux system — the hardware that stores data in fixed-size chunks, like hard drives, SSDs, and USB drives. When you run lsblk (the actual command name), it shows you a tree view of every storage device connected to your computer, how they're partitioned, and how much space each one uses.
This is different from a regular ls command, which lists files and folders. The block command shows the physical hardware itself. You'll see device names like /dev/sda, /dev/sdb, and their partitions like /dev/sda1 or /dev/sda2.
Key Takeaways
- The lsblk command displays all storage devices and partitions on your system in a tree format that's straightforward to read.
- Each device gets a name starting with /dev/ — the first drive is usually /dev/sda, the second is /dev/sdb, and partitions are numbered like /dev/sda1.
- You can see the size, type, and mount point of each device without needing administrator permissions.
- Adding flags like -a, -f, or -o changes what information appears and how it's organized.
How to Run the Basic Command
Open a terminal and type lsblk, then press Enter. You don't need to be root or use sudo — the command works for any user. The output will show a tree with your devices listed from top to bottom.
Each line shows a device or partition name on the left, then columns for size, type, and where it's mounted (if anywhere). Indented lines are partitions that belong to the device above them. For example, if you see sda with sda1 indented below it, that means partition 1 is part of the sda drive.
The output stays on screen until you scroll past it or close the terminal. If the output is very long, you can pipe it to less to scroll through it: lsblk | less.
Understanding the Output Columns
The default output shows several columns. NAME is the device identifier. MAJ:MIN are major and minor device numbers that the kernel uses internally — you rarely need these. RM shows whether the device is removable (1 for yes, 0 for no), which matters for USB drives and external disks.
SIZE is the total capacity of the device or partition. RO indicates read-only status (1 means the device is locked against writing). TYPE shows whether it's a disk, partition, or loop device. MOUNTPOINT shows where the device is mounted in your file system — for example, / for your root partition or /home for your home directory. If a device isn't mounted, this column is empty.
Common Flags and What They Show
The -a flag shows all devices, including empty ones and loop devices you might not care about. The -f flag switches to a flat list instead of a tree — useful if the tree format is hard to read on your screen. The -o flag lets you pick exactly which columns to display.
For example, lsblk -o NAME,SIZE,MOUNTPOINT shows only the device name, size, and where it's mounted. This cuts out the noise if you're looking for one specific piece of information. The -d flag shows only the top-level devices, hiding all partitions — useful if you want to see how many physical drives you have without the clutter.
The -i flag removes the tree symbols (the lines and corners that show hierarchy), which can help if you're copying the output into a document or script. The -b flag shows sizes in bytes instead of the human-readable format (like GB or MB).
When You'll Actually Use This Command
The most common reason to run lsblk is to find out what storage devices are connected and what their device names are. If you're about to format a drive or create a partition, you need to know whether the drive you want is /dev/sdb or /dev/sdc — running the command first prevents you from erasing the wrong disk.
You'll also use it to check whether a USB drive or external disk is recognized by your system and what its device name is. If you're troubleshooting a mounting problem, lsblk shows you whether the partition exists and whether it's already mounted somewhere. System administrators use it to monitor storage capacity across multiple drives and to plan partitioning before installation.
Combining lsblk With Other Commands
You can pipe lsblk output to grep to filter for specific devices. For example, lsblk | grep sda shows only lines containing "sda" — useful if you have many devices and want to focus on one. You can also redirect the output to a file with lsblk > devices.txt if you need to save a record of your system's storage layout.
Some administrators combine lsblk with df (which shows disk space usage) or fdisk (which manages partitions). Running lsblk first tells you what devices exist, then df tells you how full they are, and fdisk lets you modify them if needed.
Frequently Asked Questions
Why do some devices show no MOUNTPOINT?
A device with no mount point exists but isn't currently connected to your file system. This is normal for external drives that aren't plugged in, partitions you haven't mounted yet, or devices that are formatted but not in use. You can mount them manually with the mount command if you need to access them.
What's the difference between /dev/sda and /dev/sda1?
/dev/sda is the entire physical drive. /dev/sda1, /dev/sda2, and so on are partitions — sections of that drive. A single drive can have multiple partitions, each with its own file system and mount point. The tree format in lsblk shows this relationship clearly.
Can I use lsblk to see how much space is actually used?
No — lsblk shows only the size of each device and partition, not how much is filled. Use df to see used and available space. For example, df -h shows human-readable usage for all mounted partitions.
Do I need special permissions to run lsblk?
No. Regular users can run lsblk without sudo. However, some operations that follow — like formatting a drive or creating partitions — do require administrator permissions.
What does "loop" mean in the TYPE column?
A loop device is a virtual block device that points to a file instead of physical hardware. This is commonly used for ISO images or encrypted containers. You can usually ignore loop devices unless you're working with disk images or virtual storage.