Automating LVM with python script

Automating LVM with python script

Code has been uploaded to github: https://github.com/kapil111kumar/lvmautomation

Name of the python script is "lvmautomation.py", command to run python file --> python3 lvmautomation.py

No alt text provided for this image

Options are provide in the menu for different procedures...

  1. We will choose the option 1 to list all the disks/drives...
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

Disks: /dev/sdc, /dev/sdd, /dev/sde are the on which we will perform automation..

2. Now, will choose the option 2, to create physical volumes(PV's) on the disks stated above...

No alt text provided for this image

And we will continue for next options..

No alt text provided for this image

3. Now, will go for option 3 to display all the new PV's created..

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

As we can observe that these disks space aren't still allocatable.. it is bcz.. we haven't created any vg and formatted, so in next step we eill do that.

4. Now, we add the above three PV's(/dev/sdc, /dev/sdd. /dev/sde) created in option 2, and then create a volume group(VG) named "vg1"

No alt text provided for this image

VG "vg1" has been created successfully..

5. We can list the VG's using the the option 5..

No alt text provided for this image

we can see from the output that vg1 of size appx. 43GiB(8+20+15)

6. Now, we will create a logical volume "lv1" from the VG "vg1" of size 11GiB and format it with fs "ext4"..

No alt text provided for this image

7. We can display the LV using option 7..

No alt text provided for this image

8. Now, we will do some extra part that is resizing the size of LV, we can increase or decrease but here we will do the practical for increase..

No alt text provided for this image

resizing has been done, we can also observe that resize2fs formatting type has been use..

we also confirm it from option 7... size has been resized to 19GiB

No alt text provided for this image

we can see it also using option 1..

No alt text provided for this image

!!! Task Completed !!!

要查看或添加评论,请登录

Kapil Kumar的更多文章

  • Creating a Simple Calculator with flutter

    Creating a Simple Calculator with flutter

    I have used flutter to create a simple calculator app which can perform operations like +,-,*,/ Here, I will show you…

  • Docker Web Portal

    Docker Web Portal

    I have created a web portal related to docker, in which we can run docker commands..

  • Object Recognition and License plate detection with recognition

    Object Recognition and License plate detection with recognition

    I have created a machine learning mode: Object Detection. ---> Main objective is to detect the car.

  • Use case of Javascript : Uber

    Use case of Javascript : Uber

    I am doing this article on Uber company..

  • Kubernetes GUI(Web Portal)

    Kubernetes GUI(Web Portal)

    I have created a K8s GUI with my team members in summer training. It will run some of K8s commands for you, like:…

  • k-mean clustering and its real usecase in the security domain

    k-mean clustering and its real usecase in the security domain

    K-means clustering is one of the simplest and popular unsupervised machine learning algorithms. Typically, unsupervised…

  • Task 04

    Task 04

    Task 4.1: Create image by yourself Using Python Code Above is the code in which I have created "smiley face" and "sad…

  • IDS, Cyber crimes and confusion matrix

    IDS, Cyber crimes and confusion matrix

    Firstly, I will talk something about IDS(Intrusion Detection System). Intrusion Detection System is a software…

  • GUI container on the Docker

    GUI container on the Docker

    I have already installed docker Going inside a particular folder or workspace, I will create a Dockerfile, to build an…

  • Creating a very simple ML model on Docker container

    Creating a very simple ML model on Docker container

    Pulling the Docker container image of CentOS image from DockerHub 2. Creating a new container, using the following…

社区洞察

其他会员也浏览了