Removing logical volumes, volume groups, and physical volumes
To start with the commands used to remove, let’s do the simple step of removing the img
LV. First, we need to check whether it’s mounted:
[root@rhel-instance ~]# mount | grep img /dev/mapper/storage-img on /srv/img type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota)
As it is mounted, we need to dismount it:
[root@rhel-instance ~]# umount /srv/img [root@rhel-instance ~]# mount | grep img
The last command shows an empty output, which means that it isn’t mounted. Let’s proceed to remove it:
[root@rhel-instance ~]# lvremove /dev/storage/img Do you really want to remove active logical volume storage/img? [y/n]: y Logical volume "img" successfully removed
Now, we can also remove the mount point:
[root@rhel-instance ~]# rmdir /srv/img
And with that, the removal of the LV is complete. This process is not reversible, so run it with...