All Products
Search
Document Center

Elastic Compute Service:Data protection and recovery FAQ

Last Updated:Jun 11, 2026

Data protection

Snapshot size

Snapshot billing

Snapshot retention and storage

Automatic snapshot policies

Data recovery

Other

Appendix

System disk replacement

Before you replace a system disk, we recommend that you create a snapshot to back up your data. You must also ensure that the system disk has at least 1 GiB of reserved space. Otherwise, the instance may fail to start after the system disk is replaced.

For system disk prices, see the Elastic Compute Service pricing page.

Preventing data loss

In high-risk scenarios, create a snapshot to back up your data. Such scenarios include modifying critical system files, performing routine data backups, recovering a mistakenly released instance, preventing network attacks, replacing an operating system, providing data for a production environment, and performing other high-risk operations. If an error occurs, you can roll back the disk to mitigate risks. For more information, see Manually create a single snapshot and Roll back a disk by using a snapshot.

Can I create snapshots for local disks?

No. We recommend that you implement data redundancy at the application layer or create a deployment set for your cluster to improve application availability. For more information, see Local disks.

Deleting files and space usage

No. Deleting a file only adds a marker to its header; this operation does not reduce the amount of space used on the disk.

Snapshot size larger than file system data

  • Symptom: You delete files in an Elastic Compute Service (ECS) instance and then create a snapshot. You find that the snapshot size has not decreased, or the snapshot is larger than the disk space usage reported by the file system.

  • Cause: Operations such as formatting a file system, deleting files, and writing data reduce the number of empty blocks on a disk. This reduces the ability to eliminate empty blocks when a snapshot is created. This results in a snapshot size larger than the data displayed in the file system. The inconsistency between the file system size and the snapshot size may be caused by the following reasons:

    • The metadata of the file system occupies disk space.

    • During initialization, a large number of data blocks are written to the file system. These write operations occupy disk space. A block is a logical unit of storage. Elastic Block Storage divides the logical block addresses (LBAs) on a disk into these equally sized blocks.

    • To reduce performance overhead, the file system only creates a deletion marker in the file properties when a file is deleted. The disk is unaware of the delete instruction. Therefore, the data blocks remain in an allocated state and are copied to the snapshot. This causes the snapshot size to be larger than the file system size.

    • Modules such as Virtio-block for KVM virtualization drivers and Block-front for Xen do not support the TRIM command. The TRIM disk I/O command indicates that a data segment is no longer in use and can be deleted. Without it, the disk remains unaware that the data has been deleted.

Viewing snapshot prices by region

Go to the ECS Pricing Details page and click the Pricing tab. On the Snapshot tab, you can view the unit prices of snapshots in different regions.

image

Differences between OSS resource plans and SCUs

  • OSS resource plan: An Object Storage Service (OSS) resource plan is a subscription resource plan. It includes various types, such as storage plans and data transfer plans. For more information, see Resource plans.

  • Storage Capacity Unit (SCU): An SCU is a subscription resource plan that can be used to offset the storage fees of various storage products, such as disks, snapshots, and Object Storage Service (OSS). After you purchase an SCU, it automatically offsets the pay-as-you-go bills for disks and snapshots in the same region. If the actual capacity of your disks and snapshots exceeds the SCU capacity, the excess usage is automatically billed on a pay-as-you-go basis. For more information, see Storage Capacity Unit (SCU).

What billing methods are used for snapshots?

The fees that you may incur for using snapshots include snapshot storage fees and snapshot replication traffic fees. By default, the pay-as-you-go billing method is used. You can purchase a Storage Capacity Unit (SCU) to offset snapshot storage fees. However, these plans cannot be used to offset snapshot replication traffic fees. For more information, see Snapshot billing .

Is there a free quota for snapshots?

For regions outside the Chinese mainland, Alibaba Cloud provides a free quota of 5 GB for snapshots. You are charged for any usage that exceeds this quota. For more information about snapshot billing, see Snapshot billing.

Charges for enabling snapshots

Enabling the snapshot service is free. After you create a snapshot, you are billed based on the snapshot size.

Charges for automatic snapshot policies

Automatic snapshot policies are free, but you are charged for the snapshots they create. All snapshots, whether automatic or manual, incur charges. For more information, see Snapshot billing.

Charges for snapshot-consistent groups

A snapshot-consistent group is free of charge, but you are charged for the capacity of the individual disk snapshots that it contains. For more information, see Snapshot billing.

Snapshot retention after disk deletion

Automatic snapshots are no longer created

When your disk reaches its snapshot quota, the system deletes the oldest automatic snapshot to make room for a new one. Manual snapshots are unaffected.

Note

An automatic snapshot policy executes only when the disk is attached to an instance.

Snapshot loss during disk re-initialization

No. Re-initializing a disk does not delete its manual or automatic snapshots.

Snapshot loss during system disk replacement

Manual snapshots of the previous system disk are retained. If automatic snapshots are configured to be released with the disk, they are deleted.

Note

When you replace a system disk, the disk ID changes. Snapshots of the previous system disk cannot be used to roll back the new system disk.

Downloading or exporting snapshots

No. You cannot directly download or export snapshots. Instead, first create a custom image from a snapshot and then export the custom image.

Note

Limits apply when you export custom images. First, confirm whether the image created from the snapshot meets the export requirements.

Viewing data in a snapshot

You cannot directly view data in a snapshot. You can view the data stored in a snapshot by using one of the following methods:

Storing custom images from snapshots in OSS

No. A custom image cannot be directly stored in an OSS bucket. You can export the custom image created from the snapshot to an OSS bucket that you specify, and then download and use it from the OSS bucket. For more information, see Export a custom image.

Preventing automatic snapshot deletion

  • A snapshot's retention period determines whether it is deleted.

    When you manually create a snapshot or create an automatic snapshot policy, you can choose to retain it permanently or for a custom number of days. A snapshot is automatically deleted by the system after its retention period expires. You can extend the retention period of manual and automatic snapshots as needed. For more information, see Extend the retention period of a snapshot.

  • Automatic snapshots are deleted before their expiration dates if the Delete automatic snapshots along with the disk property is enabled and the associated disk is released (manually, with an instance, or due to a system disk replacement). You can disable the Delete automatic snapshots along with the disk property to prevent the snapshots from being deleted when the disk is released. For more information, see Set whether to release automatic snapshots with disks.

Snapshot deletion after disk or instance operations

Scenario

Replace system disk

Release instance

Release disk

Manual snapshot

Not affected.

Automatic snapshot

  • If the Delete Automatic Snapshots While Releasing Disk attribute is enabled for the old system disk, the automatic snapshots are released with the disk.

  • If the Delete Automatic Snapshots While Releasing Disk attribute is disabled for the old system disk, the automatic snapshots are retained based on the retention period of the snapshot policy.

  • The automatic snapshot policy for the old system disk becomes invalid and needs to be reset.

If both the Release Disk with Instance and Delete Automatic Snapshots While Releasing Disk attributes are enabled, the disk is released with the instance, and the automatic snapshots are released with the disk.

  • If the Delete Automatic Snapshots While Releasing Disk attribute is enabled, the automatic snapshots are released with the disk.

  • If the Delete Automatic Snapshots While Releasing Disk attribute is disabled, the automatic snapshots are retained according to the retention period of the snapshot policy.

Deleting snapshots used by images or disks

  • You can force delete a snapshot that was used to create a disk. After you delete the snapshot, you can no longer perform operations that depend on the data state of the original snapshot, such as re-initializing a disk.

  • For a snapshot that was used to create a custom image, you must delete the image before you can delete the snapshot.

For more information, see Delete a snapshot.

Error when deleting an associated snapshot

Your snapshot was used to create a custom image. You must delete this custom image before you can delete the snapshot. For more information, see Delete a custom image.

Snapshot policy execution with derived images or disks

No. You can associate an existing automatic snapshot policy with a disk. After the association, Alibaba Cloud automatically creates snapshots for the disk at the time points or intervals specified in the policy. This does not prevent the automatic snapshot policy from running.

Applying multiple snapshot policies to a disk

By default, only one policy can be bound to a single disk. To bind multiple policies, see Apply an automatic snapshot policy to disks.

When you create an automatic snapshot policy and set the retention period to Permanently Retained, can the snapshots be deleted?

Yes, you can.

  • If you no longer need a snapshot, you can manually delete it. For more information, see Delete a snapshot.

  • You can also enable the Delete Automatic Snapshots While Releasing Disk attribute. When you release the disk, its automatic snapshots are also deleted.

Data disk disappears after restart or re-initialization

  • Symptom: After a Linux instance is rebooted or re-initialized, you log in to the instance and run the df -h command to check disk mount points, only to find that the data disk is missing.

  • Cause:

    • Restarting the instance: If you did not write the mount information to /etc/fstab before restarting the instance, the instance does not automatically mount the data disk after the restart.

    • Re-initializing the system disk: Re-initializing the system disk resets the /etc/fstab file. The instance does not automatically mount the data disk after the system disk is re-initialized.

  • Solution:

    This solution uses the /dev/xvdb1 partition of a non-I/O optimized instance as an example. For a data disk attached to an I/O optimized instance that does not use the NVMe protocol, the disk device name is /dev/vd[b-z]. For a data disk attached to an I/O optimized instance that uses the NVMe protocol, the disk device name is /dev/nvmeXn1. Perform the operations based on your actual scenario.

    1. Run the mount /dev/xvdb1 command to remount the data disk.

    2. Run the mount command to view the file system type of the /dev/xvdb1 data disk partition.

    3. Assuming that the /dev/xvdb1 partition uses the ext3 file system, run the following command to write the data disk mount information to the /etc/fstab file.

      echo '/dev/xvdb1 /data ext3 defaults 0 0' >> /etc/fstab
    4. In the console, restart the ECS instance.

Partitions after rolling back a re-partitioned disk

A disk rollback restores the disk to the state at the time the snapshot was created. If the disk had not been re-partitioned at that time, it does not have multiple partitions after the rollback.

Disk rollback error: "instance must be stopped"

  • Symptom: When you roll back a disk, you receive the error message "To roll back the disk, you must stop the instance. Make sure that no snapshots are being created for the disk and that you have not changed the operating system."

  • Cause: This error is usually caused by an incorrect disk property or disk status.

  • Solution: You can troubleshoot the issue based on the instance status and related snapshot tasks.

    • Check whether the instance is stopped.

      You can only roll back a disk for a stopped instance. You can view the instance status on the Instances page in the console.

    • Check if the system disk of the instance associated with the snapshot has been replaced.

      If the operating system is replaced, the instance's system disk is automatically re-created from the new image, and the system disk ID changes. Therefore, the original snapshots of the instance can no longer be used for rollback. However, you can create a custom image from a snapshot and then replace the system disk with that custom image to restore the instance to the state of the snapshot. For more information, see Create a custom image from a snapshot and Replace the operating system (replace the system disk).

    • Check whether a snapshot is being created for the disk.

      To ensure data consistency, you cannot perform a rollback operation if a snapshot task is in progress for the disk. On the Instance Details page, click the Snapshot tab and check whether there are any snapshot tasks where the Progress is not 100% and the Status is Processing.

      To perform the disk rollback sooner, you can stop the snapshot creation task by selecting the snapshot and clicking Delete Snapshot.

Restoring data from a snapshot after instance release

After an ECS instance is released, you can use the following methods to quickly restore its data:

  1. Create a custom image from a snapshot.

  2. Create an instance from a custom image or a shared image.

  3. Connect to the new ECS instance, check whether the data is fully restored, and then copy or further process the data.

    Important

    Creating a new instance may incur compute and storage fees. We recommend that you release the instance as soon as the data recovery is complete to avoid additional charges.

Using old system disk snapshots for rollback

No.

Note

You can use a historical snapshot to create a new pay-as-you-go disk and then attach it to an ECS instance for data recovery. After data recovery is complete, we recommend that you release the disk in a timely manner. For more information, see Create a data disk from a snapshot, Attach a data disk, and Release a disk.

Rolling back a disk to a different instance

No. To roll back a disk by using a snapshot, you must roll it back to the original instance. However, you can use the snapshot of the previous data disk to create a new disk and attach it to the new instance. For more information, see Create a data disk from a snapshot and Attach a data disk.

Reasons for disk rollback failure

You can check the snapshot status based on the error message received during the disk rollback. For common issues and solutions, see the disk rollback questions in Elastic Block Storage FAQ.

Using data disk snapshots to create custom images

No. The disk that corresponds to the snapshot used to create a custom image must be a system disk.

How to quickly recover data from a snapshot after an ECS instance is released

After an ECS instance is released, you can quickly recover data as follows:

  1. Create a custom image from a snapshot.

  2. Create an instance from a custom image or a shared image.

  3. Remotely connect to the new ECS instance, verify that the data is fully recovered, and then copy or process it further.

    Important

    Creating a new instance may incur compute and storage fees. After the data recovery is complete, release the instance as soon as possible to avoid additional charges.

Re-attaching a data disk after system re-initialization

In a Linux instance, re-initializing the system disk does not change the content of the data disk, but the mount information for the data disk is lost. Assume that before the system disk was re-initialized, the data disk partition attached to the instance was named /dev/vdb1 and the mount point was named /InitTest. After restarting the Linux instance, follow these steps to create a new mount point and mount the data disk partition.

  1. Run the mount command to view the mount information of the data disk.

    The result does not contain information about /dev/vdb1.

  2. Run fdisk -l to view the data disk partition information.

  3. Run cat /etc/fstab to check the data disk partition /dev/vdb1 for its original mount point name.

  4. Run mkdir /InitTest to recreate the mount point for the data disk partition.

    The new mount point must be the same as the mount point of /dev/vdb1 before the system disk was re-initialized.

  5. Run mount /dev/vdb1 /InitTest to remount the data disk partition.

  6. Run df -h to check the mount result.

  7. Follow these steps to check whether the /dev/vdb1 data disk can be automatically mounted.

    1. Run the umount /dev/vdb1 command to unmount /dev/vdb1.

    2. Run mount to view the mount information.

      If the unmount is successful, the result does not contain information about /dev/vdb1.

    3. Run mount -a to automatically mount /dev/vdb1.

    4. Run mount to view the mount information.

      If the automatic mount is successful, the result contains information about /dev/vdb1.

Differences between manual and automatic snapshots

Manual and automatic snapshots are essentially the same. They are both a complete copy of a disk's data at a specific point in time. However, they have the following differences:

  • Creation method

    • Manual snapshots must be created manually. You can go to the snapshot or disk page, customize the snapshot parameters as needed, and manually create a snapshot for a disk. For more information, see Manually create a single snapshot.

    • Automatic snapshots rely on an automatic snapshot policy. After you create and enable an automatic snapshot policy, Alibaba Cloud automatically creates snapshots for the disk at the time points or intervals specified in the policy. For more information, see Create an automatic snapshot policy.

  • Snapshot source

    In the snapshot list, you can view the source of manual and automatic snapshots:

    • The Snapshot Source of an automatic snapshot is Automatic Snapshot.

    • The Snapshot Source of a manual snapshot is Manual Snapshot.

  • Snapshot name

    • The name of a manual snapshot is customized when the snapshot is created.

    • The name of an automatic snapshot starts with auto2.0 and follows the format auto2.0_yyyyMMdd_SnapshotPolicyId, where:

      • auto2.0: Indicates an automatic snapshot, distinguishing it from a manual snapshot.

      • yyyyMMdd: The date the snapshot was created, where y is the year, M is the month, and d is the day.

      • SnapshotPolicyId: The ID of the automatic snapshot policy corresponding to the snapshot.

Note

The following constraints apply when you use manual and automatic snapshots:

  • ESSD-series disks (ESSD, ESSD AutoPL, ESSD Entry, and Zone-redundant ESSD)

    A single disk supports the concurrent creation of both manual and automatic snapshots. However, there is a limit on the maximum number of concurrent snapshot creations. For more information, see Snapshot limits. If the number of concurrent snapshots being created for a disk reaches the limit, subsequent concurrent snapshot creation requests fail.

  • Legacy disks (standard SSDs, ultra disks, and basic disks)

    • Concurrent creation of manual and automatic snapshots is not supported.

    • At the time of an automatic snapshot creation, if a snapshot creation task (manual or automatic) is already in progress for the disk, the system does not create an automatic snapshot at that time. It creates the automatic snapshot at the next scheduled time.

    • If an automatic snapshot creation task is in progress for a disk, you must wait for it to complete before you can manually create a snapshot.

Changing a snapshot name

  1. Go to ECS console - Snapshots.

  2. Hover the mouse pointer over the snapshot name, click the icon shown in the figure, change the name, and then click OK.image

Relationship between file systems, disks, and snapshots

You create a file system on a disk partition. The file system manages the disk space, and its management operations are ultimately converted into disk I/O requests. The disk records the status of data blocks and copies the data to Object Storage Service (OSS) as needed. This process creates a snapshot. The relationship between the file system and a snapshot is shown in the following figure:

image
Note

In the figure, any data block ever written to is recorded in the snapshot, even if the file has been deleted. This is because deleting a file only marks its header for reuse and does not reduce the amount of space used on the disk.

Differences between snapshots and images

An image is a template for creating instances, while a snapshot is a backup of an instance's data.

The following figure shows that a snapshot is a data backup of an instance at a specific point in time. You can create a custom image from ECS 1 or its snapshot. You can then use the custom image to create another instance.

image

Both custom images and snapshots can be used for data backup, but they apply to different scenarios and have different features. Click to view the differences.

Main differences

Difference

Image

Snapshot

Definition

An image can be used to create a full backup of an instance's configuration, operating system, installed software, and data. For more information, see Back up and restore data with images.

A snapshot can be used to create a complete backup of the data on a single disk or a disk group (snapshot-consistent group) at a specific point in time. For more information, see Back up and restore data with snapshots.

Use cases

  • Back up systems that will not be changed in the short term, such as application systems that have been published or updated. After you create a custom image from a fully installed and configured ECS instance, you can use the image to create new ECS instances, such as for batch application deployment.

  • Migrate systems and data.

    Restore a system across availability zones or regions. For example, you can specify a new availability zone when you create an ECS instance from a custom image, or copy the image to another region and then create an ECS instance across regions.

  • Periodically back up disk data.

    An automatic snapshot policy can be executed daily, weekly, or monthly to back up disk data according to a set schedule.

  • Temporarily back up disk data. For example:

    • For temporary system changes such as system updates or application releases, you can manually create a snapshot to back up the system before you perform the changes to prevent operational errors.

    • Before you resize a system disk, create a snapshot to back up data.

    • For disk data migration, create a snapshot of a disk to use as the base data for another disk.

Features

  • An image can be directly used to create an ECS instance.

  • An image always contains a data backup of the system disk. Whether it contains a data backup of a data disk depends on whether the source instance has a data disk, or whether you choose to add a data disk when you create the image from a snapshot.

  • An image can be used to replace the system disk of the current ECS instance and other instances or to create new ECS instances.

  • A snapshot cannot be directly used to create an ECS instance.

  • A snapshot can be a data backup of an ECS instance's system disk or data disk.

  • A snapshot can only be used to restore the disk of the original ECS instance.

Other relationships

  • When you create a custom image:

    • You can create a custom image from a system disk snapshot. For more information, see Create a custom image from a snapshot.

    • When you create a custom image from an ECS instance, a snapshot is created for each disk (system disk and data disks) of the instance. The created custom image contains the snapshots of all disks of the instance. For more information, see Create a custom image from an instance.

  • When you delete a custom image and a snapshot:

    • When you delete a custom image, you can choose to delete or retain the corresponding snapshots. For more information, see Delete a custom image.

    • When you delete a snapshot, the system checks if it is associated with an image. If it is, you must delete the image before you can delete the snapshot. For more information, see Delete a snapshot.

Re-initializing vs. replacing a system disk

The main differences are shown in the following table:

Item

Re-initialize disk

Replace system disk

Functional differences

Re-initialization restores the instance to its initial state without changing the operating system.

Replaces the existing operating system with a different one.

Impact on the system disk

  • The old system disk is not released.

  • The system disk data is restored to its state at the time of creation. Applications installed and data generated after the instance was created are cleared. Back up your data beforehand.

  • The system disk ID, disk type, and IP address of the ECS instance remain unchanged.

  • After the operating system is replaced, the old system disk is released.

  • All data on the system disk is cleared. Back up your data beforehand.

  • The system disk ID changes, but the disk type, ECS instance IP address, and ENI MAC address remain unchanged.

Impact on data disks

Data disks are not affected.

Data disks are not affected.

Impact on snapshots

  • Snapshots created from the system disk can be used to roll back the disk.

  • Both manual snapshots and automatic snapshots created from the system disk are retained.

  • The automatic snapshot policy settings remain effective and do not need to be reconfigured.

  • Snapshots of the old system disk cannot be used to roll back the new system disk, but they can be used to create a custom image.

  • Manual snapshots created from the old disk are not released.

  • For automatic snapshots, if the Delete Automatic Snapshots While Releasing Disk attribute is enabled for the old system disk, the automatic snapshots are automatically deleted. If the Delete Automatic Snapshots While Releasing Disk attribute is not enabled, they are automatically deleted upon expiration.

  • The automatic snapshot policy for the old system disk becomes invalid and needs to be reconfigured.

Billing

Re-initializing a system disk is free. The operating system remains unchanged, so the billable items do not change.

Replacing an operating system is free, but fees are charged in the following cases:

  • If the new image is a paid image, you are charged for the image. For more information, see Image billing.

  • If you increase the capacity of the system disk during the replacement, you are charged for the additional capacity. For more information, see Elastic Block Storage billing.

Monitoring snapshot creation

You can use Cloud Monitor to subscribe to ECS system event notifications. For the event name, select Disk snapshot creation completed. You can then check the result field in the event body to determine whether the snapshot is created. When the result field is accomplished, it indicates completion, and failed indicates failure. For more information about event subscriptions and event notifications, see Subscribe to ECS system event notifications and Snapshot event notifications.