1.extundelete的恢复原理

extundelete恢复文件时并不依赖特定文件格式,首先extundelete会通过文件系统的inode信息,来获得当前文件系统下所有文件的信息,包括存在的和已经删除的文件,这些信息包括文件名和inode。然后利用inode信息结合日志去查询该inode所在的block位置,包括直接块,间接块等信息。最后利用dd命令将这些信息备份出来,从而恢复数据文件。

2.extundelete的安装

环境:redhat6.5

extundelete官方地址:https://sourceforge.net/projects/extundelete/

安装依赖包

  1. [root@server1 ~]# yum install e2fsprogs e2fsprogs-libs e2fsprogs-devel -y

解压官方网站下载的安装包,最新版本是extundelete-0.2.4

  1. [root@server1 ~]# ls
  2. a.png extundelete-0.2. extundelete-0.2..tar.bz2 getrandom.sh test.rrd
  3. [root@server1 ~]# cd extundelete-0.2.
  4. [root@server1 extundelete-0.2.]# ./configure
    [root@server1 extundelete-0.2.4]# make
    [root@server1 extundelete-0.2.4]# make install
    [root@server1 extundelete-0.2.4]# which extundelete
    /usr/local/bin/extundelete

安装过程很简单。

3.extundelete的使用

3.1:我们的操作环境如下:   

  1. [root@server1 ~]# mount /dev/vdb1 /test/
  2. [root@server1 ~]# cp /etc/passwd /test/
  3. [root@server1 ~]# cp -r /etc/yum /test/
  4. [root@server1 ~]# mkdir /test/dirtest
  5. [root@server1 ~]# echo hello > /test/dirtest/test.file
  6. [root@server1 ~]# md5sum /test/passwd
  7. 499b16cbdef03e814f3405fccd188dcc /test/passwd
  8. [root@server1 ~]# md5sum /test/dirtest/test.file
  9. b1946ac92492d2347c6235b4d2611184 /test/dirtest/test.file
  10. [root@server1 test]# rm -rf *

3.2:删除数据之后,首先卸载这块磁盘分区,以防止磁盘重新读写。

  1. [root@server1 test]# cd /mnt/
  2. [root@server1 mnt]# umount /test/

3.3:extundelete恢复的一些操作

3.3.1:查询可恢复数据信息。

  1. [root@server1 mnt]# extundelete /dev/vdb1 --inode
  2. ......
  3. File name | Inode number | Deleted status
  4. .
  5. ..
  6. lost+found Deleted
  7. passwd Deleted
  8. yum Deleted
  9. dirtest Deleted

3.3.2:恢复单个文件。

  1. [root@server1 mnt]# extundelete /dev/vdb1 --restore-file passwd
  2. NOTICE: Extended attributes are not restored.
  3. Loading filesystem metadata ... groups loaded.
  4. Loading journal descriptors ... descriptors loaded.
  5. Successfully restored file passwd

恢复成功后会在当前目录下创建RECOVERED_FILES用于存放恢复的文件:通过md5校验,说明我们的数据恢复成功。

恢复单个目录:

  1. [root@server1 mnt]# extundelete /dev/vdb1 --restore-diretory /yum

恢复所有文件

  1. [root@server1 mnt]# extundelete /dev/vdb1 --restore-all

恢复某个时间段的数据:

extundelete提供了--after 和 --before 参数可以指定恢复某个时间段内的数据。

  1. [root@server1 mnt]# extundelete --after /dev/vdb1 --restore-all

更多的操作可以使用 extundelete --help 来查看。

数据恢复工具--extundelete的安装与使用的更多相关文章

  1. Linux中如何恢复rm命令误删除的文件之extundelete编译安装及使用

    1.下载extundelete包,安装依赖 我用的是Centos系统,在安装extundelete之前需要安装e2fsprogs,e2fsprogs-libs,e2fsprogs-devel. yum ...

  2. Ext分区文件恢复工具extundelete

     Ext分区文件恢复工具extundelete Ext是延伸文件系统(Extended system)的缩写.它是为Linux内核开发的第一个文件系统.它有多个版本.现在常见的是Ext3和Ext4.由 ...

  3. 11款最棒的Linux数据恢复工具

    无论你使用的是台式电脑还是笔记本,需要关注的重点之一都是如何保护好你的宝贵数据.因为总会有各种突发情况使你的系统崩溃,然后你要做的就是恢复数据.不管你怎么想,要是我失去了所有的数据却无法恢复的话,我会 ...

  4. Linux下常用的数据恢复工具

    一.数据删除 命令:rm -rf,将任何数据直接从硬盘删除,且没有任何提示 建议做法: 把命令参数放到后面:rm -rfi 将删除的东西通过mv命令移动到系统下的/temp目录下,然后写个脚 本定期执 ...

  5. php通用安装程序,导入数据文件(.sql)的安装程序

    php通用安装程序,导入数据文件(.sql)的安装程序 该程序只需要1个php文件 和 1个数据文件,很方便调用.install/index.php         程序文件install/mycms ...

  6. 数据可视化工具zeppelin安装

    介绍 zeppelin主要有以下功能 数据提取 数据发现 数据分析 数据可视化 目前版本(0.5-0.6)之前支持的数据搜索引擎有如下 安装 环境 centOS 6.6 编译准备工作 sudo yum ...

  7. 【优秀的iPhone/iPad数据恢复工具】Omni Recover for Mac 2.5

    [简介] 今天和大家分享最新的 Omni Recover for Mac 2.5 版本,这是一款Mac上优秀的iPhone/iPad设备数据恢复工具,支持恢复误删除的短信.照片.视频.文档.通话记录等 ...

  8. 数据恢复工具PhotoRec

    数据恢复工具PhotoRec PhotoRec是一款文件恢复工具.它可以从硬盘.光驱.记忆卡中恢复视频.文档.压缩包等文件.该工具绕开文件系统,采用文件特征码机制,直接进行底层数据扫描,尝试恢复文件. ...

  9. 大数据(9) - Flume的安装与使用

    Flume简介 --(实时抽取数据的工具) 1) Flume提供一个分布式的,可靠的,对大数据量的日志进行高效收集.聚集.移动的服务,Flume只能在Unix环境下运行. 2) Flume基于流式架构 ...

随机推荐

  1. linux安装elasticsearch-head和elasticsearch-analysis-ik及遇到的各种问题

    1.获取elasticsearch-head http://mobz.github.io/elasticsearch-head/ 下载并解压 wget https://github.com/mobz/ ...

  2. sass compass config.rb

    require 'compass/import-once/activate' # Require any additional compass plugins here. # Set this to ...

  3. jquery 获取表单的内容以JSON对象形式返回

    添加一个serializeJson方法 <!DOCTYPE html> <html> <head> <meta charset="UTF-8&quo ...

  4. Python _Mix*9

    1. 函数 函数是对功能的封装 语法: def 函数名(形参列表): 函数体(代码块) 代码块中有可能包含return 调用: 函数名(实参列表) def mix(a,b): #def 函数名(a和b ...

  5. [Leetcode 105]*前序后序遍历形成树

    public TreeNode find(int[] preorder, int[] inorder,int j, int start, int end) { if (j > preorder. ...

  6. css实现半圆和圆

    1.半圆 半圆分为:上半圆.下半圆.左半圆.右半圆,我们只要学会制作某一个方向的半圆,其他方向的半圆都可以轻松实现,其原理都一样. 假如我们要制作上半圆,实现原理:把高度height设置为宽度widt ...

  7. String 类型equals方法和int == 方法效率比较

    最近写了一个递归方法,在进行比较判断的时候,因为都是integer类型,而integer类型在大于127或者小于-128时会在新建一个,这是因为integer类型的拆装箱机制, 之前没有考虑过equa ...

  8. Problem D: 类的初体验(IV)

    Description 定义一个类Data,只有一个int类型的属性和如下方法: 1.   缺省构造函数,将属性初始化为0,并输出"Data's default constructor.&q ...

  9. leetcode题解 1.TwoSum

    1. Two Sum Given an array of integers, return indices of the two numbers such that they add up to a ...

  10. pycharm 设置参数,快捷键

    pycharm 设置参数 当编写代码的时候出现红色下划线提示,表示有异常,此时需要导入此模块 参数设置 设置完参数之后执行一下看看效果 这里面0为脚本本身,1为刚才设置的参数hello 快捷键设置 常 ...