DEV Community

Cover image for How to Fix Your Hard Disk With the Help of CHKDSK in Windows 10
Michael Mirosnichenko
Michael Mirosnichenko

Posted on

How to Fix Your Hard Disk With the Help of CHKDSK in Windows 10

Read this article to find out how to check a hard disk for file system errors, and how to fix the detected errors with the CHKDSK command. The aim of this article is to inform every user on what to do if a hard disk containing important data suddenly stops working, or works incorrectly and encounters errors or failures.

Launch the Command prompt as Administrator

Even in Windows 10, the command CHKDSK is run with the Command Prompt, but to enjoy all of its functionality, you should start it with administrator rights. To open the Command Prompt as Administrator, press the key shortcut Windows + X and select the corresponding menu item. Also, you can access it by right-clicking on the Start button.

Alt Text

The User Account Control window will open, asking for permission to start the Command Prompt as Administrator. Click Yes and the Command Prompt window will open. You can make sure you have administrator rights by looking at the name of this window: it should say Administrator: Command Prompt.

Alt Text

Type the command chkdsk

In the Command Prompt, type chkdsk, and follow it with the letter of the disk you need to check or fix. In our case, this is internal disk С.

Alt Text

Configure chkdsk to restore the hard disk
If you start CHKDSK in Windows 10 with default options, it will only display the disk status and won’t fix any errors in this partition. To have the command fix the disk errors, there are some things to configure. After the disk letter, type the following flags, and remember to put a space after each of them: /f /r /x.

The flag /f tells CHKDSK to fix all errors it can find; the flag /r instructs it to find bad sectors and restore any data that could be read; the flag /x stops the disk before any operations are performed. For more advanced tasks, there are other flags as well.

Summing up, the command that you should type in the Command Prompt should look like this:

chkdsk [Drive:] [parameters]
Enter fullscreen mode Exit fullscreen mode

In our case, this is how it looks:

chkdsk C: /f /r /x
Enter fullscreen mode Exit fullscreen mode

Alt Text

Bear in mind that CHKDSK must have an opportunity to lock the disk, that is, you shouldn’t use CHKDSK to check the system boot while such disk is in use. If the disk you are working on is an external one, or it is not the boot disk, CHKDSK will start as soon as you run the command. If this disk is the one that the operating system boots from, Windows will ask you if the command should run before the computer is booted next time. Select Y (Yes) and restart the computer, so that the command will run before the operating system boots and thus it will get full access to the disk.

Run chkdsk

Running the CHKDSK command may take some time, especially if you are dealing with a large disk. When the process is finally over, you will see the summary. It will inform you on the full disk capacity, distribution of bytes and (what is most important) on all the errors that were found and fixed.

CHKDSK works with all versions of Windows, including the latest ones like Windows 7, 8 and 10. As to older operating systems, you can still open the Command Prompt from the Start menu by selecting Run and typing cmd. After the Command Prompt opens, right-click on it and select Run as Administrator to gain access to all rights.

Now that we have explored how to run CHKDSK in older versions of Windows, many of those following this guide could see that their hard disks lost some of their capacity after running the command. It means that the disk has some errors, because one of the functions in CHKDSK is detecting and blocking bad sectors on a hard disk.

If such disk contains only a few of them, this fact doesn’t affect your user experience at all. But if the disk encounters failures, there could be huge numbers of such sectors. When CHKDSK blocks them, it takes away a considerable amount of disk space.

Be prepared to see such results - and they suggest that all data theoretically stored in such sectors will be lost, even if the operating system doesn’t know about it. CHKDSK will try to restore data from such bad sectors while working with the flag /r, but some information is bound to remain damaged and unavailable for recovery. If it happens, CHKDSK is not to blame - it just displayed the current state of your disk.

Top comments (0)