Running out of disk space on a production Linux server is a bad situation. Adding a new disk and rebooting and hoping for the best is worse. Linux LVM — the Logical Volume Manager — exists precisely to avoid this. It sits between your physical disks and your filesystems and lets you resize, extend, and reorganise storage while the server keeps running. This guide covers how Linux LVM works, how to set it up from scratch, and how to extend a full volume without taking anything offline.

How Linux LVM Works: The Three Layers
LVM introduces three layers between your raw disks and your mounted filesystems. Understanding the layers makes every command logical and predictable.
The first layer is the Physical Volume (PV). A PV is a disk or partition you hand to LVM. It could be a whole disk like /dev/sdb or a single partition like /dev/sdb1. LVM writes its metadata at the start of each PV so it can track what belongs where.
The second layer is the Volume Group (VG). A VG pools one or more PVs into a single storage resource. This is where the flexibility comes from. You add a new disk to the VG and the extra space is available immediately. The VG does not care which physical disk a particular piece of data lives on.
The third layer is the Logical Volume (LV). You carve an LV out of the VG, then format it with a filesystem and mount it. From the OS perspective, an LV looks and behaves exactly like a regular disk partition, but you can resize it without unmounting.
Install LVM Tools
Most Linux distributions include LVM by default. If not, install the package for your distribution:
# Ubuntu / Debian
apt install lvm2 -y
# RHEL / AlmaLinux / Rocky Linux
dnf install lvm2 -y
# Verify
lvm version
Create a New LVM Setup from Scratch

This walkthrough creates a new volume group from two disks and carves out a logical volume. Assume you have two fresh disks at /dev/sdb and /dev/sdc with no existing data.
First, partition each disk and set the partition type to Linux LVM. In fdisk use type code 8e:
fdisk /dev/sdb
# Inside fdisk: n, p, 1, Enter, Enter, t, 8e, w
fdisk /dev/sdc
# Same steps
Next, initialise the partitions as Physical Volumes:
pvcreate /dev/sdb1 /dev/sdc1
pvdisplay
Create a Volume Group from both PVs:
vgcreate data-vg /dev/sdb1 /dev/sdc1
vgdisplay data-vg
Create a Logical Volume inside the VG. Use -L for a fixed size or -l 100%FREE to consume all available space:
lvcreate -L 50G -n app-lv data-vg
lvdisplay /dev/data-vg/app-lv
Format the LV and mount it:
mkfs.ext4 /dev/data-vg/app-lv
mkdir -p /data/app
mount /dev/data-vg/app-lv /data/app
df -h /data/app
Make the mount permanent across reboots:
echo '/dev/data-vg/app-lv /data/app ext4 defaults 0 2' >> /etc/fstab
Check Your Current LVM Setup
These commands give you a full picture of the current LVM state on any Linux system:
pvs # Summary of Physical Volumes
pvdisplay # Detailed PV info
vgs # Summary of Volume Groups
vgdisplay # Detailed VG info
lvs # Summary of Logical Volumes
lvdisplay # Detailed LV info
lvm fullreport # Everything in one view
Run pvs first on any unfamiliar system to see which disks LVM already manages. Then check vgs to see how much free space each volume group has before making changes.
Extend a Logical Volume Online

This is the most common Linux LVM task. A volume fills up and you need to grow it without any downtime. First check how much free space the volume group has:
vgs
# Check the VFree column
If free space is available in the VG, extend the LV and resize the filesystem:
# Extend the LV by 20GB
lvextend -L +20G /dev/data-vg/app-lv
# Resize the filesystem to use the new space
resize2fs /dev/data-vg/app-lv # ext4
xfs_growfs /data/app # XFS - use mount point not device
# Confirm new size
df -h /data/app
No reboot needed. No unmounting required. The filesystem grows while everything keeps running. This is exactly what you want when a production server runs low. For context on what happens when disk fills up before you catch it, see our post on MySQL not starting after a disk full event — that scenario is avoided entirely with LVM and proactive volume extension.
Add a New Disk to an Existing Volume Group
When the VG itself is full, add a new physical disk to it. After attaching the disk to the server, follow these steps:
# Confirm the new disk is visible
lsblk
fdisk -l /dev/sdd
# Initialise as a Physical Volume
pvcreate /dev/sdd
# Add it to the Volume Group
vgextend data-vg /dev/sdd
# Confirm the new free space
vgs data-vg
After vgextend, the free space is immediately available in the VG. Then extend the logical volume and resize the filesystem as shown above.
Extend the Root Volume on a Running System
Extending the root filesystem follows the same steps. On Ubuntu and Debian with the default ext4 root:
# Find the root LV device name
lvdisplay | grep "LV Path"
# Extend - use your actual LV name
lvextend -L +10G /dev/ubuntu-vg/ubuntu-lv
# Resize ext4 filesystem on a live root
resize2fs /dev/ubuntu-vg/ubuntu-lv
df -h /
On RHEL, AlmaLinux, and Rocky Linux the root filesystem is usually XFS. Use xfs_growfs / instead of resize2fs.
Linux LVM Commands Reference
# Physical Volumes
pvcreate /dev/sdb # Initialise disk as PV
pvremove /dev/sdb # Remove PV label
pvmove /dev/sdb # Move data off a PV before removing it
pvs # Short PV summary
# Volume Groups
vgcreate myvg /dev/sdb # Create VG from PV
vgextend myvg /dev/sdc # Add PV to existing VG
vgreduce myvg /dev/sdc # Remove PV from VG
vgrename myvg newname # Rename a VG
vgs # Short VG summary
# Logical Volumes
lvcreate -L 10G -n mylv myvg # Create 10G LV
lvextend -L +5G /dev/myvg/mylv # Extend by 5G
lvremove /dev/myvg/mylv # Delete LV
lvrename myvg oldname newname # Rename LV
lvs # Short LV summary
LVM Snapshots for Safe Maintenance
LVM snapshots give you a point-in-time copy of a logical volume with almost no overhead. This is useful before risky operations like major upgrades or database schema changes:
# Create a 5GB snapshot of app-lv
lvcreate -L 5G -s -n app-snap /dev/data-vg/app-lv
# Mount the snapshot read-only to verify contents
mount -o ro /dev/data-vg/app-snap /mnt/snap
# If something goes wrong, roll back to the snapshot state
lvconvert --merge /dev/data-vg/app-snap
# Remove the snapshot when done
lvremove /dev/data-vg/app-snap
The snapshot only uses space for blocks that change after you create it. A 5GB allocation covers most maintenance windows lasting a few hours. The lvcreate man page covers all snapshot options in detail.
Conclusion
Linux LVM is one of those tools that feels optional until the day you desperately need it. Setting it up at install time costs ten minutes. Extending a full volume at 2am costs nothing when LVM is already in place. Use LVM for any server where data volumes will grow over time, which covers most of them. The commands are logical once you understand the three-layer model of PVs, VGs, and LVs. For more on keeping your Linux server in good shape, check our Linux server hardening checklist to pair your storage setup with a solid security baseline.