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):
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.
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/remlvSample output:
Logical volume "remlv" created.
LV VG LSize
remlv labvg 32.00mEssential Remove an LV with -y (no interactive prompt)
-y accepts the confirmation prompt — standard in scripts after you verify the LV name twice.
sudo lvremove -y labvg/remlv
sudo lvs labvgSample output:
Logical volume "remlv" successfully removed.remlv disappears from lvs; free space in vgs labvg increases.
Essential Full lab cleanup
sudo lvremove -f labvg
sudo vgremove -f labvg
sudo pvremove -f $LOOP_A
sudo losetup -d $LOOP_A
rm -f /tmp/lvm-lab-a.imgCommon Force-remove an active LV with -f
-f removes active LVs without asking. Still fails if a filesystem is mounted.
sudo lvcreate -L 16M -n remlv2 labvg
sudo lvremove -f labvg/remlv2Sample output:
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.
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/fslvSample output:
Logical volume labvg/fslv contains a filesystem in use.Fix path:
sudo umount /tmp/lvm-lab-mnt
sudo lvremove -y labvg/fslvSample output:
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.
sudo lvcreate -L 16M -n a labvg
sudo lvcreate -L 16M -n b labvg
sudo lvremove -f labvg
sudo lvs labvgSample output:
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).
sudo lvcreate -L 48M -n origin labvg
sudo lvcreate -s -L 12M -n snap labvg/origin
sudo lvremove -y labvg/origin
sudo lvs labvgBoth 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 |
|---|---|
|
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 |
Related commands
| 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 |
