Course Info / Syllabus

Labs

Lecture Topics

Exam Reviews

Source Code & Other Resources


Operating Systems Concepts & Design

Virtual Disks

Virtual disks—whether you’re looking at an AWS EBS volume, a VMware VMDK, or a QEMU QCOW2 file—are the ultimate magic trick of modern computing. They convince an Operating System that it is talking to physical hardware (heads, platters, and sectors) when it is actually just writing to a file or a network stream.

Here is the breakdown of how that abstraction layer is built.


1. The Virtualization Layer (The Lie)

In a physical machine, the Kernel sends a command to a disk controller (SATA/NVMe). In a Virtual Machine (VM), the Hypervisor (KVM, Xen, Hyper-V) intercepts that command.


2. Format Types: Thick vs. Thin Provisioning

When you create a 100 GB virtual disk, you have to decide how that space is claimed on the physical host.


3. File-Based Disks (VMware/VirtualBox/KVM)

On a local hypervisor, a virtual disk is just a big file sitting on your host’s filesystem.


4. Network Block Storage (AWS EBS / SAN)

This is how AWS EBS (Elastic Block Store) works. Your “disk” isn’t even on the same physical server as your CPU.


5. Why use Virtual Disks? (The Benefits)

Virtualization gives us “Superpowers” that physical hardware doesn’t have:

  1. Portability: You can move a .vmdk file to a completely different server, and the OS will boot exactly the same way.
  2. Snapshots: You can “save your game” before running a risky sudo apt upgrade. If it breaks, you revert in seconds.
  3. Live Resizing: You can grow an EBS volume from 10 GB to 100 GB while the server is still running—no screwdriver required.
  4. Cloning: You can “Template” a perfectly configured Linux OS and spawn 50 identical copies in minutes.

Summary Comparison

Feature Local VM Disk (QCOW2/VMDK) Cloud Block Storage (EBS)
Location File on Host Disk Networked Storage Cluster
Latency Extremely Low (Bus speed) Low (Network speed)
Scalability Limited by Host Disk Nearly Infinite
Redundancy Depends on Host RAID Built-in Replication