Re: Serious 2.0 filesystem bug (was Re: recover deleted files?)

Tony Nugent (
Sun, 08 Dec 1996 17:03:09 +1000

On Sat Dec 07 1996, George Cserenyi wrote:

[Geez mate, you should have trimmed the To: and Cc: headers a bit
before you posted this. Eg, Linus didn't need to get a copy of it.]

> > > Using the "lsdel" command in debugfs, you can get a list of recently
> > > deleted files on the filesystem. Using the "modify_inode" command

> Where is the "lsdel" command and "debugfs"?

They are part of the e2fsprogs package, the latest version being 1.06.
You'll find it on

> > > (which granted is not very convenient if you want to undelete a lot of
> > > files), you can set the links_count field to 1, and then run e2fsck to
> > > recover the filesystem.

> > Midnight Commander's virtual undel filesystem makes doing this very easy.
> >
> Perhaps my MC is an old version, but I don't seem to find the "undel"
> command in it. What is the latest version, anyway?

The latest (non-development) version of mc is 3.2.11 (I think). I
wouldn't recommend the recent development versions unless you are into
looking at bugs and trying to fix them :)

(But the next public release of mc will knock people's socks off! :-)

You have to do the initial ./configure with `--with-undel' (see the
output of `./configure --help' for more details), and you MUST have
the e2fsprogs package installed as "development" (ie, install the
/usr/lib/libext2fs.* libraries and /usr/include header files, etc).
Then read the man page for how to use it.

> > > Note that due to a kernel limitation (which is lifted in the 2.1 kernels
> > > but which is present in 2.0 and older kernels) only the first 12k of a
> > > deleted file can be recovered in this way. Unfortunately, the way the
> > > unlink code worked in the 2.0 kernels destroyed the indirect block
> > > information.

I'm going to lobby really hard to get something done about this. And
if all else fails, I'm going to put together my own patch to overcome
this ugly limitation of the 2.0 kernels. Stay tuned.