Re: undelete?

Kurt Huwig (
Sat, 26 Jul 1997 14:01:57 +0200 (CEST)

On 26 Jul 1997, david parsons wrote:
> Kurt Huwig <> wrote:
> >Is anyone working on an 'undelete'-feature for ext2 or better any
> >filesystem? I don't need 'rm' replacements, because I want to undelete
> >files deleted by samba.
> >
> >The easiest solution might by a fs on top of another fs that is fully
> >transparent, but replaces 'delete' by a move into a certain directory.
> >
> >I heard that there was a thread about ext2 deletion. What about really
> >deleting the stuff 60 seconds later? Often you realize your mistake just
> >in the moment of pressing 'enter'.
> That's not the way I'd do it; if you have a timed delete, you need to
> keep timers running, and that seems like it might be a less than optimal
> way to implement such a thing. I think the easiest way to implement
> undelete would be to set up a scheme for doing whiteout on directory
> entries; when you remove() (or unlink()?) a file, instead of killing
> the directory entry it will simply white that entry out, for reaping by
> a daemon at some later date (or recovery by undelete.) This way you
> don't muck with the fs semantics of ext2, but simply implement a few
> user-space daemons to do the proper bookkeeping on the filesystem.

I had a somehow good response from Pavel:
"Just hit reset before bdflush writes it to disk!"

So, wouldn't this be an ideal place for this? If we have an update
interval of 60 seconds, then we place every 'delete' into the second
update from now. So we give a minimum recovery-time of 60 seconds up to
119 seconds.

Still, this wouldn't fix the problem when a user comes to the
administrator and says 'I just deleted the wrong file. Can I have it

If a filesystem is full, then it is full and you cannot undelete any file.
BUT in most 'real life companies' (not on my hd) there is always space
left on the HD, i.e. the admin panics if space drops below 20%. The reason
for this is, a full filesystem is ""read-only"" and noone can continue his

Indeed, this creates need for a 'de-fragmentation-tool' for Linux. I tried
defrag-0.6, but it simply crashed (I know that ext2 doesn't want to


Let me make myself perfectly clear: Step 1: Find plan!
Step 2: Save world!
Let's get crackin'... Step 3: Get outta my house!