LVM: Remove a Filesystem / Logical Volume

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
0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
How to find the largest files and directories in Linux?
Viewed 4205 times since Sun, May 20, 2018
Epoch & Unix Timestamp Conversion Tools
Viewed 83263 times since Fri, Jun 22, 2018
stunnel basics and pki standards
Viewed 10413 times since Fri, Sep 28, 2018
Deskshare TLS over Stunnel
Viewed 3587 times since Fri, Sep 28, 2018
Fałszujemy rozpoznania skanerów #2
Viewed 3724 times since Mon, May 21, 2018
rabbitmq Troubleshooting TLS-enabled Connections
Viewed 3812 times since Sun, Dec 6, 2020
Expand or grow a file system on a Linux VMWare VM without downtime
Viewed 12515 times since Fri, Jul 27, 2018
LVM: Reduce an existing Logical Volume / Filesystem
Viewed 4373 times since Sat, Jun 2, 2018
RHEL: Enabling standard ftp/telnet
Viewed 4539 times since Sun, May 27, 2018
INSTALACJA MIB SNMP W SYSTEMIE CENTOS/RHEL 6
Viewed 13752 times since Fri, Nov 30, 2018