8.11. Introduction to LVM

LVM (Logical Volume Manager) is a powerful Linux feature that adds a layer of abstraction between the physical partitions on your system and the filesystems that they store. Partitions managed by LVM are called a physical volumes, which are combined together to form volume groups. From each volume group logical volumes can be created, on which filesystems are actually stored. The size of each volume group is the sum of the sizes of all its physical volumes. This space can be handed out to as many logical volumes as will fit into it, so that it could contain many small logical volumes or one huge one that spans multiple physical volumes (and thus partitions).

At first glance, LVM may not seem any more powerful than RAID, which can also combine multiple partitions into one large filesystem. It does, however, give you far more freedom to carve up disks into separate filesystems that may take up part of a disk, several disks, or anything in between. The only down side is that LVM does not support redundancy as RAID does in Levels 1 and 5.

The most useful feature of LVM is the ability to resize logical volumes and the filesystems within them up to the amount of free space in the volume group. Additional physical volumes (such as newly installed hard disk partitions) can be added to an existing volume group, subsequently increasing the amount of free space. For example, if your system has two hard disks whose partitions are combined to form a volume group, you might have a filesystem on a logical volume that is as big as both disks combined. If you begin to run out of disk space and want to enlarge the filesystem, you can install a new hard disk, add it to the volume group, and then enlarge the logical volume to make use of all the new free space! This is far more convenient than mounting the new hard disk as a subdirectory somewhere under the existing filesystem.

Figure 8.5. An overview of the logical volume manager.


Physical volumes can also be removed from an LVM volume group, as long as there is enough free space in the group to store data that used to be on the physical volume. This means that you could theoretically remove a small hard disk from your system and replace it with a larger one, without having to manually copy files around.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.242.253