Recover accidentally deleted data files under linux

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

  1. 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",
    Recover accidentally deleted data files under linux
    2. Restart the system, we can use the command init 6 to restart the system.
    Recover accidentally deleted data files under linux
    3. Partition the hard disk
    Recover accidentally deleted data files under linux
    4. Format the partition
    Recover accidentally deleted data files under linux
    5. Create a mount point and mount the
    Recover accidentally deleted data files under linux
    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
    Recover accidentally deleted data files under linux
  2. Unzip the restore tool to the /opt directory
    Recover accidentally deleted data files under linux
  3. 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)
    Recover accidentally deleted data files under linux
  4. After compiling and
    Recover accidentally deleted data files under linux
    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
    Recover accidentally deleted data files under linux
    2. Delete two of the files, and only one file is left in the file
    Recover accidentally deleted data files under linux
    3. Then unmount the disk
    Recover accidentally deleted data files under linux
  5. Use the restore software to restore
    Recover accidentally deleted data files under linux
    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!
    Recover accidentally deleted data files under linux

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324711953&siteId=291194637