USN日志USN Journal)是NTFS的一个特性,全称Update Sequence Number Journal(更新序列号码日志),或称更改日志(Change Journal)[1],它维护一个对英语Volume (computing)已做更改的记录。注意不要与NTFS文件系统的日志设计混淆。

Windows 2000发布时,微软提供了NTFS 3.0版,其中包含众多新的特性和改进。自Windows 2000起,可以设置在NTFS分区上跟踪该卷的文件和目录的更改,提供各种对象在何时、做了何种更改的记录。在该功能启用后,系统将在该卷的USN日志中记录对该卷的更改。

每个NTFS卷的日志维护并存储在名为$Extend\$UsnJrnl的NTFS元文件中。它最初会是一个空文件。每当对该卷进行更改时,一条记录就被添加到该文件。每条记录以一个64位元更新序列号码(简称USN)标识。更改日志中的每条记录都包含USN(即号码)、文件的名称,以及有关此更改的信息。

更改日志使用位元标志描述所关联的更改(例如USN_REASON_DATA_OVERWRITE[2]),因此它并不包含与更改相关的所有数据或详细信息。因而,更改日志不能用于撤销NTFS中对文件的操作。

使用 编辑

Windows 8中引入的文件历史记录使用USN日志测定上次备份以来哪些文件已被更改,以便仅将已更改的文件添加到历史记录。[3]

Everything桌面文件搜索程序也是利用USN日志来跟踪文件变动来实现在占用较少运行空间的情况快速搜索。

参考资料 编辑

  1. ^ Cooperstein, Jeffrey. Keeping an Eye on Your NTFS Drives: the Windows 2000 Change Journal Explained. Microsoft Systems Journal (MSJ). Microsoft Corporation. September 1999 [10 June 2009]. (原始内容存档于2017-09-12). 
  2. ^ USN_RECORD_V2 structure. Microsoft Developer Network. Microsoft Corporation. [2014-11-06]. (原始内容存档于2017-02-23). 
  3. ^ Bright, Peter. A step back in time with Windows 8′s File History. Ars Technica. [2 February 2014]. (原始内容存档于2021-11-23). 

外部链接 编辑

  • Change Journals (Windows). Microsoft Developers Network Library, Win32 and COM Development, Volume Management. Microsoft Corporation. [10 June 2009]. (原始内容存档于2011-01-17). 
  • FSUTIL: USN. Windows XP Professional Product Documentation. Microsoft Corporation. [10 June 2009]. (原始内容存档于2018-01-14). 
  • FSUTIL: USN. Microsoft Technet Library, Windows Server Tech Center. Microsoft Corporation. 28 September 2007 [10 June 2009]. (原始内容存档于2017-08-26). 
  • NTFS Self-Healing. Microsoft Technet Library, Windows Server Tech Center. Microsoft Corporation. 21 January 2008 [10 June 2009]. (原始内容存档于2017-08-26).