I remember an not very old mail of Linus about this, but I can' t
reproduce it myself.
On Thu, 10 Jul 1997, Linus Torvalds wrote:
>Actually, because the minixfs didn't bother to write out the inodes after
>it deleted them, it was _very_ simple to recover from "rm -rf". I've
>actually done this once when I removed my linux source directory by
>mistake once:
>
> - find the inode that was the "linux" directory inode (not very hard:
> because the inode was never written out when it was deleted, all the
> information was still up-to-date)
I can find it using debugfs with lsdel command.
> - create a new directory entry pointing to the "linux" inode
????? How can I do it ????? Using debugfs ?????
> - run fsck
Easy :).
>
>Voila, the _whole_ tree came back. NOTHING was lost. Because the inode
>wasn't actually written out to disk when it was deleted, all the
>information was still there: including the full directory tree (because
>the data blocks were also marked clean when they were deleted, so all the
>directory entry zeroing that had happened recursively never hit the disk
>at all).
Can somebody explain me how can I create a new directory entry pointing to
the old "directory_deleted" inode?
If I run mkdir inside debugfs the inode number is selected by debugfs.
Using the mi command inside debugfs I can' t change the inode number.
Thanks in advance for any help...
Andrea Arcangeli