Recover deleted files on a Windows ECS instance with snapshots or DiskGenius, and set up safeguards against data loss.
This topic uses third-party software for data recovery. Alibaba Cloud does not guarantee the recovery results. If the data is critical and you lack recovery expertise, contact a professional data recovery agency.
Choose a recovery method
Identify the recovery path that applies to your situation.
| Situation | Recommended method |
|---|---|
| You created a snapshot before the deletion | Restore from snapshot. See Create snapshot manually. |
| No snapshot exists and the instance fails to start | Detach the disk, attach it to a working instance, then use DiskGenius. See Restore deleted files using DiskGenius. |
The following sections cover the no-snapshot, instance-fails-to-start scenario in detail.
Workflow
Prerequisites
Before you begin, ensure the following:
-
A second Windows ECS instance is available as the repair environment.
-
You have access to the ECS console to stop instances and detach disks.
-
DiskGeniusis third-party software. Some features require payment. See the official DiskGenius website for pricing.
Restore deleted files using DiskGenius
Use this procedure when files were accidentally deleted, the instance cannot start, and no snapshot exists.
You detach the affected disk, attach it to a second Windows instance, scan for deleted files with DiskGenius, and restore them.
Step 1: Snapshot the affected disk
Take a snapshot to capture the disk's current state before proceeding. This protects existing data if recovery fails.
Step 2: Detach the disk from the affected instance
Before detaching the system disk, stop the instance. In the ECS console, select Force Stop. Otherwise, the instance cannot be stopped.
Force Stop is equivalent to a power-off operation. Data in the instance operating system that has not been written to disk may be lost. Proceed with caution.
Detach the system disk or data disk from the affected instance. See Detach or attach system disk
Step 3: Attach the disk to the repair instance
Attach the detached disk to the repair instance as a data disk.
The ECS console may prompt you to initialize the attached disk. Do not click Initialize Now. Initializing erases all data. Close the dialog and proceed.
Step 4: Scan and recover files with DiskGenius
DiskGenius is third-party software. Fees may apply for file recovery features. Alibaba Cloud does not charge for DiskGenius. See the DiskGenius website for pricing.
-
Connect to the repair instance via RDP. See Connect to a Windows instance
-
Download DiskGenius from diskgenius.com.
Go to the official DiskGenius website to download
DiskGenius. -
Extract the package and double-click
DiskGenius.exeto run DiskGenius. -
In DiskGenius, right-click the partition on the attached disk and select Recover Lost Files.
-
Keep the default settings and click Start to scan for deleted files.
-
Click OK after the scan completes.
Dialog prompt: Select the files you want to recover, then copy the files to another disk or partition that does not require data recovery.
-
On the Files tab, select the files to recover, right-click, and choose the restore operation to save them to a path on the repair instance.
Available recovery operations include Copy to Specified Folder(S)..., Copy to "Desktop"(D), and Copy to "My Documents"(M).
ImportantDiskGeniusis third-party software that may charge for file restoration. This fee is unrelated to Alibaba Cloud. See the official DiskGenius website.
These steps cover only the essential recovery procedure. See the official DiskGenius website for advanced usage and troubleshooting.
See the DiskGenius documentation for detailed usage.
Best practices for preventing data loss
Recovery tools cannot guarantee success, especially if the disk has been written to after deletion. Apply these measures to protect your data proactively.
Understand triplicate storage limitations
Triplicate storage replicates data across three physical nodes to guard against hardware failures, but does not protect against logical issues such as accidental deletions, viruses, or file system corruption. Use snapshots and geo-redundancy for those scenarios.
Use automatic snapshot policies
Apply an automatic snapshot policy to your system disk and data disks to create scheduled recovery points without manual intervention.
To release automatic snapshots along with the disk, select Delete Automatic Snapshots While Releasing Disk in the Modify Attributes dialog. To retain them, clear this option. See Snapshot FAQ and Create an automatic snapshot policy.
Create manual snapshots before high-risk operations
Take a manual snapshot before any of these operations:
-
Updating the kernel
-
Upgrading or changing applications
-
Restoring data on disks
Add a second layer of backup
Snapshots alone may not cover all data loss scenarios. Add at least one additional backup method:
-
OSS backup — copy critical data to an OSS bucket for independent, durable storage
-
Offline backup — export data to external media for air-gapped protection
-
Geo-redundancy — replicate data to a different region for disaster recovery