Linux Administration Bootcamp
Installing and Connecting to a Linux System
Intermediate Linux Skills
Linux Boot Process and System Logging
Disk Management in Linux
LVM - The Logical Volume Manager
User Management in Linux
Networking With Linux
Shell Scripting with Linux
Command Line Kung Fu
In this course, you will learn how to install a Linux system and connect to it, whether that be on Mac or Windows.
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.