Installing LVM

Scenarios

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

In this document, 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 document is used for reference only.

Prerequisites

You have an ECS and have bound an elastic IP address (EIP) for 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 Logical Volumes 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.