[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: undelete - xfsrecover'ing deleted files in xfs
Andi Kleen wrote:
>On Fri, Feb 01, 2002 at 01:02:58PM -0600, Steve Lord wrote:
>
>>>When you can find the inode of the deleted file again and its extent btrees
>>>are not destroyed it should be possible to reconnect it to a directory.
>>>
>>Unfortunately when we free an inode we also remove all the extents from
>>it. So even if those extents used to be in the inode, they are not there
>>now. The reason this happens is that deleting a file is an unbounded
>>
>
>I see. The extents would be in a btree which would be likely rebalanced
>on the extent freeing and that would destroy them because they're inline
>in the btree. Is that correct?
>
Well, how deep do you want to go ;-)
For a file with a few extents the extents are held in the inode, we
then move to a
single block, and then to a btree of blocks. There are also two forks -
one for data
and one for extended attributes if you have them. Most files probably
fit inside the
inode - default inode size is 256 bytes, there is room for about 8
extents in there
I think, each extent takes 16 bytes of space.
As the extents are freed they get removed from the inode and placed
back into
the free space btrees of the allocation group in the filesystem they
are located
in - insertion into this tree can mean they get merged with surrounding
free
space. So the inode is generally stamped on as space is removed - various
memmove operations take place, and the free space is fare game for any
subsequent allocation for which it is a good match.
The memmoves as stuff is deleted probably really mess things up.
Steve
>
>
>Thanks,
>-Andi
>