Fsutil: sparse

Manages sparse files A sparse file is a file with one or more regions of unallocated data in it. A program will see these unallocated regions as containing bytes with the value zero, but there is actually no disk space used to represent these zeros. In other words, all meaningful or nonzero data is allocated, whereas all non-meaningful data (large strings of data composed of zeros) is not allocated. When a sparse file is read, allocated data is returned as stored and unallocated data is returned, by default, as zeros, in accordance with the C2 security requirement specification. Sparse file support allows data to be de-allocated from anywhere in the file.


fsutil sparse [queryflag] PathName

fsutil sparse [queryrange] PathName

fsutil sparse [setflag] PathName

fsutil sparse [setrange] PathName BeginningOffset length


queryflag : Queries sparse.

queryrange : Scans a file looking for ranges that may contain nonzero data.

setflag : Marks the indicated file as sparse.

setrange : Fills a specified range of a file with zeroes.

PathName : Specifies the drive letter (followed by a colon), mount point, or volume name.

BeginningOffset : Offset within the file to mark as sparse.

length : Length of the region in the file to be marked as sparse, in bytes.


In a sparse file, large ranges of zeroes may not require disk allocation. Space for nonzero data will be allocated as needed as the file is written.

Only compressed or sparse files can have zeroed ranges known to the operating system.

If the file is sparse or compressed, NTFS may de-allocate disk space within the file. This sets the range of bytes to zeroes without extending the file size.


To mark a file as sparse, type:

fsutil sparse setflag C:\Temp\sample.txt


Fsutil: behavior

Fsutil: dirty

Fsutil: file

Fsutil: fsinfo

Fsutil: hardlink

Fsutil: objectid

Fsutil: quota

Fsutil: reparsepoint

Fsutil: usn

Fsutil: volume

Command-line reference A-Z

© 2016 Microsoft Corporation. All rights reserved. Contact Us |Terms of Use |Trademarks |Privacy & Cookies