Linux Storage

LVM basics for storage management

Practical Linux guide: lVM basics for storage management without the usual guesswork.

18 min read Advanced Updated 9 Jun 2026

Step-by-step guide

Work through each section in order. Stop when your issue is resolved — you do not need every step for every situation.

Warning

Back up important data before repartitioning, encrypting disks, or restoring backups. Wrong commands can destroy partitions or overwrite live files.

What you will achieve

Create and extend logical volumes on Debian/Ubuntu — add disk space without repartitioning downtime for typical server workloads.

1) Inspect stack

sudo pvs
sudo vgs
sudo lvs
lsblk

2) Extend volume group with new disk

sudo pvcreate /dev/sdb
sudo vgextend vg0 /dev/sdb
sudo lvextend -l +100%FREE /dev/vg0/root
sudo resize2fs /dev/vg0/root

For xfs: sudo xfs_growfs / instead of resize2fs.

3) Snapshots (advanced)

sudo lvcreate -L 5G -s -n root-snap /dev/vg0/root

Short-lived snapshots need monitoring — fill the snapshot and writes fail.

4) Fedora/RHEL

Same LVM tools (lvm2 package). Anaconda creates LVM layouts by default on server installs unless you pick custom plain partitions.

Verify

df -h /
sudo lvs -o+devices

5) Rename logical volume

sudo lvrename vg0 oldname newname

6) Move PV off failing disk

sudo pvmove /dev/sdb /dev/sdc
sudo vgreduce vg0 /dev/sdb

7) Thin provisioning (advanced)

Overcommit storage — monitor actual usage with lvs -o+data_percent. Running out of thin pool space corrupts volumes.

When to skip LVM

Simple VPS with one disk and no growth plans — plain ext4 partition is fine. LVM shines on servers you expect to extend without downtime.

8) Backup LVM metadata

sudo vgcfgbackup vg0

Store /etc/lvm/backup/ off-host — simplifies recovery if PV UUIDs change after disk clone.

Prerequisites

lvm2 package installed. Unpartitioned disk or free space in VG. Backup before destructive pvcreate. Know filesystem type for grow command (resize2fs vs xfs_growfs).

lvm.conf backup

sudo vgcfgbackup -f /root/vg0.backup vg0

reduce LV danger

Shrinking logical volumes requires filesystem shrink first — wrong order destroys data. Growing is safe; shrinking is expert mode.

mirrored VG

lvcreate -m1 -L 10G -n data vg0 /dev/sdb /dev/sdc

Mirror across two PVs gives rudimentary redundancy — not replacement for backups but survives single disk failure on volume.

pvmove duration planning

Moving extents off failing disk takes hours on large PV — run in screen/tmux, monitor with pvmove -i 5. Do not reboot mid-pvmove without understanding resume behaviour.

thin pool monitoring

lvs -o+data_percent on thin pools — alert at 80% data_percent before pool full corrupts volumes — prometheus node_exporter textfile collector can scrape custom script output.

vgreduce after disk removal

After pvmove completes, vgreduce vg0 /dev/olddisk then wipe disk for reuse — forgetting vgreduce leaves phantom PV confusing future installs.

Related guides

basics linux lvm