Automating the python LVM Using Python Script

Automating the python LVM Using Python Script

I already have two disks added in my VM.

No alt text provided for this image

Step 1: - Create the Physical Volume with the disks you have created.

No alt text provided for this image

We have created two physical volumes as shown below.

No alt text provided for this image

Step 2: - Create the Volume Group.

No alt text provided for this image

Step 3: - Create the Logical Volume from the Volume Group.

No alt text provided for this image

Step 4: - Format LV & mount it to the any folder you want.

No alt text provided for this image
No alt text provided for this image

You can see that we mounted it in the f1 folder.

Extending the Size of the Partition: -

No alt text provided for this image

Now, format the extra part which we have added to the partion.

No alt text provided for this image

As we can see we have extended the size of the LV.

No alt text provided for this image

Python script for this automation is here...!

Thank you.

To view or add a comment, sign in

More articles by Maharshi Prajapati

Explore content categories