Overview
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. Preparations
Before recovering the data, complete the following preparations:
Stop writing data to the file system. If you need to recover a data disk, run umount
to detach the disk from the CVM instance first.
Directions
1. Install Extundelete in the following two ways:
1. Run the following command to directly download the compiled binary program.
wget https://github.com/curu/extundelete/releases/download/v1.0/extundelete
2. Run the following command to grant file permissions.
Note:
The steps below are for CentOS 7 as an example. Note that the steps vary by the operating system.
1. Run the following command to install the Extundelete dependencies and libraries.
yum install libcom_err e2fsprogs-devel
2. Run the following command to download the Extundelete source code.
wget https://github.com/curu/extundelete/archive/refs/tags/v1.0.tar.gz
3. Run the following command to decompress the v1.0.tar.gz
file.
4. Run the following commands in sequence to compile and install.
5. Run the following command to enter the src
directory to view the compiled Extundelete file.
2. Run the following command to try recovering the data.
./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.
Was this page helpful?