OS Notes
Storage virtualization — logical volume management (LVM), storage area networks (SAN), NAS, thin provisioning, software-defined storage, and abstracting physical storage from logical volumes.
Introduction
Storage virtualization creates an abstraction layer between physical storage devices and the logical storage that applications see. Just as virtual memory abstracts physical RAM into a larger logical address space, storage virtualization abstracts physical disks into flexible logical volumes that can be resized, moved, and managed independently of the underlying hardware.
Without storage virtualization, you are stuck with the physical size of each disk. If you have a 500GB disk that is full, you would need to migrate all data to a larger disk — significant downtime and effort. With storage virtualization, you can add another physical disk and seamlessly extend the existing logical volume. Applications never notice the change.
Logical Volume Management (LVM)
LVM is the most common storage virtualization technology on Linux. It introduces three abstraction layers:
| Physical | Physical |
|---|---|
| /dev/sda1 | /dev/sdb1 |
LVM Components
- Physical Volume (PV): A physical disk or partition initialized for LVM
- Volume Group (VG): A pool combining one or more PVs into a single storage space
- Logical Volume (LV): A virtual partition carved from a VG; this is what gets formatted and mounted
- Physical Extent (PE): The smallest unit of allocation (default 4MB); VG is divided into PEs
LVM Operations
# Create physical volumes
pvcreate /dev/sdb /dev/sdc
# Create volume group from physical volumes
vgcreate storage_pool /dev/sdb /dev/sdc
# Create logical volume (200GB from the pool)
lvcreate -L 200G -n data storage_pool
# Format and mount
mkfs.ext4 /dev/storage_pool/data
mount /dev/storage_pool/data /mnt/data
# RESIZE without unmounting (online resize!)
lvextend -L +100G /dev/storage_pool/data
resize2fs /dev/storage_pool/data
# Add new disk to expand the pool
pvcreate /dev/sdd
vgextend storage_pool /dev/sdd
# Now the pool has more space — extend any LVLVM Snapshots
Create point-in-time copies of logical volumes for backup or testing:
# Create a snapshot of the data volume
lvcreate -s -L 50G -n data_snap /dev/storage_pool/data
# Mount snapshot (read-only, for backup)
mount -o ro /dev/storage_pool/data_snap /mnt/backup
# After backup, remove snapshot
lvremove /dev/storage_pool/data_snapSnapshots use copy-on-write — only changed blocks consume space. A snapshot of a 1TB volume initially uses almost no additional space.
Storage Area Networks (SAN)
A SAN provides block-level storage access over a dedicated high-speed network. Servers see SAN storage as local disks, even though the physical disks are in a separate storage array.
| Server 1 | Server 2 | Server 3 | ||
|---|---|---|---|---|
| LUN 1 | LUN 2 | LUN 3 | ||
| (100GB) | (500GB) | (1TB) |
LUN (Logical Unit Number): A virtual disk presented by the storage array. Each server sees its assigned LUNs as regular block devices.
Protocols:
- Fibre Channel: Dedicated, high-performance (16-128 Gbps), expensive
- iSCSI: Runs over standard Ethernet (cost-effective, simpler infrastructure)
- NVMe-oF (NVMe over Fabrics): Lowest latency, designed for flash arrays
Network Attached Storage (NAS)
NAS provides file-level access (not block-level) over the network. Applications access files using standard protocols without knowing the physical storage location.
SAN vs NAS:
| Feature | SAN | NAS |
|---|---|---|
| Access level | Block (raw disk) | File (filesystem) |
| Protocol | FC, iSCSI | NFS, SMB/CIFS |
| Server sees it as | Local disk | Network share |
| File system | Managed by server | Managed by NAS device |
| Use case | Databases, VMs | File sharing, home directories |
Thin Provisioning
Allocate more logical storage than physically exists, relying on the fact that most volumes are not fully used:
| Physical storage available | 10 TB |
| VM1 | 500 GB allocated (actually using 100 GB) |
| VM2 | 500 GB allocated (actually using 80 GB) |
| VM3 | 1 TB allocated (actually using 200 GB) |
| Total provisioned | 20 TB (200% overprovisioned) |
| Total actually used | 3 TB (30% of physical) |
How it works: Space is allocated on-write, not on-create. A 1TB thin volume initially consumes zero physical space and grows as data is written.
Risk: If total actual usage exceeds physical capacity, the system runs out of space. Monitoring is critical.
Software-Defined Storage (SDS)
SDS separates storage management software from hardware. The intelligence moves from proprietary storage controllers to software running on commodity servers.
Examples:
- Ceph: Distributed object/block/file storage; scales to exabytes
- GlusterFS: Distributed file system from Red Hat
- MinIO: S3-compatible object storage on commodity hardware
- VMware vSAN: Aggregates local disks across ESXi hosts into shared storage
Benefits:
- Hardware independence (use any commodity server)
- Horizontal scaling (add nodes to grow)
- Software-based features (deduplication, compression, encryption)
- Lower cost than proprietary SAN arrays
Deduplication and Compression
Storage efficiency techniques at the virtualization layer:
Deduplication: Identifies identical blocks across the storage system and stores only one copy. A VDI environment with 100 identical Windows VMs might reduce storage from 5TB to 500GB.
Compression: Reduces the size of stored data. Inline compression works on-the-fly; post-process compression runs during off-peak hours.
Key Takeaways
- Storage virtualization decouples logical storage from physical hardware
- LVM enables flexible volume management: resize, snapshot, and span across disks
- SAN provides block-level network storage (databases, VMs); NAS provides file-level sharing
- Thin provisioning overcommits capacity, relying on actual usage being below allocation
- Software-defined storage runs on commodity hardware, replacing expensive proprietary arrays
- Deduplication and compression dramatically reduce physical storage requirements
- Modern cloud storage (EBS, Azure Disk) is storage virtualization taken to its logical extreme
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Storage Virtualization - Abstract Storage.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Operating Systems topic.
Search Terms
operating-systems, operating systems, operating, systems, storage, management, virtualization, storage virtualization - abstract storage
Related Operating Systems Topics