extundelete恢復Linux被刪除檔案

2021-06-09 00:42:42 字數 4475 閱讀 5825

安裝extundelete

[root@xifenfei tmp]# bunzip2 extundelete-0.2.0.tar.bz2

[root@xifenfei tmp]# tar xvf extundelete-0.2.0.tar

extundelete-0.2.0/

extundelete-0.2.0/readme

extundelete-0.2.0/acinclude.m4

extundelete-0.2.0/configure.ac

extundelete-0.2.0/aclocal.m4

extundelete-0.2.0/makefile.am

extundelete-0.2.0/makefile.in

extundelete-0.2.0/config.h.in

extundelete-0.2.0/configure

extundelete-0.2.0/compile

extundelete-0.2.0/depcomp

extundelete-0.2.0/install-sh

extundelete-0.2.0/missing

extundelete-0.2.0/license

extundelete-0.2.0/autogen.sh

extundelete-0.2.0/src/

extundelete-0.2.0/src/makefile.am

extundelete-0.2.0/src/makefile.in

extundelete-0.2.0/src/extundelete.cc

extundelete-0.2.0/src/block.c

extundelete-0.2.0/src/insertionops.cc

extundelete-0.2.0/src/block.h

extundelete-0.2.0/src/extundelete.h

extundelete-0.2.0/src/extundelete-priv.h

extundelete-0.2.0/src/jfs_compat.h

extundelete-0.2.0/src/kernel-jbd.h

[root@xifenfei tmp]# cd extundelete-0.2.0

[root@xifenfei extundelete-0.2.0]# ./configure

configuring extundelete 0.2.0

writing generated files to disk

[root@xifenfei extundelete-0.2.0]# make && make install

make -s all-recursive

****** all in src

****** install in src

/usr/bin/install -c 'extundelete' '/usr/local/bin/extundelete'

恢復操作命令

--umount或者read only 分割槽

umount /dev/partition

mount -o remount,ro /dev/partition

--恢復檔案

xtundelete /dev/partition --restore-all

extundelete /dev/partition --restore-directory /backup/gnutool-delete

extundelete /dev/partition --restore-files /etc/passwd

測試恢復

--基於目錄恢復

[root@xifenfei tmp]#extundelete /dev/sdb1 --restore-directory /u01/xifenfei

loading filesystem metadata ... 160 groups loaded.

loading journal descriptors ... 23 descriptors loaded.

writing output to directory recovered_files/

failed to restore file /u01/xifenfei

could not find correct inode number past inode 2.

[root@xifenfei tmp]# cd recovered_files/

[root@xifenfei recovered_files]# ll

total 0

--未成功

--基於磁碟恢復

[root@xifenfei recovered_files]#extundelete /dev/sdb1 --restore-all

loading filesystem metadata ... 160 groups loaded.

loading journal descriptors ... 23 descriptors loaded.

writing output to directory recovered_files/

searching for recoverable inodes in directory / ...

4 recoverable inodes found.

looking through the directory structure for deleted files ...

failed to restore inode 1966081 to file recovered_files/xifenfei:inode does not correspond to a regular file.

restored inode 1966082 to file recovered_files/xifenfei/xff.txt

failed to restore inode 1966083 to file recovered_files/xifenfei/xff:inode does not correspond to a regular file.

restored inode 1966084 to file recovered_files/xifenfei/xff/xff.txt132

0 recoverable inodes still lost.

[root@xifenfei recovered_files]# ll

total 4

drwxr-xr-x 3 root root 4096 aug 31 21:36 recovered_files

[root@xifenfei recovered_files]# cd recovered_files/

[root@xifenfei recovered_files]# ll

total 4

drwxr-xr-x 3 root root 4096 aug 31 21:36 xifenfei

[root@xifenfei recovered_files]# cd xifenfei/

[root@xifenfei xifenfei]# ll

total 20

drwxr-xr-x 2 root root 4096 aug 31 21:36 xff

-rw-r--r-- 1 root root 13231 aug 31 21:36 xff.txt

[root@xifenfei xifenfei]# cd xff

[root@xifenfei xff]# ll

total 16

-rw-r--r-- 1 root root 13231 aug 31 21:36 xff.txt132

--恢復成功

--基於檔案恢復

[root@xifenfei xff]# extundelete /dev/sdb1 --restore-files /u01/xifenfei/xff.txt

loading filesystem metadata ... 160 groups loaded.

loading journal descriptors ... 23 descriptors loaded.

writing output to directory recovered_files/

[root@xifenfei xff]# cd recovered_files/

[root@xifenfei recovered_files]# ll

total 0

--未成功

通過上述實驗證明extundelete還是有很大的不完整性,基於整個磁碟的恢復功能較為強大,基於目錄和檔案的恢復還不夠強大.不過該軟體在很多時候還是有救火的功能,特別是當蛋筒的人員刪除了資料庫的部分檔案之時.

Extundelete 資料恢復

rm rf 是我們經常使用的命令,操作不慎全盤接蹦,從刪庫到跑路,身為過來人的我們都經歷過rm帶來的痛苦。不要慌,當我們有了extundelete就可以解決一系列誤刪除操作問題。下面我會詳細介紹一下這款救命工具。常見的開源恢復工具有 debugfs r linux ext3grep extundel...

extundelete 資料恢復

extundelete 資料恢復 rm rf 是我們經常使用的命令,操作不慎全盤接蹦,從刪庫到跑路,身為過來人的我們都經歷過rm帶來的痛苦。不要慌,當我們有了extundelete就可以解決一系列誤刪除操作問題。下面我會詳細介紹一下這款救命工具。介紹 常見的開源恢復工具有 debugfs r lin...

extundelete 恢復誤刪檔案

準備的測試環境 1 centos 6 2 extundelete壓縮包 1 誤刪後請解除安裝此目錄或者變為唯讀 2 解壓extundelete壓縮包 3 進入extundelete目錄 4 yum安裝所需依賴 gcc e2fs 5 make j 4 編譯 6 make install 安裝 7 恢復...