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

Virtual block devices in cloud environments

Manage ephemeral and persistent storage blocks in virtualized infrastructure.

In this lesson, you will learn how cloud providers abstract physical hardware into virtual block devices that behave exactly like the local disks you already understand.

The Virtual Hardware Layer

When you spin up a virtual machine (VM) in a cloud environment, you rarely interact with physical spinning platters or raw SSDs. Instead, the cloud provider’s hypervisor presents a virtual block device to your guest Linux kernel. To your system, this appears as a standard device node in /dev/, such as /dev/vda (VirtIO block) or /dev/sda (SCSI emulation).

Because the kernel sees these as standard block devices, you can use the exact same tools—fdisk, mkfs, and mount—that you used when managing physical partitions. The complexity is hidden by the hypervisor, which translates your read/write operations into network requests or shared storage operations on the backend.

Ephemeral vs. Persistent Storage

Cloud environments generally categorize these virtual devices into two roles:

  1. Ephemeral (Instance) Storage: These devices are physically attached to the host machine running your VM. They offer high performance but are temporary; if the VM is stopped or terminated, the data is wiped. These are often used for swap space or temporary cache files.
  2. Persistent (Block) Storage: These are "network-attached" devices. Even if your VM instance is deleted, these blocks can be detached and re-attached to a different VM.

Identifying and Using Devices

To see how these appear in your Linux environment, you can use the lsblk command. It will show you the tree of devices, where you might see the root disk (/dev/vda) and additional attached volumes (e.g., /dev/vdb):

# List block devices to identify the virtual drive
lsblk

# View details of a virtual disk using the kernel device interface
udevadm info --query=all --name=/dev/vdb | grep ID_VENDOR

Whether it is local or networked, the Linux kernel treats these virtual devices as standard block drivers. This uniformity is what allows cloud infrastructure to be so flexible—you can swap, resize, or migrate these "disks" without ever needing to touch a physical server or reconfigure your filesystem tools.

Key Takeaway: Virtual block devices mask the underlying cloud infrastructure, allowing you to manage network-attached or ephemeral storage using the same standard Linux tools used for physical local disks.