1, download Extundelete package, install dependent
I am using a centos system and need to install e2fsprogs,e2fsprogs-libs,e2fsprogs-devel before installing Extundelete.
Yum Install e2fsprogs e2fsprogs-libs e2fsprogs-devel
Then download the Extundelete program
: http://extundelete.sourceforge.net/
2. Compile and install Extundelete
compile step: Tar xjf extundelete-0.2. 4 . tar.bz2 CD extundelete-0.2. 4 . /
Extundelete's usage can be viewed in detail through help!
Extundelete Software Recovery principle
Extundelete the process of recovering data: After the data has been mistakenly deleted, the first thing to do is to unload the partition where the deleted data is located, if the data of the root partition is mistakenly deleted, you need to enter the system into single user mode and mount the root partition in read-only mode. The reason for this is simple, because after the file is deleted, only the sector pointer in the Inode node of the file is zeroed out, the actual file is also stored on disk, if the disk continues to mount in read-write mode, the data blocks of these deleted files may be reassigned by the operating system, after these databases are overwritten by new data, The data is really lost and the recovery tool is powerless. So! Mounting a disk in read-only mode minimizes the risk of data being overwritten in the database to increase the percentage of successful recovery data.
3. Uninstall the partition that needs to recover files
Fuser-k/mnt/test//mnt/test
4. Use Extundelete to view files that exist on the partition
and query the recoverable data information of the/DEV/SDB1 partition by executing the extundelete command
2 /DEV/SDB1
Example of recovering files
/dev//dev/sdb1/mnt/test/mv Recovered_files/file. The/mnt/test/resolv.conf recovery is complete and the content can be verified with cat.
Restore a single file: EXTUNDELETE/DEV/SDB1--restore-file passwd will generate a recovered_files directory in the current directory, which holds the recovered files.
Recovering a single directory: EXTUNDELETE/DEV/SDB1--restore-directory/mongodb
Recover all deleted files: extundelete/dev/sdb1--restore-allextundelete
You can also implement data recovery for a period of time. Can be achieved by "--after" and "--before" Parameters!
How to recover RM command deleted files in Linux Extundelete compile installation and use