You need to enable JavaScript to run this app.
Volcengine Kubernetes Engine

Volcengine Kubernetes Engine

Copy page
Download PDF
EBS Volumes
Expanding by using statically provisioned EBS data volumes
Copy page
Download PDF
Expanding by using statically provisioned EBS data volumes
As your business grows and application data expands, you can increase the Elastic Block Storage (EBS) volume capacity to meet increased storage demands. This topic describes the steps of expanding EBS capacity as statically provisioned PersistentVolumes (PV).​
Prerequisites​
  • The csi-ebs add-on has already been upgraded to the latest version.​
  • Obtained the target volume ID to be expanded by using the volumeHandle value (for example, volumeHandle: vol-k10sii****) in the PV's YAML file for the pod.​
  • To avoid data loss caused by expansion failure, we recommend that you back up data in advance. For details, see Using EBS snapshots.​
Procedure​
This topic provides two volume expansion methods: expansion without application interruption and manual expansion with application interruption. You can select one that suits your scenario. The following are detailed descriptions and steps:​
Method 1: Expansion without application interruption​
This method does not restart the application during the storage expansion process, which ensures business continuity. However, if the I/O traffic of the file system is relatively high during expansion, there may be a risk of I/O errors in the file system.​
Step 1: Expand the EBS data volume​
  1. Log in to the Elastic Compute Service (ECS) console. In the left navigation bar, click Storage > Volumes. In the top menu bar, select the region of the target EBS volume.​
  1. On the volume management page, find the target volume and click Extend in the Actions column. Follow the steps of the volume expansion wizard to expand the volume.​
  1. In the Adjust capacity step, configure the New capacity field. Then, click Extend volume.​
tip​
The new capacity cannot be less than the current capacity.​
In this example, the volume vol-k10sii**** is expanded from 100 GiB to 120 GiB.​
  1. In the Attach to Instance step, attach the volume to the instance and click Next step.​
  1. Click Return to the volume list to check the new capacity of the volume. This skips the Partition Disk and Create and Mount File Systems step. ​
Step 2: Expand the file system​
  1. Log in to the ECS instance where the target EBS volume is located. For details, see Logging in to Linux instances.​
  1. (Optional) Run the lsblk -f command as the root user to check whether the target EBS volume has a file system created and a mount point assigned. As shown in the figure below, the vdb has a file system and mount point. If no vdc information is displayed, it does not have a file system.​
​alt​​
If the target EBS volume already has a file system, this step can be skipped. If the target EBS volume does not have a file system, run the following commands in sequence to create a file system for the EBS volume and mount it to a directory.​
​
mkfs.ext4 /dev/vdc # Create an ext4 file system for the EBS volume. /dev/vdc is the EBS device identifier.​
mkdir /mnt/vdc # Create a mount point.​
mount /dev/vdc /mnt/vdc/ # Mount the EBS volume /dev/vdc to the /mnt/vdc/ folder.​
​
  1. Run the following command as the root user to view the status of the EBS volume.​
​
fdisk -l # /dev/vda is the system volume. Volumes like /dev/vdb or /dev/vdc are data volumes. In this example, the target volume to be expanded is a data volume.​
​
As shown in the figure below, the device identifier of the EBS volume expanded to 120 GiB in Step 1 is /dev/vdb. At this time, if you run the df -Th command, the file system is still 100 GiB.​
​alt​​
  1. For example, if the vdb uses the ext4 file system, run the following command to expand the file system capacity.​
​
resize2fs /dev/vdb # /dev/vdb is the device identifier of the target data volume.​
​
As shown in the figure below, the output matches expectations and no error is reported, indicating that the file system expansion was successful.​
​alt​​
  1. Run the following command to view the result of the file system expansion.​
​
df -Th ​
​
As shown in the figure below, the /dev/vdb file system has been expanded to 120 GiB. Now the volume and file system are ready for use.​
​alt​​
Method 2: Manual expansion with application interruption​
This method suspends disk I/O and makes file system expansion more secure. However, your application will experience a short downtime. Therefore, evaluate whether your business can tolerate this downtime before you perform this type of expansion.​
Step 1: Delete the application pod​
  1. Suspend the application by deleting the StatefulSet or setting the number of replicas to 0. This scenario uses a MySQL application as an example. You can execute the following command to adjust the pod replica count to 0.​
​
kubectl scale sts mysql --replicas=0​
​
Expected output:​
​
statefulset.apps/mysql scaled​
​
  1. Run the following command to check whether the pod has been deleted. No output indicates that the MySQL application has been deleted.​
​
kubectl get pod | grep mysql​
​
Step 2: Expand the EBS data volume​
  1. Log in to the ECS console. In the left navigation bar, click Storage > Volumes. In the top menu bar, select the region of the target EBS volume.​
  1. On the volume management page, find the target volume and click Extend in the Actions column. Follow the steps of the volume expansion wizard to expand the volume.​
  1. In the Adjust capacity step, configure the New capacity field. Then, click Extend volume.​
tip​
The new capacity cannot be less than the current capacity.​
In this example, the volume vol-k10sii**** is expanded from 100 GiB to 120 GiB.​
  1. In the Attach to Instance step, attach the volume to the instance and click Next step.​
  1. Click Return to the volume list to check the new capacity of the volume. This skips the Partition Disk and Create and Mount File Systems step. ​
Step 3: Expand the file system​
  1. Log in to the ECS instance where the target EBS volume is located. For details, see Logging in to Linux instances.​
  1. (Optional) Run the lsblk -f command as the root user to check whether the target EBS volume has a file system created and a mount point assigned. As shown in the figure below, the vdb has a file system and mount point. If no vdc information is displayed, it does not have a file system.​
​alt​​
If the target EBS volume already has a file system, this step can be skipped. If the target EBS volume does not have a file system, run the following commands in sequence to create a file system for the EBS volume and mount it to a directory.​
​
mkfs.ext4 /dev/vdc # Create an ext4 file system for the EBS volume. /dev/vdc is the EBS device identifier.​
mkdir /mnt/vdc # Create a mount point.​
mount /dev/vdc /mnt/vdc/ # Mount the EBS volume /dev/vdc to the /mnt/vdc/ folder.​
​
  1. Run the following command as the root user to view the status of the EBS volume.​
​
fdisk -l # /dev/vda is the system volume. Volumes like /dev/vdb or /dev/vdc are data volumes. In this example, the target volume to be expanded is a data volume.​
​
As shown in the figure below, the device identifier of the EBS volume expanded to 120 GiB in Step 1 is /dev/vdb. At this time, if you run the df -Th command, the file system is still 100 GiB.​
​alt​​
  1. For example, if the vdb uses the ext4 file system, run the following command to expand the file system capacity.​
​
resize2fs /dev/vdb # /dev/vdb is the device identifier of the target data volume.​
​
As shown in the figure below, the output matches expectations and no error is reported, indicating that the file system expansion was successful.​
​alt​​
  1. Run the following command to view the result of the file system expansion.​
​
df -Th ​
​
As shown in the figure below, the /dev/vdb file system has been expanded to 120 GiB. Now the volume and file system are ready for use.​
​alt​​
Step 4: Restart the application​
  1. Run the following command to adjust the pod replica count to 2.​
​
kubectl scale sts mysql --replicas=2​
​
Expected output:​
​
statefulset.apps/mysql scaled​
​
  1. Run the following command to check whether the pod has been restored. The following expected output shows that the MySQL application has been restored.​
​
kubectl get pod | grep mysql​
​
Expected output:​
​
NAME READY STATUS RESTARTS AGE​
mysql-0 1/1 Running 0 74s​
mysql-1 1/1 Running 0 42s​
​
  1. Execute the following command to view the file system size. The following expected output shows that the storage capacity of the /dev/vdb file system is 120 GiB.​
​
kubectl exec mysql-0 -- df /data​
​
Expected output:​
​
Filesystem 1K-blocks Used Available Use% Mounted on​
/dev/vdb 12330192 180114 123084512 1% /data​
​
Related documentation​
For more information on EBS volume expansion, see Expanding EBS capacity.​
​
Last updated: 2026.07.24 10:53:31