Book Image

CentOS 7 Server Deployment Cookbook

By : Timothy Boronczyk, IRAKLI NADAREISHVILI
Book Image

CentOS 7 Server Deployment Cookbook

By: Timothy Boronczyk, IRAKLI NADAREISHVILI

Overview of this book

CentOS is derived from Red Hat Enterprise Linux (RHEL) sources and is widely used as a Linux server. This book will help you to better configure and manage Linux servers in varying scenarios and business requirements. Starting with installing CentOS, this book will walk you through the networking aspects of CentOS. You will then learn how to manage users and their permissions, software installs, disks, filesystems, and so on. You’ll then see how to secure connection to remotely access a desktop and work with databases. Toward the end, you will find out how to manage DNS, e-mails, web servers, and more. You will also learn to detect threats by monitoring network intrusion. Finally, the book will cover virtualization techniques that will help you make the most of CentOS.
Table of Contents (18 chapters)
CentOS 7 Server Deployment Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

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, and close the file.

  3. Use lvremove to delete the logical volume:

    lvremove vg0/myvol
    
  4. Review the output of vgs to verify the removal.

How it works...

Deleting a volume frees its storage back to the volume group, which can then be used to create...