Help Center/ Elastic Volume Service/ Best Practices/ Using LVM to Manage EVS Disks/ Implementation Procedure/ Extending the Logical Volume by Expanding Capacity of an EVS Disk
Updated on 2026-02-06 GMT+08:00

Extending the Logical Volume by Expanding Capacity of an EVS Disk

Scenarios

If the logical volume space becomes insufficient, you can extend the logical volume. This section describes how to add 10 GB space to a 19 GB logical volume by expanding the capacity of an EVS disk.

If the physical volume is created on an entire EVS disk (without partitions), you only need to expand the EVS disk capacity. If the physical volume is created on a partition of an EVS disk, you need to first expand the EVS disk capacity and then extend that partition.

Procedure

  1. Expand the capacity of an EVS disk on the console.

    1. Sign in to the EVS console.
    2. Locate the to-be-expanded disk and expand the capacity.

      For details, see Expand Disk Capacity.

  2. Log in to the ECS as user root.
  3. Check whether the system has identified the added space.

    fdisk -l

    Information similar to the following is displayed:

    The size of /dev/vdb has increased from 10 GB to 20 GB.

  4. Extend the EVS disk partition.

    If the target physical volume corresponds to one partition on the EVS disk, perform this step. Otherwise, skip this step and go to 5.

    growpart <device-name> <partition-number>

    Example command:

    growpart /dev/vdb 1

    If the command output contains CHANGED, the command is executed successfully.

  5. View information of the physical volumes.

    pvdisplay

    Information similar to the following is displayed:

    The size of /dev/vdb remains 10 GB, indicating that the size of the physical volume is not increased.

  6. Extend the physical volume of the corresponding EVS disk.

    pvresize -v <disk-device-name>

    Example command:

    pvresize -v /dev/vdb

    Information similar to the following is displayed:

    In the command output, the physical volume corresponding to /dev/vdb has been extended.

  7. Extend the corresponding logical volume if needed.

    lvextend -l +100%FREE <logical-volume-path>

    Example command:

    lvextend -l +100%FREE /dev/vgdata/lvdata1

    Information similar to the following is displayed:

  8. Extend the file system on the partition.

    • ext4 file system

      resize2fs <logical-volume-path>

      Example command:

      resize2fs /dev/vgdata/lvdata1

      Information similar to the following is displayed:

    • xfs file system

      xfs_growfs <logical-volume-path>

      Example command:

      xfs_growfs /dev/vgdata/lvdata1

  9. Check the capacity expansion result.

    lvdisplay

    Information similar to the following is displayed:

    In the command output, the logical volume size (LV Size) is increased by 10 GB.