This topic describes how to resize a disk online or offline. After you resize a disk online, you do not need to restart the associated instance. After you resize a disk offline, you must restart the associated instance.
Scenario
Prerequisites
- The instance to which the disk is attached meets the following requirements:
- If you want to resize the disk online, the instance is in the Running (Running) state. Note Instances that use early instance types do not support online resizing of disks. For more information, see the FAQ section of this topic.
- If you want to resize the disk offline, the instance is in the Running (Running) or Stopped (Stopped) state.
- If you want to resize the disk online, the instance is in the Running (Running) state.
- The disk meets the following requirements:
- The disk is in the In Use (In Use) or Unattached (Unattached) state. After the disk is resized in the ECS console, you must extend the partitions and file systems of the disk from the operating system of the instance. If the disk is in the Unattached state, attach the disk to an instance.
- The disk can be an enhanced SSD (ESSD), ESSD AutoPL disk, standard SSD, or ultra disk.
Procedure
- Optional: Create snapshots for the disk that you want to resize to back up data. For more information, see Create a snapshot of a disk.Note You are charged for using snapshots. For more information, see Snapshots.
- Go to the Cloud Disk tab on the Instance Details page.
- Log on to the ECS console.
- In the left-side navigation pane, choose .
- In the top navigation bar, select the region where the ECS instance is located.
- Find the instance to which the disk is attached and click the ID of the instance.
- On the Instance Details page, click the Cloud Disk tab.
- Find the disk and choose Actions column. in the To batch resize disks, log on to the ECS console by using your Alibaba Cloud account and choose Resize in the lower part of the page.in the left-side navigation pane. On the Disks page, select the disks that you want to resize and clickNote
- You can use only Alibaba Cloud accounts instead of RAM users to batch resize disks. To batch resize disks, log on to the ECS console by using your Alibaba Cloud account.
- Disks that are attached to the same instance cannot be batch resized.
- In the Determine Disk and Read Notes step, click I Understand Risks and Back Up Data. Proceed.
- In the Configure Resizing Method and New Size step, configure parameters.
- In the Confirm Resizing Results step, click Next Step: Extend Partitions and File Systems when Successful is displayed in the Resizing Result column.
- Optional:This step applies only to offline resizing. In the Extend Partitions and File systems step, click Restart Instance to restart the instance to which the disk is attached for the resize operation to take effect. Important If you run the
reboot
command within the instance to restart the instance, the resize operation cannot take effect. - View the partition information of the disk and select a method to extend the partitions and file systems based on the actual scenario.
- Documentation: Connect to the instance and use the CLI within the operating system to extend partitions and file systems.
For more information, see Extend the partitions and file systems of disks on a Linux instance or Extend the partitions and file systems of a disk on a Windows instance.
- Cloud Assistant: You do not need to connect to the instance. Use Cloud Assistant in the ECS console to send remote commands to the instance to extend partitions and file systems. Important When you use Cloud Assistant, take note of the following limits:
- Cloud Assistant is applicable to only specific users. If you can use Cloud Assistant, you are presented with the Cloud Assistant page in the ECS console.
- Cloud Assistant commands can be run only on specific operating systems. For more information, see Overview.
- You must first install Cloud Assistant on the ECS instance before you can use Cloud Assistant to extend partitions and file systems in the ECS console. For more information, see Install Cloud Assistant Agent.
Click Run Preceding Command. In the Send Remote Commands dialog box, click Run. The system runs the command to extend partitions and file systems.
Note If you use Logical Volume Manager (LVM) to manage your disk partitions, you must use LVM to extend the partitions and file systems after you resize your disk in the ECS console. For more information, see Extend an LV by using LVM. - Documentation: Connect to the instance and use the CLI within the operating system to extend partitions and file systems.
FAQ
What do I do if I have resized a disk offline but do not want to restart the instance?
The offline disk resize operation takes effect only after you start or restart the instance. If you have resized a disk offline but cannot start or restart the instance due to your business requirements, you can resize the disk online again to make the offline resize operation take effect when the instance is in the Running state. You are charged for resizing the disk online. You must resize the disk based on your business requirements.
For example, assume that you have resized a disk of an instance to 60 GiB in the ECS console, but you do not want to restart the instance, the disk resizing does not take effect. You can resize the disk online again in the ECS console. For example, you can resize the disk to 61 GiB. After the disk is resized, you can see that the capacity of the disk is resized to 61 GiB in the operating system.
What do I do if the resize operation does not take effect on a disk for which the multi-attach feature is enabled?
- Detach the disk. For more information, see Detach a data disk.
- Re-attach the disk. For more information, see Attach a data disk.
- Optional: If the new capacity is still not identified after the disk is re-attached, we recommend that you restart the instances. For more information, see Restart instances.
Which instance types do not support online resizing of disks?
- ecs.ebmc4.8xlarge
- ecs.ebmhfg5.2xlarge
- ecs.ebmg5.24xlarge
- ecs.t1
- ecs.s1
- ecs.s2
- ecs.s3
- ecs.c1
- ecs.c2
- ecs.m1
- ecs.m2