lvremove Command in Linux: Syntax, Options & Remove Logical Volumes

lvremove deletes logical volumes from a volume group and frees their extents. Unmount filesystems first — active or open LVs block removal unless you force.

Published

Updated

Read time 5 min read

Reviewed byDeepak Prasad

lvremove Command in Linux: Syntax, Options & Remove Logical Volumes
About lvremove deletes logical volumes from a volume group and frees their extents. Unmount filesystems first — active or open LVs block removal unless you force.
Tested on Ubuntu 25.04 (Plucky Puffin); LVM 2.03.27(2); kernel 7.0.0-27-generic
Package lvm2 (apt/deb) · lvm2 (dnf/rpm)
Man page lvremove(8)
Privilege root / sudo
Distros

All Linux distros with LVM2 (lvm2 package).

Create LVs with lvcreate.

lvremove — quick reference

Remove logical volumes

When to use Command
Remove one LV (prompts if active) sudo lvremove myvg/lvol
Remove by full device path sudo lvremove /dev/myvg/lvol
Skip confirmation prompts sudo lvremove -f myvg/lvol
Same with long option sudo lvremove --force myvg/lvol
Answer yes to all prompts (scripts) sudo lvremove -y myvg/lvol
Remove every LV in a VG sudo lvremove myvg

Safety checks

When to use Command
See if LV is mounted findmnt /dev/myvg/lvol
Unmount before removal sudo umount /mount/point
Deactivate then remove sudo lvchange -an myvg/lvol then sudo lvremove -y myvg/lvol

Help and version

When to use Command
Show built-in usage lvremove --help
Confirm VG free space after delete sudo vgs myvg

lvremove — command syntax

Synopsis from lvremove --help on Ubuntu 25.04 (LVM 2.03.27):

text
lvremove VG|LV|Tag|Select ...
	[ -f|--force ]
	[ -A|--autobackup y|n ]
	[ COMMON_OPTIONS ]

lvremove returns extents to the VG free pool. Dependent snapshots are removed with their origin unless you remove snapshots first. Needs sudo.


lvremove — command examples

Essential Create a disposable LV on a lab VG

Never practice removal on ubuntu-lv or root volumes.

bash
fallocate -l 256M /tmp/lvm-lab-a.img
LOOP_A=$(sudo losetup -fP --show /tmp/lvm-lab-a.img)
sudo pvcreate $LOOP_A && sudo vgcreate labvg $LOOP_A
sudo lvcreate -L 32M -n remlv labvg
sudo lvs labvg/remlv

Sample output:

text
Logical volume "remlv" created.
  LV    VG    LSize
  remlv labvg 32.00m
Essential Remove an LV with -y (no interactive prompt)

-y accepts the confirmation prompt — standard in scripts after you verify the LV name twice.

bash
sudo lvremove -y labvg/remlv
sudo lvs labvg

Sample output:

text
Logical volume "remlv" successfully removed.

remlv disappears from lvs; free space in vgs labvg increases.

Essential Full lab cleanup
bash
sudo lvremove -f labvg
sudo vgremove -f labvg
sudo pvremove -f $LOOP_A
sudo losetup -d $LOOP_A
rm -f /tmp/lvm-lab-a.img
Common Force-remove an active LV with -f

-f removes active LVs without asking. Still fails if a filesystem is mounted.

bash
sudo lvcreate -L 16M -n remlv2 labvg
sudo lvremove -f labvg/remlv2

Sample output:

text
Logical volume "remlv2" successfully removed.

Prefer lvchange -an and umount over -f on production data.

Common Filesystem in use blocks removal

Mounted ext4 on the LV triggers a clear error until you unmount.

bash
sudo lvcreate -L 32M -n fslv labvg
sudo mkfs.ext4 -F /dev/labvg/fslv
sudo mkdir -p /tmp/lvm-lab-mnt
sudo mount /dev/labvg/fslv /tmp/lvm-lab-mnt
sudo lvremove labvg/fslv

Sample output:

text
Logical volume labvg/fslv contains a filesystem in use.

Fix path:

bash
sudo umount /tmp/lvm-lab-mnt
sudo lvremove -y labvg/fslv

Sample output:

text
Logical volume "fslv" successfully removed.
Advanced Remove all LVs in a volume group

Passing only the VG name targets every LV — useful for lab teardown before vgremove.

bash
sudo lvcreate -L 16M -n a labvg
sudo lvcreate -L 16M -n b labvg
sudo lvremove -f labvg
sudo lvs labvg

Sample output:

text
Logical volume "a" successfully removed.
  Logical volume "b" successfully removed.

lvs labvg shows no LVs; run sudo vgremove labvg next.

Advanced Snapshots depend on the origin LV

Removing an origin LV also removes its snapshots (or remove snapshots first).

bash
sudo lvcreate -L 48M -n origin labvg
sudo lvcreate -s -L 12M -n snap labvg/origin
sudo lvremove -y labvg/origin
sudo lvs labvg

Both origin and snap are gone from lvs when the origin is removed.


lvremove — when to use / when not

Use lvremove when Use something else when
  • You want to delete an LV and return space to the VG
  • You are tearing down a lab or decommissioning a mount
  • You need to clear all LVs before vgremove
  • You only need less space — lvreduce
  • You need more space — lvextend
  • You want to hide the LV temporarily — lvchange -an
  • You are removing the entire VG — lvremove VG then vgremove

lvremove vs lvreduce

lvremove lvreduce
Result LV deleted LV smaller, same name
Data Gone with LV Truncated region lost
Filesystem Must be unmounted Shrink FS first

Command One line
lvcreate Create logical volumes
lvremove Delete logical volumes (this page)
vgremove Remove an empty volume group

Browse the full index in our Linux commands reference.

lvremove — interview corner

What is the safe order to remove a mounted LV?

Unmount (or stop users), optionally lvchange -an, then lvremove. Forcing -f on a mounted filesystem risks corruption.

A strong answer is:

"umount, confirm with findmnt, lvchange -an if needed, then lvremove — never lvremove a mounted production LV."

What does lvremove -f do?

Skips the "really remove active LV?" prompt. It does not override mounted filesystem checks.

A strong answer is:

"-f forces removal of active LVs without prompting — still blocked if a filesystem is in use."

What happens if you run lvremove myvg with no LV name?

Every logical volume in myvg is removed — destructive lab teardown command.

A strong answer is:

"lvremove on a VG name deletes all LVs in that group — I double-check the VG name before running it."

What happens to snapshots when the origin is removed?

Dependent snapshots are removed with the origin (metadata and COW volumes).

A strong answer is:

"Removing the origin takes its snapshots with it — I remove or merge snapshots first if I need to keep them."


Troubleshooting

Symptom Likely cause Fix
filesystem in use Mount or swap on LV umount, swapoff
Can't remove open logical volume # open > 0 Close users, lsof on /dev/VG/LV
Prompt in script Missing -y lvremove -y after validation
logical volume is used by another device Snapshot, thin, cache Remove dependent LVs first

Rohan Timalsina

is a technical writer and Linux enthusiast who writes practical guides on Linux commands and system administration. He focuses on simplifying complex topics through clear explanations.