How to Remove a Logical Volume in Redhat / CentOS

Share it:

In this tutorial, I will show you how to remove the inactive logical volume in Redhat 6.X / 7.X and CentOS 6.X / 7.X
Before following the below steps make sure to take backup of the data and proceed.

Steps to remove Logical volume

Below are my logical volumes available on my server and I will show you how to delete the logical volume "asklv" and it's associated vgs and pvs.




Step 1: Comment the entry in fstab


Step 2: unmount the volume
umount /mnt
Step 3: Deactivate the Logical volume

Before deleting the logical volume in clustered environment it must be deactivated
lvchange -an /dev/mapper/askvg-asklv
Step 4: Remove the logical volume
lvremove /dev/mapper/askvg-asklv
Step 5: Deactivate the lv's corresponding VG
vgchange -an askvg
Step 6: Remove the volume group
vgremove askvg
Step 7: Remove the physical volumes corresponding to the VG "askvg"
pvremove /dev/sdb1 /dev/sdc1
Step 8 : Remove the disk/LUN from OS level
echo 1 > /sys/block/<disk name>/device/delete
echo 1 > /sys/block/sdc/device/delete
Finally, check whether all disks are removed from fdisk command

Share it:

Post A Comment: