This document uses a CVM instance on CentOS 8.0 as an example to describe how to use the open-source tool Extundelete to recover accidentally deleted data.
Extundelete can recover accidentally deleted files in EXT3 and EXT4 file systems, but the specific level of recovery is subject to various factors such as whether files are overwritten by writes after deletion and whether metadata is stored in the journal. If the file system to be recovered is on the system disk, and there are always business or system processes writing files, the possibility of recovery is low.
Before recovering the data, complete the following preparations:
umountto detach the disk from the CVM instance first.
chmod a+x extundelete
The steps below are for CentOS 7 as an example. Note that the steps vary by the operating system.
yum install libcom_err e2fsprogs-devel
yum install gcc gcc-c++
tar xf v1.0.tar.gz
srcdirectory to view the compiled Extundelete file.
./extundelete --restore-all /dev/corresponding disk
The recovered files are located in the
RECOVERED_FILES folder at the same directory level. Check whether there are the needed files.