Linux Logical Volume Manager (LVM) on Software RAID
If you plan on using LVM, I really recommend doing so on a RAID system, either hardware or software. Disks are dirt cheap nowadays, so there’s really no excuse not to have mirroring (or RAID 5 if that’s better for your usage). The RedHat installer will let you create LVM volumes on top of RAID volumes (it’s a bit confusing, but it works), or you can do it later. Also remember that raid is not a substitute for regular and reliable backup!Before we get to how you’d do this, let’s go over what LVM gives you. First, LVM combines physical devices (partitions on disks in this case) into what it calls Volume Groups. Filesystems are then built on the Volume Group or groups. You can have a Volume Group that has only one disk partition in it, or several partitions on one or more disks. Each Volume Group can contain multiple filesystems. With this, you gain a lot of new capabilities.
* Increase or decrease filesystem size
Decreasing the size of a filesystem returns space to the Volume Group. Increasing draws space from it. If you have too much space allocated for a file system, you can decrease it, and use that space somewhere else that needs it.
Yes, you can do that with “parted”, but it’s not at all the same. You aren’t dealing with contiguous disk blocks with LVM - all you need is free space in the Volume Group.
* Add more physical storageYou can add more physical drives to an existing Volume Group, which of course immediately gives you more room to extend file systems.
* Create “snapshots” of filesystems.This is a great feature, but it requires a bit of explanation, so we’ll leave the details for later. The use of snapshots is to freeze a filesystem in time, and let you go on using it while you leisurely back up the frozen data. What’s wonderful about this is that it is NOT necessarily a full copy of your original file system - more on that later.
* Move Volume Groups to new physical storageI’m not going to cover this here, but it’s a great feature, and you can even do it while the filesystems are in use!
* StripingI’m not going to cover that here (there are some references at the bottom of this article that do cover it), but you can get the performance benefit of striping as part of LVM. If you do this, it is even more critical that you mirror your drives. If you used RAID 5, there wouldn’t be any point in striping in LVM as you already would have that benefit (see Raid if you don’t understand that).
Leave a reply