The circumstances of the case:
[Email protected] ~]# uname-r && cat/etc/system-release2.6.32-504.el6.x86_64centos Release 6.6 (Final)
First, install the software
1. Installing dependent packages
# yum Install e2fsprogs*-y
2. Download and install Extundelete
# wgethttp://nchc.dl.sourceforge.net/p ... elete-0.2.4.tar.bz2
# TAR-JXVF extundelete-0.2.4.tar.bz2
# CD extundelete-0.2.4
#./configure--prefix=/usr/local/extundelete
# make && make install
3. Verify that the installation is successful
# Cd/usr/local/extundelete/bin
#./extundelete-v
---------------------
extundelete version 0.2.4
libext2fs version 1.41.12
Processor is little endian.
---------------------
Second, the simulation data mistakenly deleted environment:
This case adds a new disk to the operation:
[Email protected] ~]# mount/dev/sdb2/data/[[email protected] ~]# cp/root/extundelete-0.2.4.tar.bz2/data/[[email Prot Ected] data]# mv extundelete-0.2.4.tar.bz2 test.tar.bz #额, superfluous, please ignore. [Email protected] data]# md5sum test.tar.bz #记录源文件MD5值77e626ad31433680c0a222069295d2ca test.tar.bz[[email protected] mnt]# Rm-rf/data/*[[email protected] mnt]# cd/mnt[[email protected] mnt]# Umount/data
Third, recovery steps:
[[email protected] mnt]# cd /usr/local/extundelete/bin/[[email protected] bin]# lsextundelete[[email protected] bin]# ./extundelete /dev/sdb2 --inode 2notice: 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 9d 4c 08 55 b9 4c 08 55 | . A....... L.u.l.u0010 | b9 4c 08 55 00 00 00 00 00 00 02 00 08 00 00 00 | . L.u ....... 0020 | 00 00 00 00 05 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 |&NBSP, .......... 0080 | 1c 00 00 00 8c 18 94 4b 8c 18 94 4b  4C 01 00 48 |&NBSP, ... K... Kl.. h0090 | 0d 4c 08 55 00 00 00 00 00 00 00 00 00 00 00 00 | . L.u ....... 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: 1426607261creation time: 1426607289modification time: 1426607289deletion 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 &Nbsp; | inode number | Deleted status. 2.. 2lost+found 11 deletedextundelete-0.2.4.tar.bz2 12 Deletedtest.tar.bz 12 deleted[[email protected] bin]# ./extundelete /dev/sdb2 --restore-file test.tar.bznotice: extended attributes are not restored. Loading filesystem metadata ... 8 groups loaded. Loading journal descriptors ... 28 descriptors lOaded. successfully restored file test.tar.bz[[email protected] bin]# ls ./ Recovered_files/test.tar.bz[[email protected] bin]# md5sum ./recovered_files/test.tar.bz #查看恢复出来的文件的MD5值77e626ad31433680c0a222069295d2ca ./recovered_files/test.tar.bz
This article is from the "Dream You want" blog, please be sure to keep this source http://zmyxn.blog.51cto.com/3029175/1621655
Extundelete recover deleted files by mistake