Removing an existing LVM volume

The flexibility of LVM allows us to allocate the pooled storage of physical volumes however we see fit. This recipe shows us how to delete a logical volume and free its storage back to the volume group for use by other logical volumes.

Getting ready

This recipe requires a CentOS system with administrative privileges provided by logging in with the root account or using sudo. It assumes that a logical volume has been created as described in the preceding recipe.

How to do it...

Perform the following steps to remove an LVM volume:

  1. Unmount the filesystem with umount:
           umount /mnt 
    
    
  2. Open /etc/fstab and verify that there isn't an entry to automatically mount the filesystem. If there is, remove the entry, save your changes, ...

Get CentOS 7 Server Deployment Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.