Integrating LVM With Hadoop and Provide Elasticity

Abhishek kumar
4 min readMar 14, 2021

Task Description

  1. Integrating LVM with Hadoop and provide elasticity to DataNode.
  2. Increase or decrease the size of static partition of Linux.

For this specific Task I am going to use RHEL8, First configure it.

what is LVM?

LVM stands for Logical Volume Management. It is a system of managing logical volumes, or filesystems.

why LVM?

One of the biggest advantages LVM is that most operations can be done on the fly, while the system is running.

First Create a VM and in Setting Go to storage section. click on SATA and select the select disk shown in image.

Click on create for attaching new storage because if you create partition in root volume, system migth be go in maintainence mode.

Go for default and click on VDI.

select Dynamically allocated.

Next create the storage and attach it to VM. Now You can clearly see, it is attached to the VM.

Open the VM and run command #fdisk -l and use can see one more volume is attached /dev/sdb.

create a PV(physical volume) to the attached Volume. Command is #pvcreate <Volume_name>

#pvdisplay shows the PV.

Now create VG(Volume Group) using command #vgcreate <vg_name> <volume_name>. This creates a pool of disk space out of which logical volumes can be allocated.

Use #vgdisplay

Now create LV (Logical Volume) using command #lvcreate — size <size> — name <name of vg> <name of vg>. it creates a partition of specific size, here I have given 6G.

#lvdisplay to show the partition.

Now Format the partition using mkfs, you can use other formatting also.#mkfs.ext4 <partition_name>. It helps to store the data to the mounted file, will see further.

use #df -h to see the partition with mounted files.

Now we create a folder and mount the partition to that folder. commands #mkdir <folder_name> for create the folder. #mount <partition_name> <folder_name> is used for mounting the folder.

For Increasing the partition size on the fly we use command #lvextend — size <size> <partition_name>.

Now format the extended size for use it. command #resize2fs <partition_name>.

So, Here task is completed. Hope you like it.

Thanks for reading.