I am working on parsing USN Journal files now, and what I know is that in USN Journal log entry, there is a mft_reference field, it references the corresponding FileRecord in MFT table.
After a period of time, the USN Journal files may accumulate quite lot of file change records, such as file adding, file modifying, file deleting.
If I just get a mft_reference number(64 bits integer) mft_refer_1
at the very beginning of the USN Journal file, and get another mft_reference number mft_refer_2
at the end of the USN Journal file, and they are equal in value, mft_refer_1 == mft_refer_2
Can I say the two journal records are specifying the same file?
What I am not quite sure is if an later added FileRecord will replace the position of a former deleted FileRecord.
Thank you in advance!
问问题
86 次
1 回答
1
我通过试验“fsutil usn”工具来解决这个问题;
首先我们应该知道 mft_refer 是如何组成的: 0xAAAABBBBBBBBBBBB,其中 AAAA 代表更新号,BBBBBBBBBBBB 代表文件记录索引到 MFT 表中。
首先我创建了一个名为“ daniel.txt ”的文本文档,发现它的 mft_refer 是0x00050000000c6c3f,
然后我把它删除到回收站,它的名字变成了类似“ $R2QW90X.txt ”的东西,但它的mft_refer仍然是0x00050000000c6c3f,
我从回收站中彻底删除它,并创建另一个名为“ daniel.txt ”的文档,现在新文档的 mft_refer 为0x00040000000c6c48,
然后我创建了几个其他临时文件,其中一个文件占用了0x00000000000c6c3f -th 文件记录,并更新了 mft_refer 0x00060000000c6c3f。
所以我的结论是文件记录空间在MFT中是非常宝贵的,如果之前的文件已经被彻底删除,那么文件记录空间将被回收用于新创建的文件,但会更新mft_refer中的“更新号”字段。
详细的实验过程见这里
于 2014-02-09T06:14:44.900 回答