All Products
Search
Document Center

Elastic Compute Service:Re-initialize a data disk

Last Updated:Feb 14, 2026

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.

Warning

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

  • 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, but the data, partitions, and file system from the snapshot are retained. * If the data disk was created as an empty disk: The data disk is reset to its initial state with no data, partitions, or file system. You must re-initialize it as described in Initialize a data disk on a Windows instance.

Impact on Linux instances

  • 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, but the data, partitions, and file system from the snapshot are retained.

  • If the data disk was created as an empty disk: The data disk is reset to its initial state with no data, partitions, or file system. You must re-initialize it as described in Initialize a data disk (Linux).

Procedure

Step 1: Make preparations

  1. 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.

    Note

    Using snapshots incurs fees. For more information, see Snapshot billing.

  2. Ensure the data disk is attached to an ECS Instance. For instructions, see Attach a data disk.

  3. 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.

    To determine whether the old version of the instant access feature is enabled for a snapshot, use the following method:

    • New version: In the snapshot list, the Instant Access status is Enabled.image.png

    • Legacy version: In the snapshot list, the Instant Access status shows an expiration date, such as Oct 20, 2023, 11:07:07 Remaining Before Expiration.image.png

    Note

    If you are using legacy Instant Access, you can disable it using the DisableInstantAccess parameter in the ModifySnapshotAttribute operation.

  4. (Conditionally required) If you have a Linux ECS Instance and have added a command in the /etc/fstab file 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:

    1. Connect to the Linux instance.

    2. Run the command vim /etc/fstab.

    3. Press the I key to enter Insert mode.

    4. 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 0
      Note

      In this example, /dev/vdb1 is the data disk partition and /mnt is the mount point. You must modify these values to match your actual configuration.

    5. Press the Esc key to exit edit mode, then enter :wq to save your changes and exit.

  5. Stop the ECS instance. For more information, see Stop an instance.

    Important

    If 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.

  6. 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

Warning

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.

  1. Go to ECS console - Instances.

  2. In the top navigation bar, select the region and resource group of the resource that you want to manage. Region

  3. Find the ECS Instance whose data disk you want to re-initialize and click the instance ID to go to the Instance Details page.

  4. Click the Block Storage tab, find the data disk you want to re-initialize, and in the Actions column, click Re-initialize Disk.

    重新初始化云盘

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

    截屏2024-12-11 18

    The re-initialization is complete when the cloud disk status changes back to In Use.

  6. After the re-initialization is complete, click Start to start the ECS instance.

  7. 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.