Block Devices & Partitions (lsblk & blkid)
Concept & Overview
Before a disk can store files, it is divided into storage blocks and partitions formatted with filesystems. In Linux:
- lsblk: Lists block storage devices (hard drives, NVMe SSDs, flash drives) in an intuitive tree showing parent drives (like sda, sdb), child partitions (like sda1, sdb1), sizes, and active mountpoints. Adding -f shows filesystem types and UUIDs.
- sudo blkid: Queries disk headers directly to print device Universally Unique Identifiers (UUIDs), filesystem formats (such as ext4, xfs, vfat), and partition labels used in boot and mount configurations.
lsblk (or lsblk -f), and locate device UUIDs using sudo blkid.Command Syntax Reference
| Command / Syntax | Description |
|---|---|
lsblk | List block storage devices and partitions |
lsblk -f | Display filesystem types and UUIDs for block devices |
sudo blkid | Query block device UUIDs and filesystem metadata |
Verification Objectives
These conditions will be automatically verified when you run commands inside the interactive terminal simulator:
- ○Run lsblk or lsblk -f to inspect block devices
- ○Run sudo blkid to view partition UUIDs
Ready to complete Quest 56?
Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.