Content is empty
If you don't find the content you expect, please try another search term
Last updated:2021-07-21 17:45:42
If the storage space of an EBS volume, either a system disk or data disk, no longer meets your business requirements, you can expand the capacity of the EBS volume. If your KEC instance does not support the online capacity expansion of EBS volumes, you can use the offline capacity expansion feature. After you expand the capacity of an EBS volume offline, you must restart the KEC instance to which the EBS volume is attached. This will interrupt your business. Therefore, we recommend that you perform an offline capacity expansion during off-peak hours. This topic describes how to perform an offline capacity expansion on an EBS volume attached to a KEC instance whose operating system is Linux.
EBS volumes are scalable storage devices. You can expand the capacity of an existing EBS volume at any time to increase its storage space without affecting the data on the EBS volume. After you expand the capacity of an EBS volume in the EBS console, you need to allocate the expanded capacity to partitions. The partitions can be existing partitions or partitions that are newly created and formatted. Then, resize the file systems of the partitions, so that the expanded capacity can be recognized. For more information, see Resize partitions and file systems (Linux).
Note:
The maximum capacity of an EBS volume that uses MBR partitioning is 2 TB. If the capacity exceeds this limit, the excess capacity cannot be used. You may need to expand the capacity of an EBS volume that uses MBR partitioning to more than 2 TB. In this case, we recommend that you create and attach a data disk that uses GPT partitioning and then copy the data to the new disk.
The following table describes the requirements that must be met before an offline capacity expansion is performed on an EBS volume attached to a KEC instance whose operating system is Linux. | Cloud product | Limit |
---|---|---|
KEC instance | 1. The KEC instance must be in the Running or Stopped state. 2. All types, including GPU types, of KEC instances support the offline capacity expansion of EBS volumes. 3. During the offline capacity expansion, the status of the KEC instance cannot be changed. For example, you cannot restart, shut down, or delete the KEC instance. 4. All KEC instances to which SSD volumes of EBS 3.0 or EHDD volumes can be attached support offline capacity expansion. |
|
EBS volume | 1. The EBS volume for which you want to expand the capacity offline must be in the In use or To be mounted state. 2. The EBS volume must be an SSD volume of EBS 3.0 or an EHDD volume. 3. The capacity after the expansion must be greater than the original capacity but cannot exceed the corresponding upper limit. For more information about the upper limits on capacity, see Overview. |
Resource | Description |
---|---|
Operating system | CentOS 8.2 64-bit |
System disk | /dev/vda: uses MBR partitioning and ext4 file systems. You want to expand the capacity of the disk from 50 GB to 70 GB. |
Data disk | /dev/vdb: uses MBR partitioning and ext4 file systems. You want to expand the capacity of the disk from 50 GB to 100 GB. /dev/vdc: uses GPT partitioning and xfs file systems. You want to expand the capacity of the disk from 50 GB to 150 GB. |
Note: To prevent data loss caused by misoperations, we recommend that you create a snapshot to back up data before you expand the capacity of an EBS volume.
Note:
1. After the capacity expansion, if the KEC instance to which the EBS volume is attached is in the Running state, you must restart the KEC instance in the console. If the KEC instance is in the Stopped state, you must start the KEC instance in the console. You can view the expanded capacity of the EBS volume only after you restart the KEC instance in the console or by calling the corresponding API operation.
2. If you want to expand the capacity of a data disk in the To be mounted state, you can perform an offline capacity expansion in the EBS console. After that, attach the disk to a KEC instance. The expanded capacity will be immediately recognized.
3. After you expand the capacity of an EBS volume in the EBS console, the expanded capacity is not available for use yet. You must log in to the operating system of the KEC instance to which the EBS volume is attached, and allocate the expanded capacity by resizing partitions and file systems.
fdisk -l
The following figure shows the output. The following table describes the information extracted from the figure. | EBS volume | Partition | Partition description |
---|---|---|---|
/dev/vda is the system disk with a capacity of 70 GB. | /dev/vda1 | MBR partition, with a capacity of 50 GB | |
/dev/vdb is the data disk with a capacity of 100 GB. | /dev/vdb1 | MBR partition, with a capacity of 50 GB | |
/dev/vdc is the data disk with a capacity of 150GB. | /dev/vdc1 | GPT partition, with a capacity of 50GB |
Note:
If the output shows that the capacity of the EBS volume for which you have expanded the capacity is still the same as the original capacity, the capacity expansion failed. We recommend that you restart the KEC instance in the console.
df -Th
The following figure shows the output. The following table describes the information extracted from the figure. | Partition | File system type | Mount point |
---|---|---|---|
/dev/vda1 | ext3 | Mounted to / | |
/dev/vdb1 | ext4 | Mounted to /mnt/data_disk01 | |
/dev/vdc1 | xfs | Mounted to /mnt/data_disk02 |
yum install gdisk -y
apt-get install gdisk -y
yum install -y cloud-utils-growpart
apt-get install -y cloud-guest-utils
apt-get install -y cloud-utils
growpart /dev/vdb 1
In this example, resize the /dev/vdb1 partition on the /dev/vdb data disk. Separate /dev/vdb and 1 with a space in the command. If you need to resize other partitions, modify the command as needed. The following figure shows the output.
In the operating system of your KEC instance, resize a file system by running one of the following commands based on the type of the file system.
If the type of the file system is in the format of ext*, such as ext4, run one of the following commands based on the type of the EBS volume.
To resize the file system of the /dev/vda1 partition on the /dev/vda system disk, run the following command:
resize2fs /dev/vda1
To resize the file system of the /dev/vdb1 partition on the /dev/vdb data disk, run the following command:
resize2fs /dev/vdb1
The following figures show the output.
Note: In the preceding commands,
/dev/vda1
and/dev/vdb1
are partition names. You must change them based on your business requirements.
xfs_growfs /mnt/data_disk02
The following figure shows the output.
Note:
1.In the preceding command,/mnt/data_disk02
is the mount point of the/dev/vdc1
partition. You must change it based on your business requirements.
2.If you execute the expand file system command, you will get the following prompt:resize2fs 1.42.12 (29-Aug-2014)
Please run'e2fsck -f /dev/vdb1' first .
Please execute the e2fsck -f /dev/vdb1 command first to check the file system.
df -Th
The following figure shows the output. The figure shows that the resizing succeeded. When you check the results, compare the results with the original capacities.
Pure Mode