有惊无险,linux ext3文件夹误删恢复

就在1小时前,不小心删除了linux的一个文件夹,里面有5个php文件。网上google下。

Q: How can I recover (undelete) deleted files from my ext3 partition?

Actually, you can't! This is what one of the developers, Andreas Dilger, said about it:In order to ensure that ext3 can safely resume an unlink after a crash, it actually zeros out the block pointers in the inode, whereas
ext2 just marks these blocks as unused in the block bitmaps and marks the inode as "deleted" and leaves the block pointers alone.


Your only hope is to "grep" for parts of your files that have been deleted and hope for the best. (出自 http://batleth.sapienti-sat.org/projects/FAQs/ext3-faq.html )

开发人员都这么说了,一时找不到北。突然灵感一现,若我直接从硬盘中搜索再复制,文件不多只有5个,且都是文本文件,可能有用。我立刻从网上下了个winhex,winhex是我用到现在最好的hex文件编辑器,看了看那个硬盘文件debian.vdi,不大只有3.9G。

我想,这几个文件都是这两天新建的,那么逆向搜索应该更有效。于是回忆每个文件中的几个函数名function xxx( 逆向搜,发现了不少残本。也不管新旧,都复制过来。就这么不一会,5个文件都原原本本的找了回来。

真是有惊无险。
共2条评论
  1. yadandimao @ 2009-02-15 11:25:14 回复

    沙发 庆辛你没犯错

  2. JiangMiao @ 2009-02-16 05:13:35 回复

    @yadandimao 是啊,自从http://www.jiangmiao.org/blog/3.html经历了硬盘坏掉的事件,我稍微注意了一下,但好了伤疤忘了痛,多数已有仓库的代码还是1天commit1次。可如果上面的5个php没找回来,我要3天的代码白写了,正改变目录结构准备建仓库中..失手了。不晓得是不是上岁数的原因,现在出错率上去不少。

发表评论

电子邮件地址不会被公开。 必填项已被标记为 *

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>