xfs
[Top] [All Lists]

Re: Undelete Functions

To: David Lloyd <lloy0076@xxxxxxxxxxxx>
Subject: Re: Undelete Functions
From: Steve Lord <lord@xxxxxxx>
Date: Mon, 25 Jun 2001 06:35:07 -0500
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: Message from David Lloyd <lloy0076@rebel.net.au> of "Mon, 25 Jun 2001 19:07:04 +0930." <3B370640.A7CFE5BC@rebel.net.au>
Sender: owner-linux-xfs@xxxxxxxxxxx
Not really, log space is a circular buffer, and can be over written as soon
as the metadata itself has gone to disk. The file data itself is also not
protected against reuse. On a busy system the log can wrap several times a
second.

Steve

> 
> Hmmmm...
> 
> It strikes me that it would be easier to implement an undelete function
> using a journalling filesystem than not. I theorise that if you logged
> what you'd deleted, then a [relatively speaking] simple reverse run of
> the relevant log entries _might_ get you your file back.
> 
> Pseudo Code would be:
> 
> 1) extract from the log where foo file actually was
> 2) forcibly lock all those blocks/cylinders or whatever
> 3) put it back together
> 4) write foo_file somewhere else
> 
> Naturally because of the nature of the cached writing system and such
> it's not a guaranteed thing, but it would be better than having to
> wander around the file system following inodes etc manually...
> 
> DSL
> -- 
> "And the winner is
>    InUnifiedCanadianAboriginalSyllabics"
> - Larry Wall et al in Programming Perl



<Prev in Thread] Current Thread [Next in Thread>