Creating a Python Script to Create LVM volume.

Now guys we have to create a python script to create a LVM volume.

Before continuing to this blog refer to this blog:

This blog will tell you all about LVM, How to create LVM manually, how to extend the size of the same etc.

Step 1: Open a text editor and write a python code.

Refer to this link for complete code :

Now run the script in the console.

Now, As you can see that our lvm volume has been reduced to 5 GB.

Similarly use this menu to create or delete LVM partitions.

This is how a LVM partition creation can be automated using Python script.

Thanks for reading….



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store