All Products
Search
Document Center

Elastic Compute Service:Extend an LV

Last Updated:May 15, 2026

To extend a logical volume (LV), its volume group (VG) must have free space. If needed, first extend the VG by adding a new disk or resizing an existing one. Then, extend the LV and its file system to complete the process.

How it works

To extend an LV:

  1. Extend the VG: An LV is allocated from a VG. First, increase the VG capacity by extending or adding a physical volume (PV).

  2. Extend the LV : Allocate free space from the VG to the target LV, then extend its file system.

image

Procedure

Important

Logical Volume Manager (LVM) does not provide data redundancy. For production data, implement redundancy at the application layer or use snapshot consistency groups to protect your data.

Step 1: Extend the VG

  1. Connect to the ECS instance.

    1. Go to ECS console - Instances. In the top-left corner, select the region and resource group for the target resource.

    2. On the instance details page, click Connect > Workbench. Log on and open the terminal.

  2. Check the free space in the VG.

    Run sudo vgs. Note the VG name in the VG column and the free space in the VFree column.

    sudo vgs
      VG    #PV #LV #SN Attr   VSize  VFree
      vg_01   2   1   0 wz--n- 79.99g    0 

    In this example, the VG vg_01 has 79.99 GiB total capacity and 0 GiB free space. You must first extend the VG. If the VG has free space, directly extend the LV.

  3. Extend the VG.

    Extend a PV in the VG

    1. Check the mapping between PVs and disks.

      Run sudo pvs -a -o +devices. Match the disk (in the Devices column) to the PV (in the PV column). Record the PV and disk names.

      sudo pvs -a -o +devices
        PV         VG    Fmt  Attr PSize   PFree Devices    
        /dev/vda1             ---       0     0             
        /dev/vda2             ---       0     0             
        /dev/vda3             ---       0     0             
        /dev/vdb   vg_01 lvm2 a--  <40.00g    0  /dev/vdb(0)
        /dev/vdc1  vg_01 lvm2 a--  <40.00g    0  /dev/vdc1(0)
      • If the PV uses an entire disk (no partitions), resize the disk only. In this example, PV /dev/vdb maps to disk /dev/vdb with no partitions.

      • If the PV uses a disk partition, resize the disk and then extend the partition. In this example, PV /dev/vdc1 corresponds to partition /dev/vdc1 on disk /dev/vdc, partition 1.

    2. Resize the disk.

      1. Go to ECS console - Block Storage - Cloud Disks. In the top-left corner, select the region and resource group for the target resource.

      2. In the Actions column, click Resize.

      3. On the Determine Disk and Read Notes page, review the notes and click I Understand Risks and Have Backed Up Data. Proceed.

      4. On the Configure Resizing Method and New Size page, set the parameters, confirm the fee, and click Resize.

        Example: to resize a disk from 40 GiB to 50 GiB, set New Disk Size to 50 GiB.
        Important

        You are charged for the additional capacity when you resize a disk.

      5. (Conditional) For subscription disks, wait for the 5-second countdown in the payment dialog box, click Complete Payment, complete the payment, return to the resize page, and click Paid. Close the dialog box.

        If you click Paid. Close the dialog box. without completing the payment, click Go to Order Center to complete the payment.
    3. (Conditional) If the PV is on a disk partition, extend the partition.

      Replace <disk_name> and <partition_number> with values from Step a.

      Important

      Ensure a space separates the disk name and the partition number.

      sudo LC_ALL=en_US.UTF-8 growpart <disk_name> <partition_number>
      Example: to extend /dev/vdc1, run sudo LC_ALL=en_US.UTF-8 growpart /dev/vdc 1.

      A CHANGED keyword in the output indicates success.

    4. Extend the PV.

      Replace <physical_volume_name> with the value from Step a.

      sudo pvresize <physical_volume_name>
      Example: to extend PV /dev/vdb, run sudo pvresize /dev/vdb.

      A 1 physical volume(s) resized or updated message indicates success.

    5. Verify that the VG is extended.

      Run sudo vgs and verify that VFree increased as expected.

      sudo vgs
      VG    #PV #LV #SN Attr   VSize  VFree 
      vg_01   2   1   0 wz--n- 89.99g 10.00g

      In this example, VG vg_01 grew from 79.99 GiB to 89.99 GiB with VFree at 10 GiB, confirming the VG is extended.

    Add a new PV to the VG

    Before you proceed, create a new disk and attach it to the target instance. Do not initialize the disk.

    1. Find the device name of the new data disk.

      Run sudo lsblk -f. Identify the new disk by its NAME and empty FSTYPE.

      sudo lsblk -f
      NAME         FSTYPE      LABEL UUID                                   MOUNTPOINT
      vda                                                                   
      ├─vda1                                                                
      ├─vda2       vfat              7938-FA03                              /boot/efi
      └─vda3       ext4        root  33b46ac5-7482-4aa5-8de0-60ab4c3a4c78   /
      vdb          LVM2_member       okx24E-qSjZ-zv9l-lOkm-Pcxu-q6KX-qzRcCu 
      └─vg_01-lv01 xfs               9e2bfe15-074e-4bf5-aac5-62c58299364f   /mnt/lv01
      vdc          LVM2_member       ISeUSM-AhRp-KdNN-7pWJ-HxGW-2AEq-85m9dE 
      └─vg_01-lv01 xfs               9e2bfe15-074e-4bf5-aac5-62c58299364f   /mnt/lv01
      vdd

      In this example, vdd has no partitions and an empty FSTYPE, indicating it is the new data disk.

    2. Create a PV and add it to the VG.

      Important

      The vgextend command initializes the disk as a PV and deletes all data on it. Ensure the disk is empty.

      Replace <new_disk_device_name> with the value from the previous step.

      sudo vgextend <volume_group_name> /dev/<new_disk_device_name>
      Example: to add disk vdd to VG vg_01, run sudo vgextend vg_01 /dev/vdd.

      A successfully extended message indicates success.

    3. Verify that the VG is extended.

      Run sudo vgs and verify that VSize increased as expected.

      sudo vgs
      VG    #PV #LV #SN Attr   VSize   VFree  
      vg_01   3   1   0 wz--n- <89.99g <10.00g

      In this example, VG vg_01 grew from 79.99 GiB to 89.99 GiB with VFree at approximately 10 GiB, confirming the VG is extended.

Step 2: Extend the LV

  1. Get the path of the LV.

    Run sudo lvdisplay and note the LV Path value for use in a later step.

    sudo lvdisplay
      --- Logical volume ---
      LV Path                /dev/vg_01/lv01
      LV Name                lv01
      VG Name                vg_01
      LV UUID                DAD6Fy-4lbd-9EW9-UTvx-rGti-hYss-txxxxx
      LV Write Access        read/write
      LV Creation host, time iZbp1hww2c2kyj54i1xxxxx, 2025-09-22 10:37:58 +0800
      LV Status              available
      # open                 1
      LV Size                79.99 GiB
      Current LE             20478
      Segments               2
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     256

    In this example, the path of the LV lv01 is /dev/vg_01/lv01.

  2. Extend the LV.

    sudo lvextend -L +<logical_volume_size> <logical_volume_path>

    Parameter

    Description

    <logical_volume_size>

    The space to add. Must not exceed the free space in the VG.

    <logical_volume_path>

    The path of the LV to resize, obtained in the previous step.

    For example, to add 10 GiB to the LV at /dev/vg_01/lv01, run sudo lvextend -L +10G /dev/vg_01/lv01.

    A successfully resized message indicates success.

  3. Extend the file system.

    1. Run sudo lsblk -f. Record the FSTYPE and MOUNTPOINT for your LV.

      sudo lsblk -f                                 
      NAME         FSTYPE      LABEL UUID                                   MOUNTPOINT
      vda                                                                   
      ├─vda1                                                                
      ├─vda2       vfat              7938-FA03                              /boot/efi
      └─vda3       ext4        root  33b46ac5-7482-4aa5-8de0-60ab4c3a4c78   /
      vdb          LVM2_member       okx24E-qSjZ-zv9l-lOkm-Pcxu-q6KX-qzRcCu 
      └─vg_01-lv01 xfs               9e2bfe15-074e-4bf5-aac5-62c58299364f   /mnt/lv01
      vdc          LVM2_member       ISeUSM-AhRp-KdNN-7pWJ-HxGW-2AEq-85m9dE 
      └─vg_01-lv01 xfs               9e2bfe15-074e-4bf5-aac5-62c58299364f   /mnt/lv01

      In this example, LV /dev/vg_01/lv01 has file system type xfs and mount point /mnt/lv01.

    2. Extend the file system.

      • For ext2, ext3, or ext4 file systems:

        Replace <logical_volume_path> with the path obtained for the LV.

        sudo resize2fs <logical_volume_path>
        Example: to extend LV lv01 (path /dev/vg_01/lv01), run sudo resize2fs /dev/vg_01/lv01.
      • For xfs file systems:

        Replace <mount_point> with the mount point obtained for the LV.

        sudo xfs_growfs <mount_point>
        Example: to extend the LV mounted at /mnt/lv01, run sudo xfs_growfs /mnt/lv01.
    3. Verify that the file system is extended.

      Run sudo df -Th and verify that the Size column reflects the new LV capacity.

      File systems reserve some capacity for metadata, so the reported size may be slightly smaller than the LV capacity. See Why does the df command show a different disk capacity than purchased?

Billing

Extending an LV may incur the following fees.

  • If you increase the capacity of an existing PV:

    You are billed for the additional disk capacity. The billing method for the added capacity matches that of the original disk.

    • For subscription disks: You are charged a one-time fee for the added capacity, which covers the remainder of your subscription term.

      Price difference = (Monthly price / 30 days) × Remaining duration × Added capacity.

      Remaining duration is measured in days, accurate to the second.
    • For pay-as-you-go disks: The new, higher rate applies from the next billing hour.

  • If you add a new PV:

    You are billed for the new disk as soon as it is created, regardless of whether it is attached to an instance. Charges depend on the disk type and region and may include fees for capacity, provisioned performance, and burst performance.

See Elastic Block Storage billing.

FAQ

  • Why do I get a "404 Not Found" error when installing tools?

    CentOS 6 and Debian 9/10/11 have reached end of life (EOL). Switch the CentOS repository URL or the Debian 9/10/11 repository URL before installing tools.

  • What do I do if I get an Insufficient free space error when extending an LV?

    The capacity added to an LV must not exceed the available space in the VG.

    1. Check the free space in the VG.

      Run sudo vgs and check the VFree column.

      sudo vgs
      VG    #PV #LV #SN Attr   VSize  VFree 
      vg_01   2   1   0 wz--n- 89.99g 10.00g

      In this example, the added capacity cannot exceed 10 GiB.

    2. Allocate all remaining free space to the LV:

      Replace <logical_volume_path> with the path obtained for the LV.

      sudo lvextend -l +100%FREE <logical_volume_path>