Home / How to delete a non-root LVM volume?

How to delete a non-root LVM volume?

If the non-root LVM volume, Volume Group, and Physical Volume used for the LV is no longer needed on the system, they can be deleted using the steps below. If the LVM volume has any critical data, make sure to make a copy of that data before moving on to the following steps. Replace /dev/sdc1 and /dev/sdc2 with the name of the Physical Volume used by the volume group that is being removed from the system.

First delete LVM partition from /etc/fstab file.

dev/sda2 / ext3 defaults 1 1
/dev/sda1 /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/sd3 swap swap defaults 0 0
/dev/volumegroup/lvm /lvm_mountpoint ext3 defaults 0 0

Unmount the LVM logical volume.

# umount /dev/volumegroup/lvm

Disable LVM logical volume.

# lvchange -an /dev/volumegroup/lvm

Delete LVM volume.

# lvremove /dev/volumegroup/lvm

Disable Volume group.

# vgchange -an volumegroup

Delete Volume group.

# vgremove volumegroup

Delete Physical volume.

# pvremove /dev/sdc1 /dev/sdc2

Leave a Reply