Retaining undelete data on ext3

Theodore Tso tytso at mit.edu
Sun Sep 24 19:53:19 UTC 2006


On Sun, Sep 24, 2006 at 10:55:10AM -0700, Stephen Samuel wrote:
> Having just spent a day trying to recover a deleted ext3 file
> for a friend, I'm wondering about this way of maintining
> undelete information in ext3, like is done for ext2:
> 
> The last step in the deletion process would be to put back
> the (previously zeroed) block pointers.  Since it gets logged
> to the journal, I _think_ that this should be safe.  The worst
> that would happen is that, if the plug gets pulled in the
> middle of a file delete, the old block pointers would be
> unavailable --  I don't see this as a killer issue, since
> editing the filesystem to do an undelete should be considered an
> emergency operation anyways.

Yep, that's what would have to be done.  The other caveat is that
storing all of the previously zeroed block pointers temporarily in
memory could take quite a bit of memory, especially if what is being
deleted is really big.  Consider that if a DVD iso image file is being
deleted, betewen 4 and 5 megabytes of non-swappable (and on x86, it
would have to be lowmem/ZONE_NORMAL) kernel memory would be required!
Of course, storing the information as a series of extents would be an
obvious optimization, which would work on all but a very badly
fragmented file (for example, if said DVD .iso image was created when
the filesystem was close to 100% full).  

The are some other ways it could be done that would be more optimized,
but the bottom line is that main reason why it hasn't be done is
because the people who could do it haven't had the time to implement
it.  We've been working on other features that are higher priority,
either for ourselves or for our employers.

Regards,

						- Ted




More information about the Ext3-users mailing list