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 I/O optimized and in the Running (Running) state.
- If you want to resize the disk offline, the instance is in the Running (Running) or Stopped (Stopped) 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.
- On the Resize Disks page, select Online Resizing and set the Size after Resize parameter.
- Online Resizing: the default recommended resize method. After a disk is resized online, the instance does not need to be restarted for the resize operation to take effect.
- Offline Resizing: Clear Online Resizing in the Resizing Method column to use the offline resize method. After a disk is resized offline, the instance must be restarted for the resize operation to take effect. Note
- If business deployed on instances does not support instance restarts, use the online resize method.
- If your instance is in the Stopped state or if your instance uses an earlier instance type that does not support online resizing, use the offline resize method.
The specified value of Size after Resize must be greater than the current capacity. - Read and select ECS Service Terms, confirm the price, and then click Confirm.
- Read the notes, click I have read the notes. Resize, and then complete the payment.
- If you resize the disk online, go to the Disks page to check whether the disk is resized.
- If you resize the disk offline, proceed to the next step to restart the instance.
- Optional: Start or restart the instance. This step is applicable to only offline resizing. After you resize the disk offline, you must start or restart the instance by using the ECS console or by calling API operations for the new capacity to take effect.Important If you run the
reboot
command within the instance to restart the instance, the restart operation cannot take effect. - Extend the partitions and file systems of the disk. After you resize the disk in the ECS console, the new capacity cannot be used. You must extend the partitions and file systems of the disk within the instance by using the new capacity to extend an existing partition or to create additional partitions. 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.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 Resize an LV by using LVM.
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.