How to use the command fsutil (with examples)
- Windows
- December 25, 2023
The fsutil
command is a Windows command line utility that provides various functions related to file system management. It allows users to display information about file system volumes, including volume lists, file system information, repair states, and dirty bit states. These features can be useful for system administrators or users who need to monitor and manage file systems on their Windows machines.
Use case 1: Display a list of volumes
Code:
fsutil volume list
Motivation: This use case is useful when you need to retrieve a list of all the volumes available on your Windows system. It can help you verify the number and types of volumes and identify which drive letters are assigned to each volume.
Explanation: The fsutil volume list
command lists all the volumes on the system. It will display information such as the volume name, path, and other details related to each volume.
Example output:
\\?\Volume{f57ee676-ff47-4f4c-bf7a-6db3191c6da4}\
*** NO MOUNT POINTS ***
\\?\Volume{24d85894-42fd-4db3-8f66-383159019b18}\
C:\
\\?\Volume{c8085fcf-5f81-4af7-aba5-ad0c47e45350}\
D:\
\\?\Volume{45e2e28f-0c60-424a-8296-5ac925e36b84}\
E:\
\\?\Volume{e6aaf85f-3e9d-11ec-a82e-806e6f6e6963}\
F:\
Use case 2: Display information about a volume’s file system
Code:
fsutil fsInfo volumeInfo C:
Motivation: This use case is helpful when you want to obtain detailed information about a specific volume’s file system. It can be useful for troubleshooting or verifying the file system’s properties, such as the cluster size, allocation unit size, and file system type.
Explanation: The fsutil fsInfo volumeInfo drive_letter|volume_path
command displays information about the specified volume’s file system. You need to replace drive_letter
or volume_path
with the appropriate identifier for the volume you want to inspect.
Example output:
NTFS FileSystem Volume Information
Volume Name : Disk_C
Volume Serial Number : A1B2-C3D4
Maximum Component Length : 255
File System Name : NTFS
Supports Case-sensitive filenames
Preserves Case of filenames
Supports Unicode in filenames
Supports file-based compression
Supports Disk Quotas
Supports Sparse files
Supports Reparse Points
Supports Object Identifiers
Supports Encrypted File System
Supports Named Streams
Supports Transactions
Supports Hard Links
Supports Extended Attributes
Supports Open By FileID
Supports USN Journal
Supports Integrity Streams
Use case 3: Display the current state of file system auto-repair for all volumes
Code:
fsutil repair state
Motivation: This use case is beneficial for checking the current state of file system auto-repair for all volumes. It can help you identify whether the auto-repair feature is enabled or disabled for each volume.
Explanation: The fsutil repair state
command displays the current state of file system auto-repair for all volumes on the system. It will show whether auto-repair is enabled or disabled for each volume.
Example output:
Auto-Scan Installng Status : 0 (The operation completed successfully.)
Use case 4: Display the dirty bit state of all volumes
Code:
fsutil dirty query
Motivation: This use case is useful for checking the dirty bit state of all volumes. The dirty bit is a flag that indicates whether the file system experienced an unclean shutdown. Knowing the dirty bit state can help you identify volumes that may require a file system consistency check.
Explanation: The fsutil dirty query
command displays the dirty bit state for all volumes on the system. It will show whether the dirty bit is set or not for each volume.
Example output:
Volume - C: is Dirty
Volume - D: is NOT Dirty
Use case 5: Set the dirty bit state of a volume
Code:
fsutil dirty set C:
Motivation: This use case is used to manually set the dirty bit state for a specific volume. Setting the dirty bit on a volume can simulate an unclean shutdown, which may trigger file system auto-repair on the next system startup.
Explanation: The fsutil dirty set drive_letter|volume_path
command sets the dirty bit state for the specified volume. You need to replace drive_letter
or volume_path
with the appropriate identifier for the volume you want to modify.
Example output:
Dirty bit set on volume C:
Conclusion:
The fsutil
command provides a set of useful functions for managing file systems on Windows systems. With its capabilities to display volume information, file system details, repair states, and dirty bit states, it offers valuable insights into the status and properties of file systems. Whether you are a system administrator or an advanced user, the fsutil
command can be an essential tool for file system management and troubleshooting.