System and processes
The lvremove command
Removes an LVM logical volume and returns its space to the volume group.
Most useful options
-t, --testTest mode: the command runs without changing the metadata. Use it before deleting for real-f, --forceSkips confirmations and protections. Damaged volumes may need it twice (-ff)-y, --yesAnswers yes to any question without asking you. Use it with care-A, --autobackup y|nSets whether metadata is backed up after the change. The manual strongly advises keeping it on--nohistoryDoes not keep the history of the removed volume. It only matters if LVM history is enabledCopy-ready examples
$ sudo lvremove -t datos/websimulates the removal without touching the metadata. Always start here.$ sudo umount /mnt/web && sudo lvremove datos/webunmounts the filesystem and removes the volume. LVM asks for confirmation before deactivating it. Destructive: deletes the volume's data.$ sudo lvremove -y datos/webremoves the volume without asking. Destructive: use it only after checking the name with lvs.You can try them in the browser terminal: it does not touch your computer.
Typical mistakes
- A mounted or in-use volume cannot be deactivated or removed: unmount it first.
- If you remove an origin volume, all its dependent snapshots are removed too.
- With -f or -y there is no confirmation: check the name twice before pressing Enter.
FAQ
Can I undo an lvremove?
Not with this command: the space goes back to the group and the volume's data is no longer available. That is why you should back up first. If LVM history is enabled, only a simplified record of the volume remains, without its data.
How do I remove it without being asked?
With -y, or with -f when you also need to skip protections. Only do it after checking the command with -t.
Does it also remove the volume group?
No. lvremove removes only the logical volume. The group and the physical disks stay as they were.
Learn to actually use it
The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.
Start the free course