All Products
Search
Document Center

Elastic Compute Service:Re-initialize a system disk

Last Updated:May 15, 2026

Re-initialize a system disk to restore it to its initial state and erase all data on it.

Limitations

If a custom image is deleted, instances created from it remain usable, but their system disks cannot be re-initialized.

Effects of re-initialization

Understand the following effects before re-initializing the disk.

Important

Re-initializing a system disk erases all data on it. To prevent data loss, create a snapshot to back up the disk beforehand.

Item

Description

System disk effects

  • Re-initialization restores the system disk to its initial state and erases all data.

    Note

    If you replaced the system disk before re-initialization, the operation applies to the new system disk.

  • Automatic snapshot policies configured for the system disk remain in effect after re-initialization.

  • Re-initialization does not change the IP address or disk ID of the instance.

  • Re-initialization does not delete existing snapshots of the system disk.

Data disk effects

  • Re-initialization does not change or erase data on attached data disks.

  • For Linux instances: Re-initialization removes automatic mount configurations for data disks. You must re-mount the file systems.

  • For Windows instances: No action is required for data disks.

Procedure

Prepare for re-initialization

  1. Re-initialization erases all written data. To prevent data loss, back up the target disk. See Manually create a single snapshot.

    Note

    Snapshots are a paid service. See Snapshot billing.

  2. The legacy instant access feature must not be enabled for snapshots of ESSD disks. You cannot re-initialize a disk if its snapshots have legacy instant access enabled. The new version of instant access is enabled by default and does not affect re-initialization.

    Check the instant access version in the snapshot list:

    • New version: Instant access status shows Enabled.image.png

    • Legacy version: 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 the legacy version, call ModifySnapshotAttribute and set DisableInstantAccess to true to disable it.

  3. (Linux only) To use an SSH key pair for authentication after re-initialization, create or import an SSH key pair first.

  4. (Linux only) To reuse the same mount points after re-initialization, record the current mount information for your data disks:

    sudo mount |grep "<Data disk name>"

    For example, the output for data disk /dev/vdb shows two partitions: /dev/vdb has partitions /dev/vdb1 mounted to /tmp and /dev/vdb2 mounted to /mnt.

    [ecs-user@ecs ~]$ sudo mount |grep "/dev/vdb"
    /dev/vdb1 on /tmp type ext4 (rw,relatime)
    /dev/vdb2 on /mnt type ext4 (rw,relatime)
  5. Stop the instance. 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.

Re-initialize the disk

Important

Re-initialization erases all data on the system disk. To prevent data loss, create a snapshot to back up the disk beforehand.

  1. Go to ECS console - Instances.

  2. In the upper-left corner of the page, select a region and resource group.地域

  3. Find the target instance and click its ID to go to the Instance Details page.

  4. Click the Block Storage tab, find the system disk, and click Re-initialize Disk in the Actions column.

    Re-initialize system disk

  5. In the Re-initialize Disk dialog box, configure the parameters.

    Configure parameters

    Parameter

    Description

    Logon Username

    The username for OS logon.

    Logon Credential

    For Windows instances, reset the logon password. You can reuse the old password or specify a new one.

    For Linux instances, select Key Pair or Password.

    • Key Pair: Bind an SSH key pair for logon.

    • Password: Reset the logon password. You can reuse the old password or specify a new one.

    Security Hardening

    Activate is selected by default. This installs the free Security Agent, which provides backdoor detection, unusual logon alerts, and brute-force attack prevention.

    Instance Startup Policy

    Start Instance After Re-initializing Disk is selected by default. The instance starts automatically after re-initialization. Clear this option to start the instance manually.

  6. Click OK. The disk status changes to Initializing.

    Re-initialization is complete when the disk status returns to In Use.

  7. (Linux only) If the instance has data disks attached, re-mount them. Re-initialization does not change or erase data disk content, but mount information is lost. See How do I re-attach data disks after I re-initialize the system disk of a Linux instance?

    For Windows instances, data disks come online automatically after re-initialization.
  8. Redeploy your applications and configurations to restore your services.

FAQs