Data protection
Snapshot size
-
What is the relationship between snapshot size and disk capacity?
-
Does deleting files in an ECS instance reduce the occupied space?
-
Why is my snapshot size larger than the amount of data shown in the file system?
Snapshot billing
-
What are the differences between an OSS resource plan and a Storage Capacity Unit (SCU)?
-
Am I charged for using the snapshot-consistent group feature?
Snapshot retention and storage
-
If I create a custom image from a snapshot, can I store the image in an OSS bucket?
-
How do I prevent my snapshots from being deleted by Alibaba Cloud?
-
Are snapshots deleted after I replace a system disk, release an instance, or release a disk?
-
How do I delete a snapshot that was used to create an image or a disk?
Automatic snapshot policies
Data recovery
-
How do I resolve system disk exceptions on a Windows instance?
-
How can I quickly restore data from a snapshot after an ECS instance is released?
-
How can I quickly restore data from a snapshot after an ECS instance is released?
-
How do I re-attach a data disk after re-initializing the system disk of a Linux ECS instance?
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.

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.
-
For more information about snapshot billing, see Snapshot billing.
-
For more information about enabling snapshots, see Enable snapshots.
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
-
Manual snapshots are not deleted.
-
Whether automatic snapshots are deleted depends on whether you enable the Delete Automatic Snapshots While Releasing Disk attribute. For more information, see Configure automatic snapshots to be released with their disks.
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.
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.
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.
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:
-
Create a disk from a snapshot, and then attach the new disk to an ECS instance to view the data stored in the snapshot.
-
Create a custom image from a snapshot, and then use the custom image to create a new ECS instance to view the data stored in the snapshot.
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 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. |
|
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 -hcommand 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.
-
Run the
mount /dev/xvdb1command to remount the data disk. -
Run the
mountcommand to view the file system type of the /dev/xvdb1 data disk partition. -
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 -
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:
-
Connect to the new ECS instance, check whether the data is fully restored, and then copy or further process the data.
ImportantCreating 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.
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:
-
Remotely connect to the new ECS instance, verify that the data is fully recovered, and then copy or process it further.
ImportantCreating 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.
-
Run the
mountcommand to view the mount information of the data disk.The result does not contain information about /dev/vdb1.
-
Run
fdisk -lto view the data disk partition information. -
Run
cat /etc/fstabto check the data disk partition /dev/vdb1 for its original mount point name. -
Run
mkdir /InitTestto 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.
-
Run
mount /dev/vdb1 /InitTestto remount the data disk partition. -
Run
df -hto check the mount result. -
Follow these steps to check whether the /dev/vdb1 data disk can be automatically mounted.
-
Run the
umount /dev/vdb1command to unmount /dev/vdb1. -
Run
mountto view the mount information.If the unmount is successful, the result does not contain information about /dev/vdb1.
-
Run
mount -ato automatically mount /dev/vdb1. -
Run
mountto 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.
-
-
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
Go to ECS console - Snapshots.
-
Hover the mouse pointer over the snapshot name, click the icon shown in the figure, change the name, and then click OK.

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:
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.
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 |
|
|
|
Impact on data disks |
Data disks are not affected. |
Data disks are not affected. |
|
Impact on snapshots |
|
|
|
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:
|
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.