Tuesday, August 18, 2009

Linux LVM refresher

Here's my problem, there's just too much to keep track of and remember and I just can't get it all in my 2 cell brain. I learn something new and then a few months later I completely forget stuff. Take for example the LVM in Linux between Solaris, AIX and Linux I can't keep my OS commands straight and that doesn't include apps, databases, cisco IOS, EMC, NetApp etc...

So back to LVM. It's actually quite straight forward, just a few commands is all it takes to get started.

1. You start with the physical disks (or disk slices) such as /dev/sda1 /dev/sda2 /dev/sdb1 and /dev/sdb2. You then add them to LVM as Physical Volumes (PVs) using pvcreate (and pvdisplay to view).

2. Next you are ready to create Volume Groups (VGs) on these PVs using vgcreate (and vgdisplay to view).

3. Now you can create the Logical Volumes (LVs) in the VGs using lvcreate (and lvdisplay to view).

4. Finally you're ready to create a filesystem (fsck) on the volumes.

Of course this just barely touches the subject of LVM on Linux, there are many other things you can do such as snapshots, backups/restores of metadata etc.

No comments:

Post a Comment