lsblk, blkid and findmnt: Check Disks and Mounts on Linux
List block devices with lsblk, read filesystem UUIDs and labels with blkid, and see active mount points with findmnt. Three util-linux commands, explained.
Contents
Three commands from util-linux tell you what storage a machine has and where it is mounted. lsblk lists block devices, blkid identifies what is stored on a device (filesystem type, label, UUID), and findmnt shows what is mounted where. This guide shows the options you need most.
List block devices with lsblk
lsblk reads sysfs and the udev database and prints disks, partitions and similar devices as a tree. RAM disks are left out by default.
If lsblk is missing on Fedora, install the util-linux package:
sudo dnf install -y util-linuxlsblkThe -f option adds filesystem information. According to the man page it is shorthand for the columns NAME, FSTYPE, FSVER, LABEL, UUID, FSAVAIL, FSUSE% and MOUNTPOINTS:
lsblk -fTo pick your own columns, use -o. Prefix the list with + to add columns to the defaults instead of replacing them. Add --list for a flat list without the tree:
lsblk --list -o NAME,SIZE,FSTYPE,LABEL,UUID,MOUNTPOINTSMOUNTPOINTS shows every place a device is mounted. The MOUNTPOINT column shows only one (usually the last mounted instance). The man page warns that the default output can change between versions, so scripts should always set columns with -o. Run lsblk --list-columns to see all column names on your system.
Other useful options:
-pprints full device paths such as/dev/sda1.-bprints sizes in bytes.-dhides partitions and other dependent devices, leaving only the top-level disks.-Jprints JSON, handy for scripts.
Read UUIDs and labels with blkid
blkid probes devices and prints tokens such as LABEL, UUID and TYPE. The man page says it is mainly meant for system services and for testing libblkid, and recommends lsblk or findmnt for most uses. It is still useful when you need the identifiers of one specific device.
Without arguments it covers the devices listed in /proc/partitions that it recognizes. Unprivileged users get cached, unverified information, so run it with sudo for current data:
sudo blkid
sudo blkid /dev/sda1Use -s to show only certain tags and -o value to print just the values:
sudo blkid -s UUID -o value /dev/sda1You can also search the other way round. -U finds the device with a given UUID, and -L finds the device with a given label:
sudo blkid -U 0a1b2c3d-1111-2222-3333-444455556666
sudo blkid -L BACKUPThe UUID above is a placeholder; use one from your own output. For other output formats, -o export prints KEY=value lines and -o json prints JSON.
blkid exits with status 2 when the specified token is not found or no device can be identified, which scripts can test. The -p option bypasses the cache and probes the device directly.
Show mounts with findmnt
findmnt reads the kernel mount table (/proc/self/mountinfo) and prints all mounted filesystems as a tree. As with lsblk, the default output may change, so set columns explicitly in scripts.
findmnt -o TARGET,SOURCE,FSTYPE,OPTIONS --real--real prints only real filesystems. To ask which filesystem holds a given path, use -T. If the path is not a mount point itself, findmnt walks up through its parents:
findmnt -T /etcFilter by type with -t, and combine it with -n to drop the header line:
findmnt -n -t tmpfs -o TARGETTwo more options are worth knowing. --df prints a df-style view with size, used and available space. -x (--verify) checks the content of /etc/fstab:
findmnt --df
findmnt --verifyfindmnt exits with 0 when it has something to show and 1 on any error.
Which command for which question
| Question | Command |
|---|---|
| What disks and partitions exist? | lsblk |
| Which filesystems, labels and UUIDs? | lsblk -f |
| What is the UUID of one device? | sudo blkid -s UUID -o value DEVICE |
| Where is a path mounted? | findmnt -T PATH |
| What does fstab look like to the system? | findmnt --verify |
For free space rather than layout, see Check disk usage on Linux with df, du and ncdu.
Sources
This article was drafted with AI assistance, fact-checked against the sources listed above and reviewed by a human editor before publication. Spotted an error? See our corrections policy.