blkid Command Generator
Generate blkid commands to locate and print block device attributes (UUID, label, type)
Getting Started with blkid
## What is blkid?
The `blkid` command locates block devices and prints their attributes — most commonly the UUID, LABEL, and filesystem TYPE. It is the standard way to find the stable identifiers you need for `/etc/fstab`, mount commands, and boot configuration.
## How to Use
1. **Choose a Target** (optional): Enter a specific device or glob (e.g., `/dev/sda1`, `/dev/sda*`), or leave it blank to scan all devices. 2. **Filter or Format** (optional): Use `-s` to show only a tag, `-t` to search by a token, `-o` to change the output format. 3. **Copy & Run**: Paste the generated command into your terminal. `blkid` is read-only and safe to run anytime.
Common Options
### Device (positional, optional)
Query one device: `blkid /dev/sda1`, or a glob: `blkid /dev/sda*`. Omit it to scan every block device.
### `-s TAG` Show tag
Print only the named tag (e.g., `UUID`, `LABEL`, `TYPE`): `blkid -s UUID /dev/sda1`.
### `-t TOKEN` Search token
Filter devices by a `NAME=value` token (e.g., `TYPE=ext4`, `LABEL=root`): `blkid -t TYPE=ext4`.
### `-o FORMAT` Output format
Choose how results are printed: `device` (just device names), `export` (KEY=value pairs), `list` (table), `full` (default), `value` (raw tag value), `udev` (udev-style).
### `-c FILE` Cache
Read from / write to a cache file instead of probing devices live. Pass `/dev/null` to force a fresh probe and ignore the cache.
### `-p` Low-level probe
Bypass the cache and read the device's superblock directly for accurate, current attributes.
### `-U` / `-v`
`-U` converts a UUID to a device name (or vice versa). `-v` prints the blkid version and exits.
▶How do I find the UUID of a partition for /etc/fstab?
▶How do I list every device and its filesystem type?
▶blkid shows stale or missing information — how do I force a fresh scan?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee