🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Linux LVM: Logical Volume Management Complete Guide (2026)

Linux LVM: Logical Volume Management Complete Guide (2026)

Quick Summary: LVM (Logical Volume Manager) is a Linux storage abstraction layer that sits between physical disks and filesystems. It allows you to resize partitions on-the-fly, span volumes across multiple disks, create instant snapshots for backups, and migrate data between disks without downtime. LVM is essential knowledge for any Linux administrator managing server storage.

Linux LVM logical volume management

What Is LVM?

Traditional disk partitioning is rigid — once you create a partition, resizing it requires unmounting, repartitioning, and risking data loss. LVM adds a flexible layer that lets you manage storage dynamically. Think of it as a pool of storage that you can carve up and resize at will.

LVM Architecture

LayerComponentDescription
BottomPhysical Volume (PV)Physical disk or partition (/dev/sda1, /dev/sdb)
MiddleVolume Group (VG)Pool combining one or more PVs
TopLogical Volume (LV)Virtual partitions created from VG space

Essential LVM Commands

Physical Volume Operations

  • pvcreate /dev/sdb — Initialize a disk as a physical volume
  • pvs — List physical volumes (short format)
  • pvdisplay — Detailed PV information

Volume Group Operations

  • vgcreate data_vg /dev/sdb /dev/sdc — Create VG from two disks
  • vgextend data_vg /dev/sdd — Add a disk to existing VG
  • vgs — List volume groups

Logical Volume Operations

  • lvcreate -L 50G -n web_data data_vg — Create 50GB logical volume
  • lvcreate -l 100%FREE -n backups data_vg — Use all remaining space
  • lvextend -L +20G /dev/data_vg/web_data — Extend by 20GB
  • resize2fs /dev/data_vg/web_data — Resize the filesystem to match
  • lvs — List logical volumes

Resizing Volumes (Live)

  1. Check available space: vgs (look at VFree column)
  2. Extend the logical volume: lvextend -L +10G /dev/vg/lv
  3. Resize the filesystem: resize2fs /dev/vg/lv (ext4) or xfs_growfs /mount (XFS)
  4. Verify: df -h

Key point: ext4 and XFS can be grown online (while mounted). Only ext4 can be shrunk, and shrinking requires unmounting first.

LVM Snapshots

Snapshots create an instant point-in-time copy of a logical volume — perfect for backups:

  • Create: lvcreate -L 5G -s -n snap_web /dev/data_vg/web_data
  • Mount: mount /dev/data_vg/snap_web /mnt/snapshot
  • Backup from snapshot, then remove: lvremove /dev/data_vg/snap_web

LVM vs Traditional Partitioning

FeatureLVMTraditional Partitions
Online resizeYes (grow), ext4 (shrink offline)No (requires unmount)
Span multiple disksYesNo
SnapshotsYesNo
Disk migrationOnline (pvmove)Offline only
ComplexityMediumSimple
Performance overheadMinimalNone

Frequently Asked Questions

Does LVM affect performance?

LVM adds negligible overhead (typically less than 1%). The benefits of flexible storage management far outweigh any minor performance impact. For maximum performance, use LVM striping across multiple disks.

Can I add more disk space without downtime?

Yes, this is LVM's primary advantage. Add a new physical disk to the volume group, then extend the logical volume and filesystem — all while the system is running and the filesystem is mounted.

Should I use LVM on all servers?

Yes, for production servers LVM is strongly recommended. Most modern Linux installers offer LVM as the default partitioning scheme. The flexibility to resize volumes without downtime is invaluable when disk space needs change over time.

Related Resources

Share this article:
Dargslan Editorial Team (Dargslan)
About the Author

Dargslan Editorial Team (Dargslan)

Collective of Software Developers, System Administrators, DevOps Engineers, and IT Authors

Dargslan is an independent technology publishing collective formed by experienced software developers, system administrators, and IT specialists.

The Dargslan editorial team works collaboratively to create practical, hands-on technology books focused on real-world use cases. Each publication is developed, reviewed, and...

Programming Languages Linux Administration Web Development Cybersecurity Networking

Stay Updated

Subscribe to our newsletter for the latest tutorials, tips, and exclusive offers.