Extundelete is an open-source data recovery tool. With powerful features, it supports the ext3 and ext4 partition recovery of data disk files that are deleted accidentally, provided the disk is not written after the accident. This document describes how to use Extundelete to quickly recover the accidentally deleted data on a CentOS 7.7 Tencent Cloud CVM.
Tencent Cloud also offers snapshots, custom images and Cloud Object Storage to store data. We recommend that you regularly back up data to enhance data security.
Note:
Refer to Creating Snapshots and Creating Custom Images to back up data before performing operations so that you can recover the instance to its initial status if a problem occurs.
Note:
- Extundelete requires the libext2fs version 1.39 or later.
- To support the ext4 format, install the e1fsprogs version 1.41 or later. You may use the
dumpe2fs
command to view the version.
yum -y install bzip2 e2fsprogs-devel e2fsprogs gcc-c++ make
tar -xvjf extundelete-0.2.4.tar.bz2
cd extundelete-0.2.4
./configure
make && make install
After the installation is completed, you will be able to see the executable file “extundelete” in the usr/local/bin
directory.Recover data as needed by performing the following steps.
fdisk -l
The following information will appear:/dev/vdb1
partition to /test
as an example.mkdir /test
mount /dev/vdb1 /test
cd /test
echo test > hello
md5sum hello
The following information will appear:rm -rf hello
cd ~
fuser -k /test
umount /dev/vdb1
extundelete --inode 2 /dev/vdb1
The following information will appear:/usr/local/bin/extundelete --restore-inode 12 /dev/vdb1
After the file is recovered, you will see the RECOVERED_FILES
folder in the same-level directory.RECOVERED_FILES
folder, check the recovered file, and run the following command to obtain its MD5 value.md5sum Recovered file
If the obtained MD5 value is the same as that of the “hello” file recorded in Step 4, the data has been recovered successfully.
Was this page helpful?