Linux system files deleted by mistake recovery

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.