Automating LVM Partition using Python-Script.

Mihir Patel
Nov 11, 2020

--

Task description:

Here I demonstrate the LVM partition using my python script.

πŸ‘‰ Github link : https://github.com/techy-mihir/LVM-Automation-By-Python-With-LinuxπŸ‘ˆ

what is lvm?

LVM is a Logical Volume Manager used to provide storage virtualization that allows us more configuration and flexibility than the traditional on-disk partitions.

With LVM, a hard drive or set of hard drives is allocated to one or more physical volumes. LVM physical volumes can be placed on other block devices which might span two or more disks.

Open lvm.py python file

πŸ‘‰ press 1 :We will show available disk in pc . We will contribute two disk in this LVM .

we will contribute two disk /dev/sdb and /dev/sdc in making LVM.

Before use this two disk in LVM make first as PV ,By press 2 In this python tool

πŸ‘‰ Press 6: To see all Pv

See two created as Pv

πŸ‘‰ Press 3: Now Create VG(volume group)

New vg created as myvg name

πŸ‘‰ Press 4: Now we will create Lv(logical volume) as 4GB storage

So now our 4GB LV created and mount directory is mylv1 show in above image.

πŸ‘‰ Press 6: Show all LV

our lv size is 4Gb shown in above image as lv size: 4GB

πŸ‘‰ Press 5: Now if we want to extend size of LV 4GB -> 6Gb

show above image our LV extended to 6GB.

πŸ‘‰Press 7: See our new drive is created as mylv1 name. Show below image

Finally , our New LV(/mylv1) as 6GB is created.

Thank you

--

--

Mihir Patel
Mihir Patel

No responses yet