Pawan Sharma | October 19, 2011 | | Be the first to comment!

Logical Volume Manager in RHEL 6: Part1

Logical Volume Manager also known as LVM is one of the most important topic, not only for the RHCSA exam preparation but also for the real environment System Administration. In production environment the disk partitioning is mostly based on LVM because of facilities and ease provided by Linux Logical Volume Manager. LVM provide facility to create partitions flexibly. For example using LVM we can make a volume group using a chunk of hard-disks, and from that volume we can create partitions as required. LVM gives System Administrator, power to extend or reduce the partitions online, means we can extend a logical volume while the data on it is being accessed by the users, without corruption of data.

It is important to understand the basic concept of LVM. There are mainly three steps(points) to create LVM:
  • Physical Volume:- Actual hard-disk or a partition of disk.
  • Volume Group :- Group of one or more than one physical Partition(s).
  • Logical Volume :- Partition created from Volume Group.
 In the above example there are three disks (can also use partitions of disk) made as Physical Volume(PV), lets say size of each Physical Volume be 20 GB. From these three Physical volumes we create a Volume Group(VG), so the size of that Volume Group is 20 x 3 = 60 GB. From that Volume Group we can create multiple Logical Volumes (partitions) of different sizes or a single partition of 60 GB. We can use the whole volume group at a time, or can use create partitions when required. 

Lets take a simple example: We have created a Volume Group named VGDATA of size 60 GB using three 20 GB Physical Volumes. From Volume Group "VGDATA" we created two Logical Volumes "lvdata1" and "lvdata2" each of size 30 GB and mounted them on /data1 and /data2 respectively. After a period of time we feel that directory /data2 is getting full and need more space, we can do that by adding a new hard-disk of size 25 GB and making it a Physical Volume. Now we can extend the Volume Group VGDATA by adding the new Physical Volume to it. So now size of VGDATA becomes 85 GB. Now we can extend the Logical Volume "lvdata2" to appropriate size.

This is a general overview of Redhat Enterprise Linux Logical Volume Manager (LVM). In the next post we will learn commands and process to create LVMs'.

For any questions or quires please comment.

No comments:

Post a Comment