Whenever your system crashes or turns off unexpectedly, Windows might run a disk recovery tool called Chkdsk or Check Disk. This tool scans the hard drive for any errors and tries to fix those errors all the while trying to recover as much data as possible. Not only that but the chkdsk utility can also recover stuff when your system is facing BSOD (Blue Screen of Death), bad sectors in case of damaged or old hard drive, cluster problems, file system mishaps, etc.
As you can tell, chkdsk is a very useful utility that makes your life easier. Generally, Windows automatically runs the chkdsk tool as and when needed. However, you can also run the chkdsk tool manually. If you ever want to do that, it is better to know all or important chkdsk commands in Windows 10. To help you with that, I'm listing all the chkdsk commands and their usage.
List of Chkdsk Commands
Chkdsk has a wide range of command line switches and parameters to help you run the utility properly and efficiently. Below are all the chkdsk commands and their meanings.
Volume - This parameter allows you to specify a drive letter or volume name so that the chkdsk utility can scan the target drive/folder. For example, to scan the D drive, you'd use
Filename - This parameter is used to scan a certain file for any fragmentation. This parameter works only on FAT and FAT32 file system. In the real world though, you won't use this parameter that much.
/F - Use this switch to make chkdsk automatically fix any errors it found while scanning.
/R - This switch scans for bad sectors and if possible, recovers any readable information from those sectors.
/L:size - This switch works only on NTFS file system. The switch allows you to change the file log size related to NTFS transactions. In general, this is meant for server admins only.
/X - Sometimes, if the volume is mounted, it can cause problems with scanning and recovering. In those situations, you can use this switch. When used, if necessary, it will force the target volume to be dismounted resulting in invalidating any handles. Unless you know what you are doing, don't use this switch.
/I - This switch makes the index scan less vigorous. As you can tell, you can use this switch while doing low priority scans or when you are on a time crunch. Also, this switch works only on NTFS file system.
/C - Just like the above switch, this works only with the NTFS file system. When used, this switch will skip cycle checking with the folder structure.
/B - This switch makes the chkdsk tool to re-evaluate the bad clusters on the volume.
/Scan - This parameter runs an online scan and only works on NTFS file system.
/ForceOfflineFix - This switch forces the chkdsk tool to force offline repair over the online repair. If you chose to use this switch, it should be used alongside the /scan parameter.
/Pref - This parameter increases the chkdsk priority so that it can run the scans as fast as possible at the cost of higher system resource usage. As you can guess, when you use this parameter, it can cause other programs on your system to slow down due to limited resources. This switch works only on NTFS file system and should be used alongside with /scan parameter.
/Spotfix - As the name suggests, this parameter tries to spot-fix any problems found in the volume. Works only in NTFS file system.
/SdCleanup - Garbage collects Security Descriptor data. Works only in NTFS file system.
/OfflineScanAndFix - This parameter forces the chkdsk tool to run an offline scan and fix the problems offline.
/FreeOrphanedChains - This parameter frees up any and all orphaned chines rather than recovering the data in them. Works only on FAT, FAT32, and exFAT file systems.
/MarkClean - This parameter marks the scanned volume as clean if there are no errors. Works only on FAT, FAT32, and exFAT file systems.
Using Chkdsk Commands
Using chkdsk command is pretty simple and straightforward. Generally, most just want to scan for drive errors on the entire hard disk or on a particular partition. So, I'm going to show those frequently used commands. To use chkdsk, you need to open command prompt as admin.
The base chkdsk command looks like this.
chkdsk [volume[[path]filename]]] [/F] [/V] [/R] [/X] [/I] [/C] [/L[:size]] [/B] [/scan] [/spotfix]
If you want to scan your C drive, use the below command. Of course, if you want to scan some other drive, just replace C with the drive letter of your choice.
To check and repair a disk, you can use the below command. Just like before, you can replace C with the drive letter of your choice.
chkdsk C: /f /r
That is all. For more information on chkdsk utility, you can see this Microsoft docs page.