服务器技术

 首页 > 服务器技术 > Linux > linux文件恢复工具extundelete恢复被删除文件示例

linux文件恢复工具extundelete恢复被删除文件示例

分享到:
【字体:
导读:
          extundelete是一个恢复工具了常用于linux系统中文件被删除之后的恢复软件了,下面小编来给各位整理一个extundelete工具恢复文件的例子. 安装extundelete: [root@xifenfeitmp]#bunzip2extundelete-0.2.0.tar...

extundelete是一个恢复工具了常用于linux系统中文件被删除之后的恢复软件了,下面小编来给各位整理一个extundelete工具恢复文件的例子.

安装extundelete:

  1. [root@xifenfei tmp]# bunzip2 extundelete-0.2.0.tar.bz2 
  2. [root@xifenfei tmp]# tar xvf extundelete-0.2.0.tar 
  3. extundelete-0.2.0/ 
  4. extundelete-0.2.0/README 
  5. extundelete-0.2.0/acinclude.m4 
  6. extundelete-0.2.0/configure.ac 
  7. extundelete-0.2.0/aclocal.m4 
  8. extundelete-0.2.0/Makefile.am 
  9. extundelete-0.2.0/Makefile.in 
  10. extundelete-0.2.0/config.h.in 
  11. extundelete-0.2.0/configure 
  12. extundelete-0.2.0/compile 
  13. extundelete-0.2.0/depcomp 
  14. extundelete-0.2.0/install-sh 
  15. extundelete-0.2.0/missing 
  16. extundelete-0.2.0/LICENSE 
  17. extundelete-0.2.0/autogen.sh 
  18. extundelete-0.2.0/src/ 
  19. extundelete-0.2.0/src/Makefile.am 
  20. extundelete-0.2.0/src/Makefile.in 
  21. extundelete-0.2.0/src/extundelete.cc 
  22. extundelete-0.2.0/src/block.c 
  23. extundelete-0.2.0/src/insertionops.cc 
  24. extundelete-0.2.0/src/block.h 
  25. extundelete-0.2.0/src/extundelete.h 
  26. extundelete-0.2.0/src/extundelete-priv.h 
  27. extundelete-0.2.0/src/jfs_compat.h 
  28. extundelete-0.2.0/src/kernel-jbd.h 
  29. [root@xifenfei tmp]# cd extundelete-0.2.0 
  30. [root@xifenfei extundelete-0.2.0]#  ./configure 
  31. Configuring extundelete 0.2.0 
  32. Writing generated files to disk 
  33. [root@xifenfei extundelete-0.2.0]# make && make install 
  34. make -s all-recursive 
  35. Making all in src 
  36. Making install in src 
  37.   /usr/bin/install -c 'extundelete' '/usr/local/bin/extundelete' 

恢复操作命令:

  1. --umount或者read only 分区 
  2. umount /dev/partition  
  3. mount -o remount,ro /dev/partition  
  4. --恢复文件  
  5. xtundelete /dev/partition --restore-all 
  6. extundelete /dev/partition --restore-directory /backup/gnutool-delete 
  7. extundelete /dev/partition --restore-files /etc/passwd  
  8. 测试恢复 
  9. --基于目录恢复 
  10. [root@xifenfei tmp]#extundelete /dev/sdb1  --restore-directory /u01/xifenfei 
  11. Loading filesystem metadata ... 160 groups loaded. 
  12. Loading journal descriptors ... 23 descriptors loaded. 
  13. Writing output to directory RECOVERED_FILES/ 
  14. Failed to restore file /u01/xifenfei 
  15. Could not find correct inode number past inode 2. 
  16. [root@xifenfei tmp]# cd RECOVERED_FILES/ 
  17. [root@xifenfei RECOVERED_FILES]# ll 
  18. total 0 
  19. --未成功 
  20. --基于磁盘恢复 
  21. [root@xifenfei RECOVERED_FILES]#extundelete /dev/sdb1  --restore-all 
  22. Loading filesystem metadata ... 160 groups loaded. 
  23. Loading journal descriptors ... 23 descriptors loaded. 
  24. Writing output to directory RECOVERED_FILES/ 
  25. Searching for recoverable inodes in directory / ...  
  26. 4 recoverable inodes found. 
  27. Looking through the directory structure for deleted files ...  
  28. Failed to restore inode 1966081 to file RECOVERED_FILES/xifenfei:Inode does not correspond to a regular file. 
  29. Restored inode 1966082 to file RECOVERED_FILES/xifenfei/xff.txt 
  30. Failed to restore inode 1966083 to file RECOVERED_FILES/xifenfei/xff:Inode does not correspond to a regular file. 
  31. Restored inode 1966084 to file RECOVERED_FILES/xifenfei/xff/xff.txt132 
  32. 0 recoverable inodes still lost. 
  33. [root@xifenfei RECOVERED_FILES]# ll 
  34. total 4 
  35. drwxr-xr-x 3 root root 4096 Aug 31 21:36 RECOVERED_FILES 
  36. [root@xifenfei RECOVERED_FILES]# cd RECOVERED_FILES/ 
  37. [root@xifenfei RECOVERED_FILES]# ll 
  38. total 4 --phpfensi.com
  39. drwxr-xr-x 3 root root 4096 Aug 31 21:36 xifenfei 
  40. [root@xifenfei RECOVERED_FILES]# cd xifenfei/ 
  41. [root@xifenfei xifenfei]# ll 
  42. total 20 
  43. drwxr-xr-x 2 root root  4096 Aug 31 21:36 xff 
  44. -rw-r--r-- 1 root root 13231 Aug 31 21:36 xff.txt 
  45. [root@xifenfei xifenfei]# cd xff 
  46. [root@xifenfei xff]# ll 
  47. total 16 
  48. -rw-r--r-- 1 root root 13231 Aug 31 21:36 xff.txt132 
  49. --恢复成功 
  50. --基于文件恢复 
  51. [root@xifenfei xff]# extundelete /dev/sdb1  --restore-files /u01/xifenfei/xff.txt --phpfensi.com
  52. Loading filesystem metadata ... 160 groups loaded. 
  53. Loading journal descriptors ... 23 descriptors loaded. 
  54. Writing output to directory RECOVERED_FILES/ 
  55. [root@xifenfei xff]# cd RECOVERED_FILES/ 
  56. [root@xifenfei RECOVERED_FILES]# ll 
  57. total 0 
  58. --未成功 

通过上述实验证明extundelete还是有很大的不完整性,基于整个磁盘的恢复功能较为强大,基于目录和文件的恢复还不够强大,不过该软件在很多时候还是有救火的功能,特别是当蛋筒的人员删除了数据库的部分文件之时.

      上一篇:整理的CentOS下将php和mysql命令加入到环境变量中的几种方法 下一篇:linux中extundelete恢复已删除的数据文件
    分享到:
    整理的CentOS下将php和mysql命令加入到环...
    Linux CentOS配置LAPM环境时,为了方便,将php和mysql命令加到系统环境命令,下面我们记录几种在linux下将php和mysql加入到环境变量中的方法. 如果在没有添加到环境变量之前,执行“php -v”命令查看当前php版本信息时时,则会提示命令不存在的错误,下面我们详细介绍一下在linux下将php和mysql加入到环境变量中的方法. ...
    linux中extundelete恢复已删除的数据文件
    extundelete就是用来恢复文件了,只要我们删除后的文件没有被覆盖就可以常用使用此工具来恢复了,下面来看个例子. 因为人员离职闹得不愉快,系统工程师离职后,由于公司未及时关闭其vpn,数据库服务器(Linux 6.5 Oracle 11.2.0.1)帐号未及时被修改,最后直接上去rm ORACLE_BASE给干掉,悲剧的是ORADATA目录也在里面,更加悲剧的...
    •         php迷,一个php技术的分享社区,专属您自己的技术摘抄本、收藏夹。
    • 在这里……