LVM: Remove a Filesystem / Logical Volume
Article Number: 165 | Rating: Unrated | Last Updated: Sat, Jun 2, 2018 10:18 PM
# 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
|
Posted - Sat, Jun 2, 2018 10:18 PM. This article has been viewed 2451 times.
Filed Under:
Linux
There are no attachments for this article.
There are no comments for this article. Be the first to post a comment.
Related Articles
LVM: Managing snapshots
Viewed 7613 times since Sat, Jun 2, 2018
Linux: how to monitor the nofile limit
Viewed 10496 times since Wed, Jul 25, 2018
Securing /tmp and shm partitions
Viewed 3088 times since Fri, May 15, 2020
Extending Linux LVM partitions script
Viewed 6277 times since Wed, Feb 6, 2019
RHCS6: Clustered LVM
Viewed 2092 times since Sun, Jun 3, 2018
RHCS6: Show/Add GFS2/GFS journals
Viewed 12597 times since Sun, Jun 3, 2018
Get UUID of Hard Disks [Update]
Viewed 2087 times since Tue, Jul 17, 2018
Linux Customizing Bash
Viewed 2011 times since Sun, Dec 6, 2020