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

Tony Nugent (
Sat, 07 Dec 1996 19:53:09 +1000

On Wed Dec 04 1996, "Theodore Y. Ts'o" wrote in linux-kernel:

> Using the "lsdel" command in debugfs, you can get a list of recently
> deleted files on the filesystem. Using the "modify_inode" command
> (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.

> 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.

This, IMHO, is a VERY serious bug in the 2.0 kernels!

Is this fixed in 2.0.27?

If not, then is it planned to fix this in a 2.0.28 release?

Do you have a patch that will fix this problem for the 2.0 kernels?

Can you indicate which 2.1 kernel fixed this bug? If there is no
patch available and no fix planned, then I'd like to dig it out of the
2.1 patch and try to apply it to 2.0.27 myself. (If there are any
cravats to changing the 2.0 kernel's unlink code to the same as 2.1,
then I'd appreciate any warnings that you may have about making and
using such a patch).

I haven't "graduated" to 2.1 yet (and I'm not in any hurry to - I need
stability at the moment, and I have found that the 2.0.2x kernels are
*exceptionally* stable under heavy load).

However, I very much value the ability to fully recover any files that
I might accidently delete (not that I've had any need to do this
recently, thank god! :)

Thanks Ted.