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,