Environment: CentOS5.3X86 _ 64 example partition of the Operating System: devsdb1 is mounted to the data Partition. Example scenario: there is a test directory in the root directory of data, and there are two subdirectories and two files under the directory, there are still files in the subdirectory. I deleted all files in the test directory and then restored it. The conclusion is that the file can be successfully restored, but the directory cannot be recovered directly.
Environment: CentOS 5.3 X86_64 Operating System
Example partition:/dev/sdb1 mounted on/data Partition
Example scenario: there is a test directory in the root directory of/data, there are two subdirectories and two files under the directory, There are files under the subdirectory, I delete all the files under the test directory and then restore, the conclusion is that the file can be successfully restored, but the directory cannot be recovered directly. Only files under the directory can be restored separately (the directory structure is in)
1. Check whether the file system isExT3 File System
[Root @ MFS-chunkserver-2] # partEd/Dev/sdb1
2. View partition information
[Root @ MFS-chunkserver-2] #Df-Lh
3. view the directory structure
[Root @ MFS-chunkserver-2] #Cd/Data/test/
[Root @ MFS-chunkserver-2] #TrEe
4. Delete all files and directories under/data/test
[Root @ MFS-chunkserver-2] #Rm-Rf *
[Root @ MFS-chunkserver-2] #Ls
[Root @ MFS-chunkserver-2] #
5. Start to install the recovery tool
[Root @ MFS-chunkserver-2] # tar zxvf ext3Grep-0.10.1.tar.gz
[Root @ MFS-chunkserver-2] # cd ext3grep-0.10.1
[Root @ MFS-chunkserver-2] #./configure
[Root @ MFS-chunkserver-2] # make
[Root @ MFS-chunkserver-2] # make install
6. Detach a partition
[Root @ MFS-chunkserver-2] # cd/
[Root @ MFS-chunkserver-2] #Umount/Data/
7. Go to the/data directory to view inode information.
[Root @ MFS-chunkserver-2] # cd/data/
[Root @ MFS-chunkserver-2] # ext3grep/dev/sdb1 -- ls -- inode 2 (you can see that the test directory has been found at the end)
8. Record the inode information of the test directory, and then continue to find the Directory and file inode information under the test directory.
[Root @ MFS-chunkserver-2] # ext3grep/dev/sdb1 -- ls -- inode131081(Inode here)
9. The deleted directories a and B are found, and inode information is recorded to restore the directory.
[Root @ MFS-chunkserver-2] # ext3grep/dev/sdb1 --Restore-Inode 131082 (directory)