Using Logical Volume Management in Linux

I haven't done much with LVM in Linux. In Red Hat 4, it became possible to use it to manage your volumes. In Red Hat 5, it's the default method for dealing with disks. I've done a fair amount with Veritas Volume Manager (VxVM) under Solaris, however, it's been awhile. But, the concepts I learned under VxVM are similar to that of the Linux LVM.

One thing that appears to be different about Linux LVM vs VxVM is that LVM only creates raid 0/1 sets and NOT raid 5 sets. If you need Raid 5, you have to use a md device.However, md sets can create 0/1/5 raid sets.

Here's the concepts you need to know in relation to LVM:

Physical Volume - Physical Disks on the System (The pv* commands)
Volume Group - A group of disks that are configured to act as a single 'disk' (The vg* commands)
Logical Volume - A 'volume' that lives inside a volume group. A volume is similar to a partition on a raw disk, but it is much, much, much better. It can span multiple physical disks, it can be mirrored, and most importantly, it can be resized easily.

Here's a quick cheat-sheet of things to know while using Linux LVM:

lvmdiskscan - show all disks on system
vgs - show volume information
pvcreate - encapsulate disks for LVM use
pvscan - show disks available to system
pvmove - move disk from one to another
vgcreate - create striped volumes
vgextend - add disk to group to expand storage space
vgreduce - remove disk from volume
vgremove - remove volume
vgrename - rename volume
lvremove - remove logical volume
lvcreate -L -n - create generic volume
lvcreate -i - create volume in stripes

Here's the basic theory for creating a volume:
1. Encapsulate the disk (Using the pvcreate command)
2. Create a volume group using the encapsulated disks (Using the vgcreate command)
3. Create a logical volume. (Using the lvcreate command)
4. Format the volume using your filesystem of choice (e.g. mkfs.ext3 /dev//)
5. Mount it.

This is an article on HowTo Forge about LVM's. It's brief and covers a lot of ground.