Restore The accidentally deleted File (rm-rf) in CentOS

Source: Internet
Author: User
Premise: The/usr/local/data file is deleted by mistake. now, you need to restore the data file, while/dev/sda3 is mounted in/usr. use df-hT to check that the file system is in ext3 format !!! In an ext3 file system, if you delete the file with rm-rf, perform the following steps: 1./ext3grep/dev/sda3 -- ls -- inode2.

Premise: The/usr/local/data file is deleted by mistake. now, you need to restore the data file,

While/dev/sda3 is mounted under/usr

Use df-hT to check that the file system is in ext3 format !!!


In an ext3 file system, if you delete the file with rm-rf, follow these steps:

1,./ext3grep/dev/sda3 -- ls -- inode 2

2,./ext3grep/dev/sda3 -- restore-file name to be restored


Note: 1. install ext3grep (first, check that e2fsprogs-related software has been installed -- rpm-qa | grep e2fsprogs ).

2,./ext3grep/dev/sda3 -- ls -- inode 2

------ Execute the command to start searching for information about recoverable data files (including deleted and existing files). the deleted files contain the D mark, if you do not remember the deleted file name, you can use the following command.

[Root @ www opt] # ext3grep/dev/sda3 -- dump-names

3,./ext3grep/dev/sda3 -- restore-file/usr/local/data

------- Restore the data of a single file. Note that local/data is the relative path (/dev/sda3 is mounted under/usr ), because the previous data is in the local directory of the/usr directory mounted to/dev/sda3, it is expressed here. Or directly write the file name data,


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.