1. Home
  2. Training Library
  3. Linux Administration Bootcamp Introduction | CSL4 V2 A3.1 |

Removing Logical Volumes, Physical Volumes, and Volume Groups

Contents

keyboard_tab
Linux Administration Bootcamp
Installing and Connecting to a Linux System
2
Linux Boot Process and System Logging
33
Disk Management in Linux
36
Partitions
PREVIEW6m 50s
38
User Management in Linux
Shell Scripting with Linux
54
55
Start course
Overview
Difficulty
Beginner
Duration
7h 28m
Students
3
Description

In this course, you will learn how to install a Linux system and connect to it, whether that be on Mac or Windows.

Transcript

Before we wrap up this lesson, I wanna show you how to undo your changes, or how to delete logical volumes of volume groups and physical volumes. First, let's start out by unmounting the file system that we just mounted. So we'll unmount secrets here, and now we can remove the underlying logical volume. They asked us, "Do you really want to remove "and discard all this data that resides here?" And we're gonna say "Y" for yes. So by the way, once you do that, your data that was on that file system, or on that logical volume, is gone. If you want to remove a PV from a VG, use the vgreduce command.

Now first, let's show that we have two PVs and VG. So in the PV column we have two for our vg_safe volume group. So let's do this vgreduce, the name of the volume group, and let's give it dev/sde. Now, if we look at it, we only have one physical volume and vg_safe. Now that PV that we just removed, is free to be used in another volume group if we wanted to. Or if you don't wanna use that disk with LVM, you can free it up or remove it from the Logical Volume Manager with the pvremove command, and let's do that here now.

So now, if we look at our PVs, we do not see dev/sde anywhere in our list. Let's finish destroying the vg_safe volume group with the vgremove command. So if we run our VGs command, vg_safe is not there anymore because we just removed it. And if we run our PVs command, we can see that that one final disc that was in that volume group, is now freed up to be used by another volume group. There's no volume group in the VG column beside dev/sdd. Now, if we're done with that disc, we can pvremove it, like we did the other one. So we can do pvremove /dev/sdd, run PVs, and then, of course, that is not listed in LVM.

About the Author