How to Repair Hard Drive in Windows with CHKDSK

Chkdsk, or checkdisk, is a Windows system tool that verifies the integrity of a volume and attempts to fix file system errors. 

If you’re running into repeated disk errors, system instabilities, or blue screen of death, the problem might be related to corruption in critical sectors of the disk. In such a case, you should attempt to check disk integrity and fix any detected corruptions by running the chkdsk command.

We have prepared the article below that explains what the chkdsk command is, the parameters you can run it with, and how to use it to scan for corruptions and fix any errors found on your hard drive in Windows.

How to Run Chkdsk to Repair and Fix Hard Drive on Windows

When to Use Chkdsk Command

You can use the chkdsk command if you suspect there is some problem with one of your drives. You can also use it if you suspect that a disk error is causing issues with Windows.
Chkdsk command can be used to detect and fix the following two types of disk errors:

  • File system errors.
  • Physical corruption of the disk.

Chkdsk Command Syntax

The chkdsk command has the following syntax format, and you will need to run it with administrative privileges.

chkdsk [<volume>[[<path>]<filename>]] [/f] [/v] [/r] [/x] [/i] [/c] [/l[:<size>]] [/b] [/scan] [/spotfix]

ParameterDescription
[<volume>]The drive volume that you want chkdsk to run on. If you omit this parameter, chkdsk will attempt to run on the boot volume. The attempt will succeed if no repair parameters are specified, otherwise it will throw an error.
[<path><filename>]This parameter specifies the file you want chkdsk to run on, with its full path.
[/f]This parameter attempts to fix any errors found on a logical disk. This disk must be locked when running chkdsk with this parameter.
[/v]Verbose parameter, enabling this displays the name of each file as they are being scanned on FAT/FAT32 formatted volumes. On NTFS volumes, this displays cleanup messages if any.
[/r]Locates bad sectors and attempts recovery of readable information. Includes functionality of /f. Additionally, scans for physical disk errors.
[/x]Forces the disk to dismount first, if necessary. Includes the functionality of /f.
[/i]Performs a less vigorous check of index entries, thus running faster. Works on NTFS formatted drives only.
[/c]Enabling this skips check cycles within folder structures, reducing scan time. Works on NTFS formatted drives only.
[/l[:size>]]Sets the size of the log file in kilobytes.
[/b]NTFS only parameter. Clears the list of bad sectors and performs a scan of all allocated and free clusters for errors. Includes functionality of /r
[/scan]Runs an online scan. NTFS only.
[/forceofflinefix]Must be run with [/scan] parameter, forces an offline repair of all defects found.
[/perf]Must be run with [/scan] parameter, forces higher system resources utilization for a faster scan.
[/spotfix]Enables spot fixing of NTFS volumes.
[/sdcleanup]NTFS only. Includes /f functionality. Garbage collects unneeded security descriptor data.
[/offlinescanandfix]Runs and offline scan and fix on the volume.
[/freeorphanedchains]FAT/FAT32/exFAT only. Frees any orphaned cluster chains instead of recovering them.
[/markclean]FAT/FAT32/exFAT only. Marks the volume clean if no corruption is detected.
Source: Microsoft document

Run the Chkdsk Command

On Windows, you can run the chkdsk command from the command prompt, powershell, or from the Windows Recovery Environment.

See also  How to Fix Keyboard Malfunctions Post-Windows Update: Effective Fixes

To Launch Chkdsk From the Command Prompt:

  1. Press Win + R, type in cmd, then press Ctrl + Shift + Enter to launch the elevated command prompt
  2. At the prompt, type in: chkdsk vol /r . Replace vol with the volume letter of the drive you want to run chkdsk on.

Launch Chkdsk from Windows PowerShell:

  1. Press Win + R, type in powershell, then press Ctrl + Shift + Enter to launch Administrator PowerShell.
  2. At the prompt, execute the command chkdsk vol /r . Replace vol with the volume letter of the drive you want to run chkdsk on.


chkdsk-PowerShell-_r

Chkdsk from Windows RE

You can also run chkdsk from the command prompt in Windows Recovery Environment. You can launch Windows RE if you are having trouble completing the booting process or otherwise unable to boot or run Windows properly. 

You can launch Windows RE using the Windows recovery media disk. Alternately, long press the power button to force system shutdown a few times while Windows is loading until you come across the recovery environment.

Thereafter, navigate to Troubleshoot > Command Prompt to launch the command prompt, where you will be able to run chkdsk commands normally.

Scan and Repair for Bad Sectors

If you need to scan and repair for bad sectors (physical) in your hard drive, you will need to run the chkdsk command with /r parameter. 

chkdsk vol /r


chkdsk_r

The scan parameter implies /f, meaning the parameter also performs the functionality of /f, which is to scan integrity of the file system. 

This option will fix any file system errors that are identified. If there are any bad sectors detected, this will also attempt to recover readable data. 

See also  How to Copy and Paste Without a Mouse in Windows PC

Identified bad sectors that are unrecoverable are flagged to avoid being written into in the future.

On a locked drive or a drive that chkdsk is able to lock, /r should be able to provide complete scan and repair functionality of the chkdsk command.

Scan for File System Corruption

As mentioned above, the /r parameter performs a full disk scan, including scan of physical sectors. Thus, it is a relatively time-consuming process. If you want to scan just the file system, you can instead use the /f parameter

At the prompt, type in chkdsk vol /f.

If any file system errors are found, chkdsk will attempt to repair those errors. You need to keep in mind that bad sectors are not repaired by this parameter.

Dismount and Run Chkdsk

If one or more files in the target volume are open, in that case you will most likely get the error “Chkdsk cannot run because the volume is in use by another process.” In this case, force a dismount of the disk by pressing Y when prompted.


Chkdsk-cannot-run 

You can also use the /x parameter to dismount the volume and run chkdsk on it.

At the elevated command prompt, type in:

 chkdsk vol /r /x . 

If you want to scan just the file system, you can instead execute the command: 

chkdsk vol /f /x .

However, if your target drive is the boot volume where Windows has been installed, then you will be unable to dismount the partition even with the /x parameter.

You will be greeted with a message “ Chkdsk cannot run because the volume is in use by another process. Would you like to schedule this volume to be checked the next time the system restarts? (Y/N)

See also  Clearing RAM Cache on Windows: Easy Steps for Improved Performance


chkdsk-autochk-will-start-upon-restart

If you need to run the chkdsk scan on the boot volume, press Y and hit enter. Thereafter, restart your system. When you’ve done this, autochk.exe is called when you boot your computer. This is a NTFS-only application that runs before Windows Server starts.

The autochk.exe program can be run in the following situations:

  1. If you need to run the chkdsk command on the boot volume.
  2. If the volume is flagged as dirty.
  3. If chkdsk is unable to dismount a volume.

Functionally, autochk.exe is the same as chkdsk, except that it runs before Windows loads, allowing it to run on the boot volume.

Frequently Asked Questions

Why is Chkdsk Command Not Working?

The chkdsk command will not work if you have a fast startup enabled with multiboot configured for different versions of Windows. This also happens for other reasons such as disk failure or write protection enabled on the drive. 

If you need to run a chkdsk scan in one of your disk drives but chkdsk is not cooperating for some reason, we have a comprehensive article on the topic on how to fix chkdsk not working. Please give it a read.

Can Chkdsk Fix Hard Drive?

Chkdsk is a good tool to scan for file system errors or bad sectors. It might even be able to recover information if the stored data is still readable. However, chkdsk is not a dedicated recovery tool. You will not be able to fix or recover data from a hard drive is physically damaged.

Mohamed SAKHRI
Mohamed SAKHRI

I'm the creator and editor-in-chief of Tech To Geek. Through this little blog, I share with you my passion for technology. I specialize in various operating systems such as Windows, Linux, macOS, and Android, focusing on providing practical and valuable guides.

Articles: 1310

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Leave a Reply

Your email address will not be published. Required fields are marked *