This topic describes how to use extundelete to restore data that was accidentally deleted. CentOS 7 is used in the examples.
Prerequisites
You must have registered an Alibaba Cloud account before you follow the instructions provided in the tutorial. If not, create a new Alibaba Cloud account first.
Background information
- In the ECS console, roll back snapshots or restore custom images to restore data.
- Implement load balancing and high availability for your business by purchasing multiple instances. For more information, see What is Server Load Balancer?.
- Use Object Storage Service (OSS) to store a large amount of data such as web pages, images, and videos. For more information, see What is OSS?.
There are multiple open source data recovery tools for Linux, such as debugfs, R-Linux, ext3grep, and extundelete. Although ext3grep and extundelete are both popular and adopt similar recovery techniques, extundelete has a higher performance. Linux systems do not have a Recycle Bin function built-in. You can install extundelete on Linux systems to restore data that has been deleted by accident.
extundelete can find and recover the deleted data by combining the inode information and logs to find the inode block. extundelete can recover deleted data from ext3 or ext4 partitions.
- Users who have accidentally deleted files from a disk and have not since performed write operations on the disk.
- Users whose websites have low traffic and who have few ECS instances.
dumpe2fs
command and record the version of e2fsprogs.
The preceding releases were available at the time of writing. The versions that you download may be different in your actual running environment.
Procedure
Step 1: Deploy extundelete
wget http://zy-res.oss-cn-hangzhou.aliyuncs.com/server/extundelete-0.2.4.tar.bz2
yum -y install bzip2 e2fsprogs-devel e2fsprogs gcc-c++ make # Install related dependencies and libraries.
tar -xvjf extundelete-0.2.4.tar.bz2
cd extundelete-0.2.4 # Go to the program directory.
./configure # If the output in the following figure is generated, extundelete is installed.

make && make install
At this point, the src directory appears. It contains an extundelete executable file and the corresponding path. The default path is usr/local/bin. The following step for data restoration is performed in the usr/local/bin directory.
Step 2: Use extundelete to stimulate the restoration process
Perform the following steps to use extundelete to stimulate the restoration process: