In the operation of Linux system operations, often encountered due to careless operations, operation errors and other causes of file data loss situation. What is referred to here is a complete deletion, that is, the "Recycle Bin" can not be recovered, such as the use of "RM-RF" to delete data. For the Ext file system under Linux, the available recovery tools are debugfs,ext3grep,extundelete and so on, among which the Extundelete tool is an open source Linux data Recovery tool that supports the Ext3,ext4 file system.
Here's how to use the Extundelete tool to recover deleted files in redhat6.5
1, compile and install Extundelete
You need to install a dependency package before compiling the installation, e2fsprogs-libs-1.41.12-18.e16.x86_64.rpm and e2fsprogs-devel-1.41.12-18.e16.x89_64.rpm
These two packages are available under the/packages directory of the system CD and are installed using the RPM command. The e2fsprogs-devel-1.41.12-18.e16.x89_64.rpm installation relies on the Libcom_err-devel package. You also need to use the Yum command to install the gcc,gcc-c++ Configuration compilation environment
After you install the dependent packages, you can extract, configure, compile, and install the Extundelete packages that are prepared in advance.
2, simulate delete and perform recovery operation
(1) Use the FDISK command to create a new partition, mount it to the/SDB1 directory, and add a new file to the directory
Use the EXTUNDELETE/DEV/SDB1--inode 2 command to view the files that exist under the file system/DEV/SDB1, as well as the usage situation.
You can see the files that exist under the file system, and the inode number
(2) Analog misoperation and recovery
Use the "Rm-rf a B" command to remove the A and B files under/SDB1, immediately uninstall the file system, and use "EXTUNDELETE/DEV/SDB1--restore-all" to restore everything under the/dev/sdb1 file system
After executing the restore command, a/recovered_files/directory appears in the current directory, which holds the recovered files.
Linux system files deleted by mistake recovery