What LVM Is and Why It Simplifies Disk Management on Linux - init.d
IT

# What LVM Is and Why It Simplifies Disk Management on Linux

Alessandro Corbelli~7 min
Table of Contents

Anyone who installs a Linux server or computer eventually faces a question that only looks trivial: how to divide up the disk. With the traditional method that decision has to be made almost right away, and it’s awkward to change later. It only takes one part of the disk filling up while another sits half empty to see the limit. LVM exists precisely to make that choice reversible. Understanding what it is helps you reason about disk space without treating it as a cage decided once and for all.

Before LVM: the problem of fixed partitions

A disk usually isn’t used as one single block: it’s split into partitions, that is, slices of space with a well-defined boundary. One slice for the system, one for data, one for swap, and so on. The catch is that, with classic partitions, that boundary is carved into the disk: it says “this slice goes up to here and no further.” As long as the guesses made at the start hold up, everything is fine. When they stop holding, moving a boundary on a running system is a delicate operation, often done with the machine switched off, with a real risk of losing data.

The typical result is a kind of waste anyone who has managed a disk knows well: a partition full at 100% blocking a service, while right next to it another one is only half used. The free space is there, but it’s on the wrong side of the wall.

What LVM is, in plain terms

LVM stands for Logical Volume Manager. It’s a component shipped by default in the most common Linux distributions, and its idea is simple: put an intermediate layer between the physical disks and the file systems (the way data is organized, written and read). Instead of having the data talk directly to the disk, you talk to LVM, which keeps the accounting of the space and decides how to hand it out.

That extra layer is the whole point. By adding a level of abstraction, the boundaries of space stop being fixed: they become numbers managed in software, which can be moved while the system keeps working. Oracle Linux’s documentation puts it well when it describes LVM as “non disruptive and transparent to users,” so that operations like enlarging a volume or reorganizing disks “don’t require any system down time.”

The three core concepts: physical volume, group, logical volume

LVM rests on three concepts stacked on top of each other. Clearing them up right away removes most of the confusion. A useful analogy is that of a warehouse.

The physical volume (PV) is the lowest layer: a disk or a partition you declare “usable by LVM.” It’s like bringing crates of raw goods into the warehouse. LVM splits their space into many equally sized blocks, called extents (Oracle’s documentation lists a default size of 4 MB), which are the unit it uses to count everything from then on.

The volume group (VG) is the warehouse itself: it pools one or more physical volumes into a single large reservoir of space. This is where the flexibility lives. The reservoir doesn’t care whether the space comes from a single disk or from five different ones: it sees them as one supply.

The logical volume (LV) is what you actually use: from the reservoir you carve out a volume of the size you want, put a file system on it and mount it like a normal drive. To the system it’s indistinguishable from a partition, with the key difference that its boundaries aren’t fixed. Back to the analogy: the walls between the rooms of the warehouse aren’t made of bricks, but of movable panels you can shift when needed, without emptying everything out.

The full path, from disks to ready-to-use space, is a sequence of three steps:

Terminal window
pvcreate /dev/sdb /dev/sdc # mark two disks as physical volumes
vgcreate data /dev/sdb /dev/sdc # pool them into a group called "data"
lvcreate -L 50G -n web data # carve out a 50 GB logical volume

From here you create a file system on the volume and mount it, exactly as you would with a partition.

What changes compared to classic partitions

The practical benefits of this model are few and concrete.

  • Resizing on the fly. If a logical volume fills up and the group still has free space, you can enlarge it while the system is running, without unmounting anything and without stopping services. In many cases, with a single option, the file system on top is grown at the same moment. One detail worth knowing: enlarging a file system can almost always be done live, but shrinking one is more delicate and often requires unmounting it first. Some file systems, such as XFS, can only be grown, not reduced.
  • Combining multiple disks into one space. Because the group adds up the capacity of all the physical volumes it contains, a file system can span several disks as if they were one. When space runs short, you just add a disk to the group to increase its capacity, without rebuilding the existing structure.
  • Snapshots. A snapshot is a frozen picture of a volume at a specific moment. LVM’s manual page describes it as a “frozen image of an origin LV” that can be used, for example, for backups while the original volume keeps being used, following the same redundancy logic laid out in the 3-2-1 backup rule. It’s handy for copying a database or a system without stopping it, avoiding saving files that change while the copy is still in progress, something worth scheduling in production with a timer that runs on a fixed schedule rather than kicking it off by hand. In LVM a snapshot can also be “merged back” into its origin, returning the volume to the state it was in when the snapshot was taken: a convenient safety net before a risky update. In the virtualization world, snapshots on shared LVM volumes were a long-standing limitation, lifted only recently: it is one of the new features we discuss when covering the move from Proxmox VE 8 to 9.
  • Moving data between disks without stopping anything. If a disk starts showing signs of failure, or if you’re moving from a spinning drive to a solid-state one, LVM lets you transfer data from one physical volume to another while the volumes stay mounted and in use. Once the transfer is done, the old disk is removed from the group and can be physically pulled out.

When it’s worth using (and when it isn’t)

LVM isn’t free: it adds an extra layer to understand and, if something goes wrong, to know how to recover. On a USB stick or a single-purpose, fixed-size disk it’s needless complexity that doesn’t pay off. It’s also worth remembering that the small system boot partition (boot and EFI) stays a classic partition anyway: LVM doesn’t replace it.

On servers, though, the scale almost always tips the other way. Whenever you expect to have to grow space over time, move data between disks, or take consistent backups without stopping services, LVM’s flexibility repays its small upfront cost, the same reasoning behind preferring infrastructure described in versioned files over one configured by hand once and for all. The most common rule of thumb is simple: a classic partition only where it’s mandatory, everything else under LVM. Better to have the flexibility and not use it than to discover you need it with the disk already full.

In short

LVM is a layer of abstraction that sits between the physical disks and the data. It turns the rigid boundaries of partitions into numbers managed in software: disks become physical volumes, they pool into a group that acts as a reservoir, and from there you carve out logical volumes with movable walls. The concrete payoff is being able to resize on the fly, combine multiple disks, freeze snapshots for backups, and move data with no downtime. It isn’t needed everywhere, but where space has to be able to change over time, it keeps you from treating a first-day decision as if it were final.

Sources

Tux versione Gandalf, mascotte del blog init.d

init.d is the team led by Alessandro Corbelli, a Linux systems administrator and backend developer with over twenty years of experience. He designs and runs cloud infrastructure (Google Cloud, AWS, Azure), server farms and high-availability architectures, and builds custom software in Laravel/PHP and Vue - from the Take2Me food delivery platform to our clients’ management tools. On this blog we share technical notes on Linux, system administration, development, DevOps and e-commerce.


More Posts