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

Logical volume abstraction

Create dynamic storage units that span physical boundaries and provide flexible resizing.

In this lesson, you will learn how logical volume abstraction decouples your data from the specific physical hardware it resides on, allowing for seamless storage growth.

Beyond the Partition Table

Up until now, you have likely worked with partitions—rigid slices of a disk defined at creation time. If a partition runs out of space, resizing it often requires shifting data or repartitioning neighboring sectors, which is both dangerous and cumbersome.

Logical volume abstraction changes this by adding a "virtualization layer" between your filesystem and the underlying hardware. Instead of writing directly to a partition, your filesystem sits on a Logical Volume (LV). This LV acts as a flexible container that can span across multiple physical disks, grow on the fly, and be moved without the operating system needing to know where the actual blocks are stored.

How Abstraction Works

Think of it like a library. Instead of a single bookshelf (a physical disk) where you are stuck with the capacity of the shelf, you have a "Logical Archive." If the archive fills up, you simply add another bookshelf to the building. The archive remains the same "location" to your patrons (the filesystem), even though the physical space has expanded.

In Linux, this is achieved through the LVM stack. Once you have initialized your Physical Volumes and grouped them into a Volume Group, you create your Logical Volume. When your applications need more storage, you don't reformat; you simply extend the volume:

# Extend the logical volume to add 10GB of capacity
lvextend -L +10G /dev/my_vg/my_lv

# Resize the filesystem to use that new space
resize2fs /dev/my_vg/my_lv

Because the OS sees /dev/my_vg/my_lv as a single, virtual device, it doesn't care that the data might be split across two different physical drives or spread across spare sectors you added yesterday. The abstraction layer handles the mapping, keeping the filesystem blissfully unaware of the underlying physical reshuffling. This creates a fluid storage environment where you can respond to demand spikes without physical re-cabling or data migration.

Key Takeaway: Logical volume abstraction provides a virtual block device interface that allows storage to be resized, migrated, and aggregated across physical disks without disrupting the filesystem above it.