Re: Deleted files recovery

david parsons (o.r.c@p.e.l.l.p.o.r.t.l.a.n.d.o.r.u.s)
11 Sep 1998 16:15:54 -0700


In article <linux.kernel.19980910123805.P27562@pointer.teuto.de>,
=?iso-8859-1?Q?Lars_Marowsky-Br=E9e?= <lmb@pointer.teuto.de> wrote:
>On 1998-09-10T10:18:23,
> Harald Hoyer <HarryH@Royal.Net> said:
>
>> > > Deleted file recovery is a MUST !
>>
>> I agree!
>> I like the idea of having a directory .deleted in every directory.
>
>This is called "backup plan" and "not deleting files in the first place".

That's not sufficient for many uses; doing `rm -f * .c' in the wrong
place at the wrong time won't do you any good if you have nightly
backups (or cvs, or both) but do this after you've spent all day
editing the file.

My informal undelete solution is to turn the power off (or hit the
reset or suspend switch) as soon as I realize I made a stupid
mistake. This works for me about 70% of the time (5 seconds is a
_really_ long time after you've wipe out a module you've been working
on for 18 hours.) though it didn't help the time I miscoded something
in McAfee's Virus Scan and ended up eating /home/orc on my development
laptop [thank goodness for the ext2fs editor.]

A better solution (that I may have mentioned here) that's pretty
cheap to implement is to allow whiteout entries in directories; when
you delete a file (as opposed to overwriting it, which Can Be Bad
Too), check to see if the directory has the undelete attribute,
and if it does (finding the filename got you the directory free
of charge), just set the whiteout flag and return. I tried to
implement this with ext2, but stumbled on the small detail that
directories don't have room for flags (plus delete dates) like
this; I'm now waiting for reiserfs to be released so I can play with
a filesystem where breaking it won't eat any filesystem it touches.

This thing needs to have a tool that can manipulate whiteout entries,
and a daemon that can reap whiteout entries when the disk gets full,
but those are pretty trivial compared to keeping and having to
rewrite applications to understand .deleted directories (when talking
about tweaking filesystem intrinsics, userspace solutions suck on
monolithic kernels.)

____
david parsons \bi/ chattr +undelete /home/orc
\/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/faq.html