LVM: Remove a Filesystem / Logical Volume
Article Number: 165 | Rating: Unrated | Last Updated: Sat, Jun 2, 2018 10:18 PM
LVM: Remove a Filesystem / Logical Volume
# Tested on RHEL 5, 6 & 7
MNTPT=/testmntpt VG=`mount | awk '{if ( $3 == "'$MNTPT'" ) print$1}' | cut -f4 -d'/' | cut -f1 -d '-'` LV=`mount | awk '{if ( $3 == "'$MNTPT'" ) print$1}' | cut -f4 -d'/' | cut -f2 -d '-'` umount $MNTPT lvremove $VG/$LV Do you really want to remove active logical volume testlv? [y/n]: y Logical volume "testlv" successfully removed vi /etc/fstab # Remove corresponding line |