<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9"> <TITLE>Linux Ext2fs Undeletion mini-HOWTO: Are there any tools to automate this process?</TITLE> <LINK HREF="Ext2fs-Undeletion-14.html" REL=next> <LINK HREF="Ext2fs-Undeletion-12.html" REL=previous> <LINK HREF="Ext2fs-Undeletion.html#toc13" REL=contents> </HEAD> <BODY> <A HREF="Ext2fs-Undeletion-14.html">Next</A> <A HREF="Ext2fs-Undeletion-12.html">Previous</A> <A HREF="Ext2fs-Undeletion.html#toc13">Contents</A> <HR> <H2><A NAME="s13">13. Are there any tools to automate this process?</A></H2> <P>As it happens, there are. Unfortunately, I believe that they currently suffer from the same problem as the manual inode modification technique: indirect blocks are unrecoverable. However, given the likelihood that this will shortly no longer be a problem, it's well worth looking these programs out now. <P>I have written a tool called <CODE>e2recover</CODE>, which is essentially a Perl wrapper around <CODE>fsgrab</CODE>. It makes a reasonable amount of effort to deal with zeroed indirect blocks, and seems to work fairly well as long as there was no fragmentation. It also correctly sets the permissions (and when possible the ownership) of recovered files, and even makes sure that recovered files have the correct length. <P>I originally wrote <CODE>e2recover</CODE> for the forthcoming major update to this Howto; unfortunately this means that much of the useful documentation for <CODE>e2recover</CODE> is scheduled for inclusion in that update. Be that as it may, it should be useful now; it can be downloaded from <A HREF="http://pobox.com/~aaronc/tech/e2-undel/">my web site</A>, and soon from Metalab. <P>Scott D. Heavner is the author of <CODE>lde</CODE>, the Linux Disk Editor. It can be used as both a binary disk editor, and as an equivalent to <CODE>debugfs</CODE> for ext2 and minix file systems, and even for xia file systems (though xia support is no longer available in 2.1.x and 2.2.x kernels). It has some features for assisting undeletion, both by walking the block list for a file, and by grepping through disk contents. It also has some fairly useful documentation on basic file system concepts, as well as a document on how to use it for undeletion. Version 2.4 of <CODE>lde</CODE> is available on <A HREF="http://metalab.unc.edu/pub/Linux/system/filesystems/lde-2.4.tar.gz">Metalab</A> and mirrors, or on <A HREF="http://www.geocities.com/CapeCanaveral/Lab/7731/lde.html">the author's web site</A>. <P>Another possibility is offered by the GNU Midnight Commander, <CODE>mc</CODE>. This is a full-screen file management tool, based AFAIK on a certain MS-DOS program commonly known as `NC'. <CODE>mc</CODE> supports the mouse on the Linux console and in an xterm, and provides virtual file systems which allow tricks like <CODE>cd</CODE>-ing to a tarfile. Among its virtual file systems is one for ext2 undeletion. It all sounds very handy, although I must admit I don't use the program myself -- I prefer good old-fashioned shell commands. <P>To use the undeletion feature, you have to configure the program with the <CODE>-</CODE><CODE>-with-ext2undel</CODE> option; you'll also need the development libraries and include files that come with the <CODE>e2fsprogs</CODE> package. The version provided in <A HREF="http://www.debian.org/">Debian GNU/Linux</A> is built in this way; the same may apply to packages for other Linux distributions. Once the program is built, you can tell it to <CODE>cd undel:/dev/hda5</CODE>, and get a `directory listing' of deleted files. Like many current undeletion tools, it handles zeroed indirect blocks poorly -- it typically just recovers the first 12k of long files. <P>The current version may be downloaded from <A HREF="ftp://ftp.nuclecu.unam.mx/Midnight/devel/">the Midnight Commander ftp site</A>. <P> <P> <HR> <A HREF="Ext2fs-Undeletion-14.html">Next</A> <A HREF="Ext2fs-Undeletion-12.html">Previous</A> <A HREF="Ext2fs-Undeletion.html#toc13">Contents</A> </BODY> </HTML>