Updated on 2022-09-15 GMT+08:00

Installing LVM

Scenarios

By default, LVM is not installed in the ECS operating system (OS), and you need to manually install it. This section shows how to check whether LVM is installed on your ECS and how to install LVM.

In this section, CentOS 7.4 64bit is used as the sample OS. The method for formatting an EVS disk varies depending on the OS running on the server. This section is used for reference only.

Prerequisites

You have an ECS and have bound an EIP to the ECS.

Procedure

  1. Log in to the ECS as user root.
  2. Run the following command to check whether LVM is installed:

    rpm -qa |grep lvm2

    Information similar to the following is displayed:
    [root@ecs-lvmtest ~]# rpm -qa |grep lvm2
    lvm2-libs-2.02.177-4.el7.x86_64
    lvm2-2.02.177-4.el7.x86_64
    • If the preceding information is displayed, LVM has been installed. Go to Creating a Logical Volume Using LVM.
    • If the preceding information is not displayed, LVM has not been installed. Go to 3.

  3. Run the following command and follow the prompts to install LVM:

    yum install lvm2

    Information similar to the following is displayed:

    ......
    Installed:
      lvm2.x86_64 7:2.02.177-4.el7
    
    Dependency Installed:
      device-mapper-event.x86_64 7:1.02.146-4.el7                          device-mapper-event-libs.x86_64 7:1.02.146-4.el7
      device-mapper-persistent-data.x86_64 0:0.7.3-3.el7                   lvm2-libs.x86_64 7:2.02.177-4.el7
    
    Dependency Updated:
      device-mapper.x86_64 7:1.02.146-4.el7                             device-mapper-libs.x86_64 7:1.02.146-4.el7
    
    Complete!

    When Complete! is displayed, LVM is successfully installed.