使用 ext3grep 恢复数据试验成功 笔记
 
来源:  Linux论坛  日期: 2009.07.07 10:03 (共有条评论)  我要评论
 
# software download address : [url]http://code.google.com/p/ext3grep/downloads/list[/url]
# 1、安装 cd /opt wget [url]http://ext3grep.googlecode.com/files/ext3grep-0.10.1.tar.gz[/url] tar -zxf ext3grep-0.10.1.tar.gz cd ext3grep-0.10.1 ./configure make make install
# 2、制造分区 mkdir /home/sheng cd /home/sheng dd if=/dev/zero of=file count=102400 mkfs.ext3 file # !!!!按Y继续 mount -o loop /home/sheng/file /mnt/
# 可以看到已经挂上去了 df -h
# 写入数据到 /mnt mkdir /mnt/del echo 1 > /mnt/del/1 echo 2 > /mnt/del/2 echo 3 > /mnt/del/3
# 删除数据 rm -rf /mnt/del
# 3、开始恢复 # 卸载文件所在的分区 /home/sheng/file umount /home/sheng/file # 查看 df -h
# 扫描分区 ext3grep /home/sheng/file --ls --inode 2
- - - - -
[root@db1 sheng]# ext3grep /home/sheng/file --ls --inode 2 Running ext3grep version 0.10.1 Number of groups: 7 Loading group metadata... done Minimum / maximum journal block: 447 / 4561 Loading journal descriptors... sorting... done The oldest inode block that is still in the journal, appears to be from 12454502                                                                                             09 = Sat Jun 20 06:23:29 2009 Number of descriptors in journal: 17; min / max sequence numbers: 2 / 3 Inode is Allocated Finding all blocks that might be directories. D: block containing directory start, d: block containing more directory entries. Each plus represents a directory start that references the same inode as a direc                                                                                             tory start that we found previously.
Searching group 0: DDD++ Searching group 1: Searching group 2: Searching group 3: Searching group 4: Searching group 5: Searching group 6: Writing analysis so far to 'file.ext3grep.stage1'. Delete that file if you want                                                                                              to do this stage again. Result of stage one:   3 inodes are referenced by one or more directory blocks, 2 of those inodes are                                                                                              still allocated.   1 inodes are referenced by more than one directory block, 1 of those inodes is                                                                                              still allocated.   0 blocks contain an extended directory. Result of stage two:   2 of those inodes could be resolved because they are still allocated. All directory inodes are accounted for!
Writing analysis so far to 'file.ext3grep.stage2'. Delete that file if you want                                                                                              to do this stage again. The first block of the directory is 433. Inode 2 is directory "". Directory block 433:           .-- File type in dir_entry (r=regular file, d=directory, l=symlink)           |          .-- D: Deleted ; R: Reallocated Indx Next |  Inode   | Deletion time                        Mode        File nam                                                                                             e ==========+==========+----------------data-from-inode------+-----------+========                                                                                             =    0    1 d       2                                         drwxr-xr-x  .    1    2 d       2                                         drwxr-xr-x  ..    2  end d      11                                         drwx------  lost+fou                                                                                             nd    3  end d    5497  D 1245450214 Sat Jun 20 06:23:34 2009  drwxr-xr-x  del [root@db1 sheng]#
- - - - -
# 查询 ext3grep /home/sheng/file --ls --inode 2
# 恢复单个 仅目录 里面的文件恢复失败 .. ext3grep /home/sheng/file --restore-file del --depth del
# 恢复目录里面的一个文件 ext3grep /home/sheng/file --restore-file del/1
# 恢复所有文件 ext3grep /home/sheng/file --restore-all

点击下载软件:ext3grep
1. 查看所需的相关库
[root@ns2 ~]# rpm -qa |grep e2fsprogs
e2fsprogs-libs-1.39-8.el5
e2fsprogs-1.39-8.el5
e2fsprogs-devel-1.39-8.el5

注:RHEL4下没有libs程序,但依然可以安装ext3grep 0.7.0 必须要有e2fsprogs-libs,不然在后面ext3grep的安装会有问题。
2.查看一下分区情况: [root@ns2 ~]# df –h

3. 需要软件 http://code.google.com/p/ext3grep/downloads/list 先下载软件 [root@ns2 ~]# cd /root/src/ [root@ns2 src]#  wget  http://ext3grep.googlecode.com/files/ext3grep-0.6.0.tar.gz  src 注:作者已下载过不再下载
4.安装ext3grep A.先挂载光盘

B.安装步骤:  1.[root@ns2 ~]# tar zxvf ext3grep-0\[1\].10.1.tar.gz  –C  /usr/src  <将文件解压到/usr/src目录下> 2.[root@ns2 ~]# cd /usr/src/ext3grep-0.10.1 ->  <进入目录中> 3.[root@ns2 ~]#  ./configure      <配置> 4.[root@ns2 ~]# make && make install  <编译并安装>

5.为方便实验,我们可以模拟一个出来,下面是模拟步骤: a.      #  mkdir  /data/ b.      #  cd /data/ c.      #  dd  if=/dev/zero  of=disk1  count=2048000 d.      #  mkfs.ext3  disk1 e.      #  mkdir  -p  /dfs/a f.       #  mount  -o  loop  /data/disk1  /asd/a

如图,已建立一个模拟分区/data/disk1
6./asd/a下新建文件beijing shanghai
7.后将beijingshanghai 文件删除

8. 文件没有了然后我们来恢复: 首先必须umount掉误删除数据的分区: [root@ns2 ~]# umount /data/disk1 [root@ns2 ~]# df –h

9. 确认卸载,然后使用ext3grep来恢复。 [root@ns2 ~]# ext3grep  /data/disk1  --ls  --inode 2 这里会创建扫描分区

从图中可以看到被删除的beijing,shanghai两个文件
10.恢复数据 [root@ns2 ~]# ext3grep  /data/disk1 --restore-file  shanghai
数据成功恢复 [root@ns2 ~]# ext3grep  /data/disk1 --restore-file  Beijing
11.[root@ns2 ~]# ls -la RESTORED_FILES/

注:被恢复的数据默认恢复到RESTORED_FILES/目录下
12.在RESTORED_FILES下的成功恢复的文件或目录可以做任意操做,作者将其又放回到了原位置

注:至此所有操做已做完,如果数据在其他分区中,同样卸载误删除数据的分区,执行和以上操作相同的恢复步骤!

使用 ext3grep 恢复数据试验成功 笔记的更多相关文章

  1. MySQL学习(三)主备分库分表和恢复数据 --- 2019年2月

    1.MySQL主备切换 readonly 设置对超级(super)权限是无效的,而用于同步更新的线程,就拥有超级权限. 建议在做主备数据库的时候,将备用数据库设置为只读.(反向用readonly来判断 ...

  2. Ubantu 使用extundelete恢复数据

    所以在维护系统的时候,要慎之又慎,但是有时难免会出现数据被误删除的情况,在这个时候改如何快速.有效地恢复数据呢?本文我们就来介绍一下Linux系统下常用的几个数据恢复工具. 一.如何使用“rm -rf ...

  3. Linux误删文件后恢复数据

    在Linux下,基于开源的数据恢复工具有很多,常见的有debugfs.R-Linux.ext3grep.extundelete等,比较常用的有ext3grep和extundelete,这两个工具的恢复 ...

  4. ORACLE恢复数据

    ORACLE恢复删除表或表记录 一:表的恢复      对误删的表,只要没有使用PURGE永久删除选项,那么从flash back区恢复回来希望是挺大的.一般步骤有: 1.从flash back里查询 ...

  5. 不小心删除数据--利用MySQL的binlog恢复数据

    MySQL Binary Log也就是常说的bin-log, ,是mysql执行改动产生的二进制日志文件,其主要作用有两个: * 数据回复 * 主从数据库.用于slave端执行增删改,保持与maste ...

  6. mysql使用二进制日志恢复数据

    一.恢复到某个二进制文件 1.开启二进制日志 在mysqld的配置节点下添加如下配置 log-bin="E:/Mysql57BinLog/binlog"(windows下的路径,l ...

  7. 转:SqlServer2008误操作数据(delete或者update)后恢复数据

    Sqlserver2008误操作数据(delete或者update)后恢复数据(转) 实际工作中,有时会直接在数据库中操作数据,比如对数据进行delete或者update操作,当进行这些操作的时候,如 ...

  8. SqlServer2008误操作数据(delete或者update)后恢复数据

    实际工作中,有时会直接在数据库中操作数据,比如对数据进行delete或者update操作,当进行这些操作的时候,如果没有加上where条件或者where条件不合理,那么导致的结果可想而知,如果操作的又 ...

  9. 金蝶KIS专业版替换SXS.dll 遭后门清空数据被修改为【恢复数据联系QQ 735330197,2251434429】解决方法 修复工具。

    金蝶KIS专业版 替换SXS.dll 遭后门清空数据(凭证被改为:恢复数据联系QQ 735330197,2251434429)恢复解决方法. [客户名称]:山东青岛福隆发纺织品有限公司 [软件名称]: ...

随机推荐

  1. 第六篇:web之python框架之django

    python框架之django   python框架之django 本节内容 web框架 mvc和mtv模式 django流程和命令 django URL django views django te ...

  2. php快速定位多维数组的深度

    原文地址:php快速定位多维数组的深度作者:陌上花开 自定义一个函数: function array_depth($array)  { $max_depth = 1; foreach ($array ...

  3. spring security 11种过滤器介绍

    1.HttpSessionContextIntegrationFilter 位于过滤器顶端,第一个起作用的过滤器. 用途一,在执行其他过滤器之前,率先判断用户的session中是否已经存在一个Secu ...

  4. 自己做的demo---宣告可以在java世界开始自由了

    package $interface; public interface ILeaveHome { public abstract int a(); public abstract int b(); ...

  5. [原创]ie6,7中td和img之间有间隙

    情形描述 开发工具:VS2010: 浏览器版本:IE6以上,火狐,谷歌: 页面布局设计:Table+Img布局: 项目预览问题:火狐,谷歌,IE8以上未出现问题,IE6,IE7图片之间有间隙. 分析原 ...

  6. Windows环境下使用cygwin ndk_r9c编译FFmpeg

     一.废话 最近学习,第一步就是编译.我们需要编译FFmpag,x264,fdk_aac,一步步来.先来讲一下FFmpeg,网上说的很多都是几百年前的,我亲测完美可用 联系我可以直接评论,也可以加我Q ...

  7. jsp - forward指令

    forward指令 既可以指向静态的html页面,也可以转发到动态的jsp页面,并可以保留先前请求的参数. 例如,在web中新建一个Jsp_src.jsp的jsp页面: <%@ page lan ...

  8. Jsoup解析HTML、加载文档等实例

    一.引入jsoup的jar包:http://jsoup.org/download 补充:http://jsoup.org/apidocs/   Jsoup API    可以了解更详细的内容 二.Js ...

  9. Maven3(笔记一)

    第一节:Maven 简介 百度百科:Maven 官网:http://maven.apache.org/ 第二节:Maven 安装与配置 Maven 下载:http://maven.apache.org ...

  10. JAVA zip解压 MALFORMED 错误

    最近在在使用zip 解压时,使用JDK1.7及以上版本在解压时,某些文件会报异常 Exception in thread "main" java.lang.IllegalArgum ...