Fsutil usn


Applies To: Windows Server 2003 R2,Windows 7,Windows Server 2003,Windows Vista,Windows Server 2000,Windows Server 2008,Windows Server 2008 R2

Manages the update sequence number (USN) change journal.

Syntax


Copy Code

fsutil usn [createjournal] m=<MaxSize> a=<AllocationDelta> <VolumePath>
fsutil usn [deletejournal] {/D | /N} <VolumePath>
fsutil usn [enumdata] <FileRef> <LowUSN> <HighUSN> <VolumePath>
fsutil usn [queryjournal] <VolumePath>
fsutil usn [readdata] <FileName>

Parameters

Parameter

Description

createjournal

Creates a USN change journal.

m=<MaxSize>

Specifies the maximum size, in bytes, that NTFS allocates for the change journal.

a=<AllocationDelta>

Specifies the size, in bytes, of memory allocation that is added to the end and removed from the beginning of the change journal.

<VolumePath>

Specifies the drive letter (followed by a colon).

deletejournal

Deletes or disables an active USN change journal.

Caution

Deleting the change journal impacts the File Replication service (FRS) and the Indexing Service, because it would require these services to perform a complete (and time-consuming) scan of the volume. This in turn negatively impacts FRS SYSVOL replication and replication between DFS link alternates while the volume is being rescanned.

/d

Disables an active USN change journal, and returns input/output (I/O) control while the change journal is being disabled.

/n

Disables an active USN change journal and returns I/O control only after the change journal is disabled.

enumdata

Enumerates and lists the change journal entries between two specified boundaries.

<FileRef>

Specifies the ordinal position within the files on the volume at which the enumeration is to begin.

<LowUSN>

Specifies the lower boundary of the range of USN values used to filter the records that are returned. Only records whose last change journal USN is between or equal to the LowUSN and HighUSN member values are returned.

<HighUSN>

Specifies the upper boundary of the range of USN values used to filter the files that are returned.

queryjournal

Queries a volume's USN data to gather information about the current change journal, its records, and its capacity.

readdata

Reads the USN data for a file.

<FileName>

Specifies the full path to the file, including the file name and extension For example: C:\documents\filename.txt

Remarks

Examples

To create a USN change journal on drive C, type:


Copy Code

fsutil usn createjournal m=1000 a=100 c:

To delete an active USN change journal on drive C, type:


Copy Code

fsutil usn deletejournal /d c:

To enumerate and list the change journal entries between two specified boundaries on drive C, type:


Copy Code

fsutil usn enumdata 1 0 1 c:

To query USN data for a volume on drive C, type:


Copy Code

fsutil usn queryjournal c:

To read the USN data for a file in the \Temp folder on drive C, type:


Copy Code

fsutil usn readdata c:\temp\sample.txt

Additional references

Command-Line Syntax Key

Fsutil