If you've ever wondered how you could rebuild the filesystem and disk
parts of your computer without having to redo everything, LVM is the
answer.
Explained most simply, LVM is what is used to allow your Linux operating system to access the hard drive partitions through a layer that is flexible enough to be changed without requiring changes to the structures actually stored on the disk. You can do the following things with LVM:
This topic deserves more discussion which I will be adding shortly -BMC Logical Volume Management is one way of virtualizing resources. See the discussion on Virtualization for more general information. How LVM worksLVM consists of three manageable sections:
It is possible to combine drives and partitions in pretty much any way imaginable and treat them as a single drive or split them into virtual drives. The Physical Extents create managed sections that can be managed at the most basic layer. Think of it as virtual drive blocks. The Volume Groups create what are best thought of as virtual hard drives and at the last layer, the Logical Volumes are virtual partitions. These separations give administrators the ability with Physical Volumes to move data between sets of blocks and to optimize those blocks without requiring modifications to the systems using them. Further with Volume Groups, the system can combine, do basic RAID, or split the physical extents into virtual drives. Finally, the Logical Volumes can be used as virtual partitions, but expanded or contracted to match the changing layer below.
Carving off some free spaceEvaluating available space# pvdisplay --- Physical volume --- PV Name /dev/sda2 VG Name VolGroup00 PV Size 74.43 GB / not usable 22.62 MB Allocatable yes PE Size (KByte) 32768 Total PE 2381 Free PE 1688 Allocated PE 693 PV UUID iWzGoN-N7de-wkxA-HhLf-cqy3-8l73-jr4l05 Note the PE Size. This is the size of the "Physical Extents" or physical sections assigned to this volume group. The Free PE are the physical extents that are available to be assigned to something new and by multiplying the space per extent by the numbers of extents, you can determine how much space is available to be assigned. In this example, there are 52GB of unassigned space. To create a logical volume of 10GB carved out of volume group VG00 with a name of mylv: lvcreate -L 10G -n mylv VG00 Don't forget to activate the LVMs with lvchange -a y /dev/LogVol/whatever Really short cut Shrinking
|