This topic describes how to roll back a disk by using a snapshot. When the system is unresponsive or when accidental changes are made, you can roll back a disk to a previous version by using one of its snapshots. Before you roll back the disk, you must have created a snapshot of the disk. If you roll back system disks, the current SSH key pairs or usernames and passwords of the Elastic Compute Service (ECS) instances remain bound to the disks after the disks are rolled back.
Prerequisites
- A snapshot of the disk to be rolled back is created, and no new snapshot is being
created for the disk. For more information, see Create a snapshot of a disk.
Warning The rollback operation is irreversible. After a disk is rolled back, the data that you added, removed, or changed from the time when the snapshot is created to the time when the disk is rolled back is lost. To avoid data loss caused by accidental changes, we recommend that you create a snapshot for the disk to back up data before you roll back the disk.
- The disk is not released.
- After the operating system is replaced, snapshots of the previous system disk cannot be used to roll back the new system disk.
- If you use a disk to create a dynamic extended volume or redundant array of independent disks (RAID), you must stop all I/O operations on the disk before you roll back the disk.
- The disk is attached to an ECS instance and the instance is in the Stopped state.
For more information, see Attach a data disk and Stop an instance.
Notice If the billing method of an instance is pay-as-you-go and the network type of the instance is VPC, you must enable the standard mode for the instance when you stop the instance. If you enable the economical mode for the instance, you may not be able to start the instance after its disk is rolled back.
Roll back a disk by using a snapshot
You can roll back a disk on the Snapshots or Instances page. The following example shows how to roll back a disk on the Instances page:
(Optional) Synchronize data after a disk is rolled back

What to do next
- After a disk is rolled back, the host configuration file and the configurations such as the hostname, SSH key pair, password, network, system source, and clock source are initialized. You must reconfigure the information.
- If you resize a disk after you create a snapshot for the disk, the size of the disk
is also rolled back after you roll back the disk. To make the disk revert to the size
before the rollback, you must log on to the instance to resize the file system again.
- For information about operations on Linux instances, see Resize disks online for Linux instances.
- For information about operations on Windows instances, see Resize disks online for Windows instances.