The FSUTIL.EXE utility allows you to perform various tasks of viewing and managing the settings of the FAT, NTFS and REFS file systems on Windows operating systems. You can use fsutil to manage files, file system settings, quota and hard links management, check sparse files and managing sparse files, check the free space, manage the file system recovery options, etc. When changing file system settings, changes are being made to the registry and will be applied after Windows restarts. In this article, we will take a look at the basic examples of using the FSUTIL utility to manage and restore the file system in Windows.
Running FSUTIL command
The Fsutil utility must be run from an elevated command line (as an administrator). When started without parameters, the Fsutil tool displays a list of supported commands:
- 8dot3name — 8dot3name management;
- Behavior — Control file system behavior;
- dax — Dax volume management;
- dirty — Manage volume dirty bit;
- file — File specific commands;
- fsInfo — File system information;
- hardlink — Hardlink management;
- objectID — Object ID management;
- quota – Quota management;
- repair — Self-healing management;
- reparsePoint — Reparse point management;
- resource — Transactional Resource Manager management;
- sparse — Sparse file control;
- tiering — Storage tiering property management;
- transaction — Transaction management;
- usn — USN management;
- volume — Volume management;
- wim — Transparent wim hosting management.
For more help on fsutil subcommands and their parameters, use the syntax:
fsutil subcommand [… subcommand] [parameters]
Getting information about the file system
To get information about the file system, use the command:
The following subcommands are available:
- drives — List all drives (drive letters are displayed, including for removable, network attached and created by the SUBST command);
- driveType — Query drive type for a drive;
- ntfsInfo — Query NTFS specific volume information;
- refsInfo — Query REFS specific volume information;
- sectorInfo — Query sector information;
- statistics — Query file system statistics;
- volumeInfo — Query volume information.
For example, display the drive type:
fsutil fsinfo Drivetype C:\
In our case the drive C:\ is a locally mounted fixed drive.
And file system information on drive C:\:
fsutil fsinfo ntfsinfo c:
NTFS Volume Serial Number : 0x76cc3ff8cc3fb16b
NTFS Version : 3.1
LFS Version : 2.0
Number Sectors : 0x0000000009f047ff
Total Clusters : 0x00000000013e08ff
Free Clusters : 0x00000000002804ca
Total Reserved : 0x000000000000c863
Bytes Per Sector : 512
Bytes Per Physical Sector : 512
Bytes Per Cluster : 4096
Bytes Per FileRecord Segment : 1024
Clusters Per FileRecord Segment : 0
Mft Valid Data Length : 0x0000000013c00000
Mft Start Lcn : 0x00000000000c0000
Mft2 Start Lcn : 0x0000000000000002
Mft Zone Start : 0x000000000126fd40
Mft Zone End : 0x000000000126fd60
Max Device Trim Extent Count : 0
Max Device Trim Byte Count : 0x0
Max Volume Trim Extent Count : 62
Max Volume Trim Byte Count : 0x40000000
Resource Manager Identifier : 0F4C0BED-06BE-11E8-822D-F79E9DC4E8B3
Getting current volume statistics
You can get current volume usage statistics:
fsutil fsinfo statistics c:
Displaying free space
To display how much free space is available free space on volume C: (in bytes), run the following to view disk space:
fsutil volume diskfree c:
To control the various settings and features of the NTFS file system, use the fsutil behavior command (you can display all the options of this command by typing it in the command prompt).
Note. Learn how to add calendar permissions in Office 365 via PowerShell.
Managing system recovery
To manage file system recovery, use the command:
The following commands are available:
- enumerate — Enumerates the entries of a volume’s corruption log;
- initiate — Initiates NTFS volume self-healing;
- query — Query the self healing state of the NTFS volume;
- set — Set the self healing state of the volume;
- state — Query the corruption state of the volume(s);
- wait — Wait for repair(s) to complete. If NTFS has detected a problem on a volume on which it is performing repairs, this option allows the system to wait until the repair is complete before it runs any pending scripts.
NTFS self-health feature attempts to repair damage on the NTFS file system volume online, without requiring Chkdsk.exe (this feature was introduced in Windows Server 2008).
For example, to display damage records for volume C:
fsutil repair enumerate c:
List the status of all volumes:
fsutil repair state
Display the self-healing status of the C drive:
fsutil repair query c:
Self healing state on c: is: 0x9
Values: 0x1 – Enable general repair.
0x9 – Enable repair and warn about potential data loss.
0x10 – Disable repair and bugcheck once on first corruption.
Enabling automatic recovery
To enable automatic recovery for a volume, run the command:
fsutil repair set c: 1
Also with the help of fsutil you can control the volume attributer “dirty”. To display the status of dirty attribute on drive C:
fsutil dirty query C:
To set the dirty attribute for volume C:
fsutil dirty set C:
Volume – C: is now marked dirty
At the next reboot, the system will automatically perform a disk check using the chkdsk utility.
Frequently Asked Questions about FSUTIL
1. How is the “dirty bit” feature on a volume controlled with fsutil?
The “dirty bit” is an attribute marking a volume that potentially has data integrity issues. You can query the status of this attribute with fsutil dirty query C: and even set a volume’s dirty bit using fsutil dirty set C:. When a volume is marked “dirty,” the system will auto-initiate a disk check upon the next reboot.
2. Can I manage disk quotas using the fsutil command?
Yes, the fsutil utility provides quota management capabilities. By employing appropriate subcommands, you can set, query, and manage disk quotas efficiently.
3. What if I need information about a new file or file ID on my Windows Vista operating system or later?
For operating systems starting from Windows Vista, fsutil facilitates detailed file reference queries. Whether it’s a file’s valid data length or its short attributes, fsutil has got you covered.
Absolutely! Fsutil provides functionalities for transactional resource manager management and managing sparse files. These features aid in the seamless handling of file transactions and optimizing storage for files with zero data, respectively.
5. What’s the role of the master file table in the NTFS file system?
The master file table (MFT) is a vital component of the NTFS file system. It acts as a database storing metadata about every file, directory, and metafile on an NTFS volume. You can gain insights into its information with specific fsutil commands like fsutil fsinfo ntfsinfo.
The fsutil command is a vital tool for Windows users, offering extensive file system management and diagnostic capabilities. Whether managing NTFS file systems, querying volume information, or employing self-healing functions, this utility simplifies complex tasks. While powerful, users should approach changes with caution, ensuring data safety. Mastering fsutil is beneficial for both casual users and IT professionals, making file system management transparent and optimized.