lsblk Command Generator
Generate lsblk commands to list block devices
Getting Started with lsblk
## What is lsblk?
The `lsblk` command lists block devices (disks, partitions, LVM volumes, loop mounts) in a tree, showing how partitions relate to their parent disks. It's the cleanest way to see what storage is attached to a system and how it's laid out.
## How to Use
1. **Run Plain**: With no options, `lsblk` shows all devices in a default tree. 2. **Add Detail (optional)**: Show filesystem info (`-f`), permissions (`-m`), or pick specific columns (`-o`). 3. **Target (optional)**: Restrict output to one device (e.g. `/dev/sda`). 4. **Copy & Run**: Copy the generated command into your terminal.
Common Options
### `-f` Filesystem info Add columns for filesystem type (FSTYPE), label, UUID, and mount point. Essential for identifying which partition holds which filesystem and where it's mounted.
### `-m` Permissions Show owner, group, and permission mode for each device node — useful when troubleshooting access denied errors reading a raw device.
### `-t` Tree format Print the output as a plain tree (rather than the default indented block view). Easier to parse in scripts.
### `-r` Raw format Output in a simple pipe-separated raw format with no tree indentation — best for machine parsing with `awk` or similar.
### `-o` Custom columns Select exactly which columns to display. Presets range from basic (`NAME,SIZE,TYPE,MOUNTPOINT`) to full (`NAME,SIZE,TYPE,FSTYPE,FSVER,MOUNTPOINT,LABEL,UUID`).
▶What's the difference between lsblk and fdisk -l?
▶How do I find the UUID of a partition for /etc/fstab?
▶How do I list only one disk and its partitions?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee