Two commands answer almost every storage question on a Linux box. lsblk shows the shape of your storage: which disks exist, how they are partitioned, and where each partition is mounted. blkid reads the filesystem metadata itself and prints the UUID, label, and filesystem type you need when editing /etc/fstab or writing udev rules.
The walkthrough below runs both commands on a live Ubuntu server and compares them so you know which one to reach for, with our guide to monitoring CPU, disk, and memory usage as the follow-up once you can name every device.
What lsblk shows you
Run lsblk with no arguments and it prints every block device in a tree. Each disk, partition, loop device, and mount point appears as a branch of its parent, so you can see the full hierarchy at a glance:
lsblk

Read the columns left to right. NAME is the device name under /dev, MAJ:MIN is the kernel’s major:minor device number, RM is 1 for removable hardware, SIZE is capacity, RO is the read-only flag, TYPE separates disk from part from lvm from loop, and MOUNTPOINTS tells you where each filesystem is attached.
On Ubuntu desktops and servers you will see many loop devices holding snap packages. Filter them out with a grep pipe:
lsblk | grep -v "loop"

The loop entries disappear and only physical disks and their partitions remain.
The tree comes from two sources: the sysfs filesystem and the udev database. That is why lsblk works without root privileges on most systems. If udev has not yet recorded a newly plugged-in device, run sudo udevadm settle first to let it catch up.
Choose your own columns with -o
The default column set is only a sample. The -o option takes any comma-separated list of columns, which matters more than it sounds: the man page warns that default output can change between util-linux releases, so scripts should always request explicit columns:
lsblk -o NAME,RM

In this output RM shows 0 for fixed storage and 1 for removable devices such as USB sticks. Useful columns include FSTYPE, LABEL, UUID, MOUNTPOINT, MODEL, SERIAL, and PARTUUID. Run lsblk –list-columns (or the older lsblk –help) for the complete list your build supports.
Filesystem details with -f
When you need UUIDs and labels without leaving the tree view, use the –fs shorthand. It is equivalent to -o NAME,FSTYPE,FSVER,LABEL,UUID,FSAVAIL,FSUSE%,MOUNTPOINTS and is the fastest way to answer “which partition holds which filesystem”:
lsblk --fs | grep -v loop

This single command covers most day-to-day needs. The UUID column feeds directly into an fstab entry, FSUSE% gives a rough fill level per filesystem, and empty FSTYPE cells reveal unformatted space that still needs mkfs before it is usable.
How blkid differs
blkid answers a different question. Instead of mapping the device tree, it reads the superblock of each filesystem directly and prints the attributes stored there: UUID, LABEL, TYPE, BLOCK_SIZE, and PARTUUID. Run it without arguments to list everything:
sudo blkid

Each line follows a key=”value” format that is easy to parse. A typical entry looks like this:
/dev/sda1: LABEL="cloudimg-rootfs" UUID="0a13642d-6049-451e-8d25-4c07cd31768f" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="daa9a574-99f0-449e-b43a-463650870efb"
Query one device by passing its path, and resolve a known UUID back to its device with -U before you trust what an fstab entry will mount at boot:
sudo blkid /dev/sda1
sudo blkid -U 0a13642d-6049-451e-8d25-4c07cd31768f
For scripting, prefer machine-readable output over the default display format. The -o value form prints just the token you ask for, which slots straight into a shell variable:
sudo blkid -s UUID -o value /dev/sda1
sudo blkid -o list
The first command prints only the UUID string. The second renders a friendly table of device, filesystem type, label, mount point, and UUID.
One caveat applies to both: blkid reads raw superblocks, so unprivileged runs may miss devices whose metadata the kernel has not cached. Use sudo when a result looks incomplete.
Which command should you use?
Both tools ship in the util-linux package present on every mainstream distribution, so the choice is about the question you are asking, not what is installed. This table maps common tasks to the right tool:
| Task | Use | Why |
|---|---|---|
| See the disk and partition layout | lsblk | Tree view shows parent-child relationships |
| Find where a filesystem is mounted | lsblk | MOUNTPOINTS column, no root needed |
| Get a UUID for /etc/fstab | blkid | Reads the authoritative superblock values |
| Look up a device from a known UUID | blkid -U | Reverse lookup lsblk cannot do |
| Script-safe structured output | Either | lsblk -o / –json, blkid -o value |
| Identify an unmounted USB drive before formatting | lsblk + blkid | Find the node with lsblk, confirm contents with blkid |
A practical habit pairs them: run lsblk to locate the device, then blkid to read its identifiers before you touch /etc/fstab, format anything, or write a mount rule. Mounting by UUID instead of device name keeps mounts stable when ports or drivers change, since sdb today may be sdc after a reboot. The same identification flow applies when you attach foreign media: find the device with lsblk, confirm its filesystem with blkid, then follow our walkthrough to mount a Windows NTFS drive on Linux.
Is lsblk or blkid better for finding a UUID?
blkid prints UUIDs straight from the filesystem superblock and supports reverse lookup with blkid -U. lsblk -f also shows UUIDs inside the familiar tree view, so either works for reading, but scripts that resolve a UUID to a device should use blkid.
Why does lsblk show so many loop devices?
On Ubuntu and other snap-based distributions every installed snap package occupies a squashfs loop device. Filter them from the output with lsblk | grep -v loop.
Do lsblk and blkid require root privileges?
lsblk usually works as a normal user because it reads sysfs and the udev database. blkid reads raw superblocks, so run it with sudo when results look incomplete or a device was recently connected.
What is the difference between UUID and PARTUUID?
UUID identifies the filesystem created inside a partition and changes if you reformat. PARTUUID identifies the partition entry in the GPT or MBR table and survives reformatting. Both appear in blkid output.
Wrapping up
lsblk maps the hardware, blkid reads the metadata, and together they cover every identification task short of benchmarking. Next time a mount fails at boot or a new drive shows up unnamed, run lsblk –fs first and sudo blkid second. To go further into storage management, our guides to disk partitioning in Linux, the Linux filesystem explained, and ext4 versus Btrfs pick up exactly where this one ends.
