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
logical volume. First, we need to check whether it's mounted:
[root@rhel8 ~]# 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@rhel8 ~]# umount /srv/img [root@rhel8 ~]# mount | grep img
The last command shows an empty output, which means that it isn't mounted. Let's proceed to remove it:
[root@rhel8 ~]# 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@rhel8 ~]# rmdir /srv/img
And the removal of the logical volume is done. This process is not reversible, so run it carefully. Our disk distributions now look...