1.0 INTRODUCTION
LVM or Logical Volume Management is a tool that provides a detailed view of the disk storage on a computer. This tool allows an administrator much more freedom and liberty in allocating storage to users and applications.
Space can be resized and changed freely, but will undoubtedly require an update for the file system tools. The volume manage also allows management of storage volumes in user-defined groups, allowing the system administrator to deal with names that make sense and allow easy navigation and movement.
2.0 PROJECT
I. Requirements
• Linux VM Machine
• 1 8GB HDD for OS
• 1 GB HDD for LVM
II. Installation
Step One: Creating a LVM
• First we need to fdisk the 1 GB HDD
• From a terminal with root powers do the following
• a. Type 'fdisk /dev/sdb' enter. (your drives may very)
b. Type 'n' enter (new partition)
c. Type 'p' enter (primary)
d. Type '1' enter (partition number)
e. Hit enter (default starting cylinder)
f. Hit enter (default ending cylinder)
g. Type 't' enter (change partition type)
h. Type '8e' enter (sets partition value)
i. Type 'w' enter (writes these changes to hard drive)
• Type pvcreate /dev/sdb1
• Type gvcreate coreyk /dev/sdb1
• That creates the group volume
• Type lvcreate –L 20M coreyk –n flex
• That sets the size of the drive to 20mb
Step Two: Creating an Alias
• The lvscan command shows all LVN’s
• Type lvscan to see
• Type alias SHOWDISK=‘lvscan’
• Now type SHOWDISK
Step Three: Expanding the LVM Size
• To expand the LVM size type
• lvextend –L 200M /dev/coreyk/flex
• This will make the drive 200mb now
• Type SHOWDRIVE to see the change
Step Four: Shrinking the LVM Size
• To shrink the LVM size Type
• lvreduce –L 5M /dev/coreyk/flex
3.0 SUMMARY
LVM is a great way to change the size of your hard drives on the fly, live without having to shutdown or reboot. This would be extremely valuable on a web server. If you needed to change the size of a clients web space, you can change it without their web site going down.