Course contentsShow
← Linux
Lesson 628 of 1,8197. Storage Management and Logical VolumesFree lesson

The block device abstraction layer

Map raw storage hardware to Linux device nodes and interpret kernel-level I/O stacks.

In this lesson, you will learn how the Linux kernel uses the block device abstraction layer to treat diverse physical storage hardware as uniform, addressable streams of data.

The Abstraction Concept

Under the hood, Linux interacts with vastly different hardware—such as NVMe drives, SATA SSDs, or even USB thumb drives—using wildly different electrical protocols. The block device abstraction layer acts as a standardized interface between these hardware-specific drivers and the rest of the operating system.

Instead of your applications needing to know how to "talk" to a specific flash controller, the kernel presents every storage device as a block device node located in /dev. By abstracting hardware into a fixed-size "block" (typically 512 bytes or 4KB), the kernel allows filesystems like Ext4 or XFS to read and write data without ever needing to know what kind of physical media lies underneath.

The I/O Stack Journey

When you perform an I/O operation, your request travels down a vertical stack:

  1. User Space: An application requests a file write.
  2. Virtual File System (VFS): Decides which filesystem handles the request.
  3. Block Layer: The request is queued, merged with adjacent requests to improve efficiency, and scheduled for the hardware.
  4. Device Driver: Translates the request into hardware-specific commands.

You can see these device nodes yourself using lsblk, which displays the relationship between your physical disks and their partitions:

# List block devices and their mount points
lsblk

In this output, you will see sda or nvme0n1. These names are the kernel's way of identifying a "block device." The kernel treats these as random-access devices, meaning you can jump to any offset in the file to read or write data. This is why we call them "block" devices rather than "character" devices (like keyboards), which are sequential and cannot be "seeked" in the same way.

By standardizing these into /dev entries, the kernel ensures that whether you are using a spinning hard drive or a high-speed SSD, your system treats the storage as a predictable, addressable array of data blocks.

Key Takeaway: The block device abstraction layer hides hardware complexity by exposing all storage devices as uniform, addressable nodes in /dev, allowing the kernel to manage data access consistently regardless of the underlying physical technology.