How to: Delete/Remove/Clear LVM volume

Warning: Proceed with extreme care, you can destroy your data easily with following commands

Can be used in Linux/Debian/Ubuntu/Kali Linux/CentOS/RHEL/Fedora/Proxmox (PVE) etc.

In this guide we assume the mount point is datamount

1 Delete entry from /etc/fstab with your favourite text editor

sudo nano /etc/fstab
# For nano, when done, Ctrl + X, Y Enter to save and exit

2 Unmount the mount point

umount /datamount
or
umount name
or
umount pve-OLD-xxxxx

3 Disable LVM

lvchange -an /dev/vg/lv
or
lvchange -an name
or
lvchange -an pve-OLD-xxxxx

4 Delete LVM volume

lvremove /dev/vg/lv
or
lvremove name
or
lvremove pve-OLD-xxxxx

5 Disable volume group

vgchange -an vg
or
vgchange -an name
or
vgchange -an pve-OLD-xxxxx

6 Delete volume group

vgremove vg
or
vgremove name
or
vgremove pve-OLD-xxxxx

7 Delete physical volumes used for volume group “vg”

pvremove /dev/sdc /dev/sdd

Leave a Reply

Your email address will not be published. Required fields are marked *