[TriLUG] cool underexposed Linux toys - LVM
Reginald Reed
reginald at cisco.com
Thu Jul 24 00:05:02 EDT 2003
I'm in full agreement here. I haven't used LVM under Linux, but I have
used it *extensively* AIX v3.x and v4.x on a couple of previous jobs.
As mentioned below, it works great for databases and large servers.
Came in handy for DB2 and one of my servers with 4k+ users.
--Reggie
On Wednesday, July 23, 2003 9:46 PM, trilug-admin at trilug.org <> wrote:
> For those of you who are just getting into Linux, or those who have
> been at it for awhile but haven't yet gotten their hands dirty in LVM,
> I think it is time for a quick intro.
>
> Those of you who hang out in the #trilug channel on IRC heard me
> asking some questions earlier, then finding the answers and becoming
> quite enamored with this completely underexposed part of most modern
> Linux distributions.
>
> LVM, or Logical Volume Management, is a software tool that allows you
> to abstract and manage your hard disk(s). It has undeniable perks for
> small standalone servers with a single IDE disk as well as large
> enterprise servers with multi-terabyte SAN arrays.
>
> First you need to wrap your brain around how LVM organizes your disks.
> First you take entire hard disks, or partitions of hard disks, and tag
> them as a Physical Volume (PV).
>
> Next you create a Volume Group (VG) which can contain one or more
> PV's. You can think of the VG as one large virtual hard disk.
>
> The next step is to create Logical Volumes (LV). An LV is like a
> partition of a hard disk. One or more LV's are contained within a VG.
> You don't have to use all of your available space, and indeed you
> probably shouldn't use up all of your available space when creating
> LV's.
>
> The LV's are formatted with the filesystem of your choice (usually
> ext3) just like a normal hard disk partition. They can then be
> mounted like a normal filesystem.
>
> But then it gets neat.
>
> Let's say your /home partition gets close to filling up. Remember how
> you didn't allocate all of your available space when making up the
> LV's? Well now you can extend your LV that contains /home, and extend
> the filesystem itself to consume the additional space in the LV that
> you just appended.
>
> What if you *did* use up all of your available space when you defined
> your LV's? Not a problem. Chances are one of your other filesystems
> has free space. Let's say /usr has 2GB of free space. /usr doesn't
> change much. So let's shrink the LV that contains /usr by 1800MB and
> then reallocate that space to /home. Not a problem. You can shrink
> filesystems just as easily as you can grow them.
>
> For you RDBMS admins check this out; you can create filesystem
> snapshots using unallocated space. So you can stop the database,
> create a snapshot, and start the database again in a second or two.
> Then just back up from the snapshot, and disable the snapshot when
> you're done. Total RDBMS downtime is so fast you might miss it if you
> blink.
>
> You can read the LVM HOWTO at
> http://tldp.org/HOWTO/LVM-HOWTO/index.html but really the only way to
> get an appreciation for LVM is to slap an extra old drive or two (or
> three) into your Linux box and play with it. I did just that today
> and came away salivating from the practical applications of this.
> And this is someone who has been using Linux professionally for over
> five years.
>
> The commands are very easy to understand. If you have figured out how
> to edit a file in vi or emacs, then you have enough brain cells to
> understand the simple management commands for LVM.
>
> For you install fest folks, you might want to give serious though to
> making use of LVM in your installs. It will give the owner of the box
> a lot more control over disk layout down the road when they understand
> the dynamics of their machine better and can re-allocate space as
> needed (or append new drives even).
>
> I know that Red Hat 9 has LVM support in the installer, and I am told
> Mandrake has had this for some time. Older versions of Red Hat don't
> seem to have full support for this, and by extension some of the Red
> Hat offshoots don't seem to yet. The HOWTO describes, well, HOW TO
> install LVM on systems that don't already have it.
More information about the TriLUG
mailing list