Introduction
Imagine looking at an office building blueprint.
- The Building: Disk Drive (Physical Storage).
- The Rooms: Partitions (Logical sections).
- Room Name: Mount Point (Access path like
/home).
In this lab, you will use lsblk to visualize this blueprint.
This layered view is important because Linux storage is built in stages. A physical or virtual device may contain partitions, those partitions may contain filesystems, and those filesystems may then be mounted into the main directory tree.
List All Block Devices (lsblk)
View the storage blueprint with lsblk (List Block Devices).
lsblk
Output:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 4K 1 loop /snap/bare/5
...
vda 252:0 0 40G 0 disk
├─vda1 252:1 0 1M 0 part
└─vda3 252:3 0 39.8G 0 part /
Understanding the Tree:
- NAME:
vdais the disk.vda1is a partition.loopXare virtual devices (ignore for now). - SIZE: Capacity (e.g., 40G).
- TYPE:
disk,part(partition), orloop. - MOUNTPOINTS: Where data is accessed (e.g.,
/is root).
This is why lsblk is so helpful for beginners. It shows relationships, not just names, helping you see which storage objects sit on top of which others.
Save the blueprint:
lsblk > devices.txt
Filter Physical Disks (lsblk -d)
Too much detail? Show only disks, hide partitions.
Use -d (device):
lsblk -d
Output:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 4K 1 loop ...
vda 252:0 0 40G 0 disk
Partitions (vda1, vda2) are gone.
This lists only top-level devices.
Filtering between full tree views and top-level device views is useful because storage troubleshooting often shifts between "Which disks exist?" and "How is this disk divided?"
Save the list:
lsblk -d > disks.txt
Check Filesystems (lsblk -f)
What format are the partitions?
Use -f (filesystem) to see the Type and UUID.
lsblk -f
Output:
NAME FSTYPE FSVER LABEL UUID ...
vda
├─vda2 vfat FAT32 8E24-7BB2 ...
└─vda3 ext4 1.0 7504cd7e-f775... ...
- FSTYPE: e.g.,
ext4(Linux),vfat(EFI). - UUID: Unique ID (Fingerprint), crucial for auto-mounting.
UUIDs matter because device names can sometimes change depending on boot order or attached hardware. A UUID gives you a more stable identifier for configuration.
Save details:
lsblk -f > filesystems.txt
Check Exact Size (lsblk -b)
Need exact bytes for scripts?
Use -b (bytes) to remove units like "G" or "M".
Raw byte output is especially useful in scripts and automation, where exact numbers matter more than human readability.
lsblk -b
Output:
NAME ... SIZE ...
vda ... 42949672960 ...
Save raw data:
lsblk -b > sizes.txt
Summary
In this lab, you learned to read the "blueprint" of your Linux storage using the lsblk command.
lsblk: Showed you the tree structure of Disks (Buildings) and Partitions (Rooms), including virtual loop devices.lsblk -d: Filtered the view to show only the top-level devices (ignoring partitions).lsblk -f: Revealed the "interior decoration" (Filesystem Type) and unique ID (UUID).lsblk -b: Gave you the precise size measurements in bytes.
Understanding these storage devices is the first step to managing them—whether you are adding a new hard drive, resizing a partition, or just checking why the server is full.



