Chkdsk is a great utility to scan and fix disk errors. Here are all the chkdsk commands you should know to use the tool effectively.
Whenever your computer crashes or turns off unexpectedly, Windows might run a disk recovery tool called Chkdsk, also known as the Check Disk.
As the name suggests, the Chkdsk tool scans the hard drive for errors and tries to fix them while recovering as much data as possible. In addition to that, 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 handy 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.
I’m listing all the chkdsk commands and their usage to get you started. Execute the relevant command depending on your use case, and chkdsk will do the rest.
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 definitions.
Volume – This parameter allows you to specify a drive letter or volume name to scan that target drive/folder. For example, to check the D drive, you’d use D:.
Filename – This parameter is used to scan a specific file for fragmentation. This parameter works only on the FAT and FAT32 file system. You won’t use this parameter that much in the real world.
/F – Use this switch to make chkdsk automatically fix errors it found while scanning.
/R – This switch scans for bad sectors and recovers readable information from those sectors.
/L:size – This switch works only on the 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. If used, it will force the target volume to dismount. This, in turn, results in invalidating active 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 the 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 re-evaluate the bad clusters on a given volume.
/Scan – This parameter runs an online scan and only works on the NTFS file system.
/ForceOfflineFix – This switch forces the chkdsk tool to force offline repair over the online repair. If you choose to use this switch, it should be used alongside the /scan parameter.
/Pref – This parameter increases the chkdsk priority to run the scans as fast as possible at the cost of higher system resource usage. As you can guess, when using this parameter, it can cause other programs to slow down due to limited resources. This switch works only on the NTFS file system and should be used alongside the /scan parameter.
/Spotfix – As the name suggests, this parameter tries to spot-fix any problems found in the volume. Works only in the NTFS file system.
/SdCleanup – Garbage collects Security Descriptor data. Works only in the 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 orphaned chains rather than recovering their data. 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.
How to Run Chkdsk Commands
Using the chkdsk command is pretty simple and straightforward. Generally, most just want to scan for drive errors on the entire hard disk or 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. Like before, you can replace C with the drive letter of your choice.
chkdsk C: /f /r
That is all. You can see this Microsoft Docs page for more information on the chkdsk utility.