query about ext2 unlinking strategy

Aaron Crane (AC8@soas.ac.uk)
Thu, 7 Nov 1996 19:32:14 GMT


I have a question about what happens when you unlink a file in ext2. From
empirical observation (the kernel code is pretty much a closed book to me)
I have (?)discovered that when you unlink the last link to a file, among
the things that happen is that any indirect blocks are zeroed. Why is
this? It makes it pretty hard to undelete. (Yes, it was a foolhardy rm -r
as root. :( I got back something like 93% of the files intact, though :)

What would happen if the indirect blocks were merely marked as free and not
zeroed?

This could well be a dumb newbie question. I'm happy to take it off
line to avoid clogging bandwidth if anyone wants to offer to enlighten me.

AdvTHANKSance.
-- Aaron Crane <aaronc@pobox.com>
If vegetarians eat vegetables, what about humanitarians?
** Legal Warning: Anyone sending me unsolicited commercial email WILL be **
***** charged a proof-reading fee of 100 pounds sterling per message. *****