Logical Volume Management

Posted By : Ankit Gupta | 29-Jun-2015

LVM (Logical Volumne Management)

LVM :- It is the technique which provides disk Flexibility . It is always used in higher level Storage to extend or reduce any volume size. It is the method of providing storage space on volume storage devices which is more flexible than conventional partitioning schemes.The LVM driver allows users to manage disk space very economically and in a very organised manner. Disk space from disks, and partitions, known as “Physical Volumes”, which can be added to “Volume Groups”, which is the collection of available disk space for “Logical Partitions” .

Physical Volume :- Physical Volume means Physical disk Patition/Space with 8e Code.It is the basic unit in a LVM formation order. Each Physical Volume subsist of small disk space chunks called Physical Extends. Every Volume Group must contain atleast one PV. PV can be created on hard disks.

Volume Group :- Volume group contains no. of physical volumes. One Volume Group requires atleast 1 Physical volume and can be more than one or in other words , It is the pool from which the user makes Logical Volumes and in which Physical Volumes can be added. It is the basic administration unit of the LVM configuration.

Logical Volume :- It is defined as the Logical partition created from space storage assigned to Volume group. Also , the hardware storage configuration is out of view from the software so that it can be resized and moved without stopping applications or unmounting file systems.

Physical Extents :- Each physical volume is seprated in chunks of disk space.Default Size of Chunks is 4MB. Every LV size is calculated by PE size. The LV is created by mapping Logical Extends in the LV to Physical extends in a Volume group.

Logical Extents :- Each logical volume is divided into chunks of disk space, known as logical extents. The extent size is the same for all logical volumes in the volume group.

Devices :- /dev/sdb1 , /dev/sdb2 , /dev/sdb3 , /dev/sdb4.

Steps to Create LVM are as below :-

The First approach to create LVM is to create a physical volume , command to create physical volume is as below :-

1. pvcreate /dev/sdb1 /dev/sdb2 /dev/sdb3 /dev/sdb4

Ones the PV's are created , you can view it by following command.

2. pvdisplay
3. pvs

The Next step is to create a volume group and creating the logical volume by issuing the vgcreate command as below :-

4. vgcreate grpvol0 /dev/sdb1 /dev/sdb2.

After Creating the vg , you can see it by following command :-

5. vgdisplay
6. vgdisplay grpvol0.

The Last Step to create the logical volume and you can create the logical volume with a your customized size and name of lv using the vg 'grpvol0'.

7. lvcreate -L 2G -n lvmvol0 grpvol0

where L = Length
          n = name of LVM.

Ones the LVM is created , you can view it by following command :-

8. lvdisplay 
9. lvs. 

 

THANKS

About Author

Author Image
Ankit Gupta

Ankit is an experienced Linux administrator.He is well versed with Private Cloud Technologies like Vmware/OpenStack etc

Request for Proposal

Name is required

Comment is required

Sending message..