When a cloud disk is attached to an Elastic Compute Service (ECS) instance, you can re-initialize the data disk to restore it to its state at the time of creation. This topic explains how to re-initialize a data disk.
Limitation
If your data disk was created from a snapshot, after the snapshot is deleted or unshared, you can continue to use the disk. However, you cannot re-initialize the disk.
Impacts
Before you proceed, you must understand the following consequences.
Re-initializing a data disk permanently erases all data added after its creation. To prevent permanent data loss, create a snapshot to back up the data disk before proceeding. For instructionsn, see Create a snapshot manually.
Item | Description |
Impact on Windows instances |
|
Impact on Linux instances |
|
Procedure
Step 1: Make preparations
Re-initializing a data disk erases all its data. To prevent data loss, create a snapshot to back up your data before proceeding. For instructions, see Create a snapshot manually.
NoteUsing snapshots incurs fees. For more information, see Snapshot billing.
Ensure the data disk is attached to an ECS Instance. For instructions, see Attach a data disk.
Ensure that legacy Instant Access is not enabled for your Enterprise SSD (ESSD) cloud disk. Re-initialization is not supported if a snapshot of the cloud disk has legacy Instant Access enabled. The new version of Instant Access is enabled by default and does not affect the re-initialization operation.Check the snapshot list to determine which version of Instant Access is in use.
(Conditionally required) If you have a Linux ECS Instance and have added a command in the
/etc/fstabfile to automatically mount a data disk partition at startup, the ECS Instance may fail to start after re-initialization. To prevent startup errors, comment out the auto-mount command in/etc/fstab. Follow these steps:Run the command
vim /etc/fstab.Press the
Ikey to enter Insert mode.Find the mount entry for the data disk partition and add a
#at the beginning of the line to comment it out.# /dev/vdb1 /mnt ext4 defaults 0 0NoteIn this example,
/dev/vdb1is the data disk partition and/mntis the mount point. You must modify these values to match your actual configuration.Press the
Esckey to exit edit mode, then enter:wqto save your changes and exit.
Stop the ECS instance. For more information, see Stop an instance.
ImportantIf an ECS instance uses the pay-as-you-go billing method and resides in a VPC, you must enable the standard mode when you stop the instance. If you enable the economical mode, you may be unable to start the instance after you re-initialize the disks attached to the instance.
Ensure the ESSD cloud disk does not have multi-attach enabled. Re-initialization is not supported for data disks with multi-attach enabled, see Multi-attach for cloud disks.
Step 2: Re-initialize the disk
Re-initializing a data disk permanently erases all data added after its creation. To prevent permanent data loss, create a snapshot to back up the data disk before proceeding. For instructions, see Create a snapshot manually.
-
Go to ECS console - Instances.
-
In the top navigation bar, select the region and resource group of the resource that you want to manage.
Find the ECS Instance whose data disk you want to re-initialize and click the instance ID to go to the Instance Details page.
Click the Block Storage tab, find the data disk you want to re-initialize, and in the Actions column, click Re-initialize Disk.

In the Re-initialize Disk dialog box, read the notes and click Confirm.

The re-initialization is complete when the cloud disk status changes back to In Use.
After the re-initialization is complete, click Start to start the ECS instance.
Select subsequent operations based on the ECS instance type.
Linux instance
If the data disk was created as an empty disk: After re-initialization, the data disk is reset to its initial state with no data, partitions, or file system. You must initialize the data disk before you can use it. For instructions, see Initialize a data disk (Linux).
If the data disk was created from a snapshot: After re-initialization, you must mount the file system again. All data added after the data disk was created is lost, but the data, partitions, and file system from the snapshot are retained.
Windows instance
If the data disk was created as an empty disk: The data disk's file system and all its content are erased. You must re-initialize it as described in Initialize a data disk on a Windows instance.
If the data disk was created from a snapshot: The data disk is restored to the state of the original snapshot. You must mount the file system again. All data added after the data disk was created is lost.
After re-initializing the data disk, you must redeploy your services, including applications and configurations, to resume service.