Skip to content

Instantly share code, notes, and snippets.

@wesinator
Created November 9, 2017 18:23
Show Gist options
  • Save wesinator/860e6696e616e8d22b5f043b255b5f55 to your computer and use it in GitHub Desktop.
Save wesinator/860e6696e616e8d22b5f043b255b5f55 to your computer and use it in GitHub Desktop.
Steps to remove a logical volume (LVM)
# These steps worked when deleting a Fedora logical volume (lvm) partition on a UEFI system.
# They were run from a Fedora live session, and will probably work in Ubuntu based distros as well.
# Trying to delete an lvm / pv partition in Gparted will give you an error.
# To solve this, run the following:
lvs # lvscan to list logical volumes / volume group(s).
# If error about swap volume, run swapoff -a
# Replace vgname with the group name
vgchange -an vgname # deactivate volumes
lvremove vgname
vgremove -v vgname
pvremove /dev/sdX # remove the physical volume (partition remains and needs to be deleted by Gparted)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment