In the operation and maintenance of the linux system, various situations of data loss due to inadvertent operation and operation errors are often encountered. At this time, we can use extundelete to restore data.
1. Preparation before the experiment
- Create a new disk
In the virtual machine settings window, find "Hard Disk", click "Add",
in the "Add Hardware Wizard" window that opens, select "Hard Disk", click Next,
then we directly select "Next" by default , until finally select "Finish",
2. Restart the system, we can use the command init 6 to restart the system.
3. Partition the hard disk
4. Format the partition
5. Create a mount point and mount the
disk After the disk is ready, the next step is to install the restore tool.
2. Install the data recovery tool
1. Before installing the recovery tool, you need to install three software environment packages
. After the disk preparation is completed, the next step is to install the recovery tool.
2. Install the data recovery tool
1. Before installing the recovery tool, you need to install three software environment packages - Unzip the restore tool to the /opt directory
- cd to the /opt directory, then we will see the decompressed restore tool, then enter the extundelete restore tool directory, enter ./configure (if gcc gcc-c++ is not installed, an error will be reported, just install it)
- After compiling and
compiling, the installation steps have been completed, and the next step is to test.
three. Experimental test
1. Create three files on the mounted hard disk
2. Delete two of the files, and only one file is left in the file
3. Then unmount the disk - Use the restore software to restore
5. At this time, a RECOVERED_FILES folder appears in the current directory, enter the folder, and you can see that the files we deleted before are here. At this point our experiment was a success!