One: Environment construction
1. Download http://extundelete.sourceforge.net/
2. Installing E2fsprogs and E2fsprogs-libs
Yum Install E2fsprogs e2fsprogs-libs-y
3. Uploading files to a Linux host
Put c:/users/cpic/desktop/extundelete-0.2.4.tar.bz2
4. Installing the Software
Tar jxvf extundelete-0.2.4.tar.bz2cd/root/extundelete-0.2.4./configuremake & make Install
Error: (1) configure:error:in '/root/desktop/extundelete-0.2.4 ': configure:error:c++ compiler cannot create executables FIX: Yum install gcc*-y (2) Configuring Extundelete 0.2.4 Configure:error:Can ' t find ext2fs Library solution: Yum install E2 fsprogs*-y
Second: Experiment
mkdir /shiyan #创建挂载目录fdisk /dev/sdb #划分为一个主分区 n-p-1-wmount /dev/sdb1 /shiyan #挂载cp -a /etc/passwd /shiyan/ #复制文件cd /shiyanrm -rf passwd #删除文件umount /shiyan #卸载文件系统 [[email protected] /]# extundelete /dev/sdb1 --inode 2 #查看inode信息, Important!! Notice: extended attributes are not restored. Loading filesystem metadata ... 8 groups loaded. Group: 0contents of inode 2:0000 | ed 41 00 00 00 10 00 00 7c 8f ed 59 77 8f ed 59 | . A......|. Yw. y0010 | 77 8f ed 59 00 00 00 00 00 00 02 00 08 00 00 00 | w. Y............ 0020 | 00 00 00 00 03 00 00 00 49 00 00 00  00 00 00 00 |&NBSP, ... I ... 0030 | 00 00 00 00 00 00 00 00 00 00 00 00  00 00 00 00 |&NBSP, .......... 0040 | 00 00 00 00 00 00 00 00 00 00 00 00  00 00 00 00 |&NBSP, .......... 0050 | 00 00 00 00 00 00 00 00 00 00 00 00  00 00 00 00 |&NBSP, .......... 0060 | 00 00 00 00 00 00 00 00 00 00 00 00  00 00 00 00 |&NBSP, .......... 0070 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................ 0080 | 1c 00 00 00 00 19 23 02 00 19 23 02 dc ff 9c b1 | ......#...# ..... 0090 | 33 8f ed 59 00 00 00 00 00 00 00 00 00 00 00 00 | 3..y ....... 00a0 | 00 00 00 00 00 00 00 00 00 00 00 00  00 00 00 00 |&NBSP, .......... 00b0 | 00 00 00 00 00 00 00 00 00 00 00 00  00 00 00 00 |&NBSP, .......... 00c0 | 00 00 00 00 00 00 00 00 00 00 00 00  00 00 00 00 |&NBSP, .......... 00d0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | &NBSP, .......... 00e0 | 00 00 00 00 00 00 00 00 00 00 00 00  00 00 00 00 |&NBSP, .......... 00f0 | 00 00 00 00 00 00 00 00 00 00 00 00  00 00 00 00 |&NBSP, .......... inode is allocatedfile mode: 16877low 16 bits of owner uid: 0size in bytes: 4096access time: 1508740988creation time: 1508740983modification time: 1508740983deletion time: 0low 16 bits of Group id: 0links count: 2blocks count: 8file flags: 0file version (FOR NFS): 0file acl: 0directory acl: 0fragment address: 0direct blocks: 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0indirect block: 0double indirect block: 0triple indirect block: 0file name | Inode number | Deleted status. 2.. 2lost+ found 11 deletedpasswd 12 deleted
Restore a single file :extundelete/dev/sdb1--restore-file The relative path to the original file store
The original file's storage path is/DATA/PASSWD, then the parameters are directly specified after the passwd, if the original file path is/data/test/passwd, then the parameters test/passwd.
recovering a single directory :extundelete/dev/sdb1--restore-directory/aaa
The original storage directory path is:/DATA/AAA
Recover all deleted data :extundelete/dev/sdb1--restore-all
Finally, the deleted files are found in the Recovered_files directory under the current directory.
Note: Remove the file system the first time you want to unmount it.
This article from "High-rise, look at the end of the Road" blog, please be sure to keep this source http://nxyboy.blog.51cto.com/10511646/1975244
What to do if the Linux system mistakenly deletes files! Recovering data using Extundelete