How to check the hard disk for errors using the command line? Checking and repairing disk errors using the Windows Chkdsk utility Run a disk error check.

Chkdsk (Chkdsk.exe) is a utility command line in Windows systems, which checks disk volumes for problems and errors with the file system. This tool may also attempt to fix any errors it finds. For example, chkdsk can fix problems related to bad sectors, lost clusters, and orphaned files and directories. By the way, I recently wrote about the features of working with chkdsk in a Microsoft cluster. However, the automatic check of the file system by the chkdsk utility, if the PC is not restarted correctly, annoys some users. And in principle, such a check can be disabled (although it is not recommended - because you lose control over the integrity of your file system).

To disable automatic disk check when Windows boot, navigate to the following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager

In the right pane, double click on the key BootExecute. The default value of this key is autocheck autochk *

* means that each disk is checked for consistency (integrity, consistency). Just add the parameter "/K:C" before *. The /K option disables automatic checking of the C: drive when Windows boots. So, the final value of the BootExecute registry key should look like this:

autocheck autochk /k:C *

If you want to disable scanning on other drives as well (for example, on drives C: and D:), use the following switch:

autocheck autochk /k:C /k:D *

If you want to change everything back, just replace the parameter value with:

autocheck autochk*

In the event that you did not find the specified key in the registry, you can disable disk check at boot using the utility chkntfs(key /x). To do this, open a command prompt with administrator rights and type the following command:

chkntfs /x d:e:

Then restart your PC. The specified command will exclude drives D: and E: from the automatic disk check procedure at boot. If you need to exclude other drives, just change the command to include the appropriate drive name.

The chkntfs /d command returns the original settings (all disks in the system are checked at boot, and Chkdsk is run only for disks with errors).

In any case, if you disable checking disks at boot, you must periodically check them manually. You can check the disk status like this:

Message F: is not dirty indicates that there are no errors on the disk and it does not need to be checked.

Windows crashes, emergency power off of the computer, experiments with software for managing disk space, the consequences of viruses - these and other problems can lead to the automatic launch of a regular Windows utilities Chkdsk, designed to fix file system errors hard drives. Incorrectly completed work operating system with files leads to the appearance of file system errors, and sometimes to its damage at all.

In emergency cases, the Chkdsk utility itself turns on before Windows starts, scans disk partitions and fixes errors. However, the fact that there are problems with the file system may not make itself felt during normal use of the computer and only be detected when trying to manage disk space. So, for example, trying to reduce a disk partition with regular Windows tools, we may receive such a notification: “It is possible that the volume selected for compression is damaged. Use Chkdsk to troubleshoot, and then try shrinking the volume again."

In this case, the disk check does not start automatically. How to run Chkdsk manually in Windows 7, 8.1 and 10? How can I fix disk errors using Chkdsk if this particular problem caused the operating system to be unable to boot?

Inside Windows, the Chkdsk utility can be run in several ways.

1. Run Chkdsk using the Windows GUI

To run Chkdsk, in the system explorer on the C drive, right-click and open "Properties".

In the window that opens the properties of the disk partition, go to the "Service" tab, and in it click the "Check" button (or "Run a check" for Windows 7).

In versions of Windows 8.1 and 10, if everything is in order with the file system of the disk, in the window that appears next we will see a notification that verification is not required. But if you wish, you can start checking the disk with the Chkdsk utility by clicking "Check disk".

If the system suspects file system errors, this window will contain a button to start checking and repairing the disk.

For Chkdsk to work on drive C, you must restart your computer. You can do this immediately or postpone the start of the scan until the next reboot.

After restarting the computer, we will be able to observe the work of Chkdsk.

In Windows 7, running Chkdsk is slightly different: in addition to the pre-installed automatic error correction option, you can add another possible option - checking and repairing bad sectors on your hard drive. When activating this option, it is worth considering that in this case, Chkdsk may take longer to complete.

As in the case of Windows 8.1 and 10, in version 7 the system drive C cannot be checked as part of a running operating system. To start the scan, you need to restart your computer. Click "Schedule disk check".

When checking a non-system disk partition, if it is used by some programs, the situation is simpler than with the system partition. In the window with a notification that the disk is currently in use, you just need to click the "Disable" button to, accordingly, disable this partition for the duration of the scan.

2. Run Chkdsk using the command line

To run Chkdsk using the command line, first, respectively, run the latter.

In the command line, enter the command by type:

In this command, instead of drive C, each time we substitute the letter of the desired partition on which verification is required. If Chkdsk should check the system partition C, as with the graphical interface, a restart of the computer will be required. After a message appears in the command line about the impossibility of locking the specified drive, you need to enter "Y", then restart the computer.

In addition to the /f option, which is responsible for fixing disk errors, Chkdsk can be run with the /r option, which is designed to search for bad sectors and restore data. As a result of Chkdsk's work with this parameter, hard disk clusters with unreadable sectors will be listed as damaged (bad blocks) with the transfer of their functions to the new cluster. Therefore, it is recommended to run Chkdsk with the /r option only when the usual error correction - running the utility with the /f option - did not bring the desired results. On the example of the same drive C, the command will look like this:

3. Run Chkdsk on unbootable Windows

If Windows freezes at a particular boot stage, one of the possible causes of this problem are file system errors. In this case, you need to run Chkdsk by booting from the rescue media. As such, you can use a regular installation media with Windows versions 7, 8.1 or 10. With it, we will run the Chkdsk utility inside the command line. At the first stage of starting the system installation process, press the command line launch keys - Shift + F10.

In the command line that opens, before running the Chkdsk command, you need to clarify which letters define the disk partitions. This is easy to do with notepad. I run it with the command:

Click the File menu, then Open.

In the explorer that opens, remember the new disk designations. As a rule, in Windows 8.1 and 10, the C partition (as it is inside the running operating system) is listed as D, since the letter C is given to the first technical partition of the system. And all other sections are offset by one letter of the alphabet.

Having decided on the letters of the disk partitions, close notepad, then, returning to the command line, enter a command of this type:

As with Chkdsk inside Windows, you must first try to fix disk errors by running the utility with the /f option. And only if the problem is not solved, only then we run the command with the / r parameter, as indicated in the previous paragraph of the article.

For cases of Windows inability to boot, you can pre-burn an emergency Live-disk with a selection of various tools to restore the operating system. Among these, for example, AdminPE based on WinPE. Its image for recording to a disk or flash drive can be downloaded from the official website of the project Adminpe.Ru. Using the AdminPE, you can launch a command line and enter the Chkdsk startup commands discussed above. But in this Live disk, the Chkdsk utility has its own interface and is launched using a script. The utility launch shortcut is placed directly on the desktop.

In the drop-down list for checking the disk, select the desired disk partition. Next, activate the checkboxes for recovering bad sectors and forcing the partition (volume) to shut down. I'm running a check.

Among the AdminPE tools are a number of other utilities for working with hard drives, as well as the well-known Hard Disk Sentinel and Victoria programs.

computer using standard program"check disk (chkdsk)", which is part of operating systems from Microsoft.

I don’t know how it is at work or at home, but for our IT department, work is added immediately after a sudden power outage on one of the floors of our organization. I remember once an electrician changed the outlet and, without embarrassing at all, turned off all the automation in the stairwell, and this is about fifty computers in one wing of the floor, two 50-port switches and a wireless Wi-Fi access point in the wiring closet :)

And closer to winter, such things, alas, happen more often (people begin to abuse all kinds of heaters and power). Operating systems really do not like such manipulations with power supply, and far from all user computers are equipped.

What usually happens is the following. After another similar mass blackout, there is always one or two computers on which, after the resumption of power supply. At an arbitrary stage of loading, the operating system goes into a cyclic "reboot" (reboots) and here our intervention is urgently required :)

In such cases, as a rule, you need to scan the computer's hard drive with the check disk program, which checks the integrity of the OS file system and tries to eliminate the errors and inconsistencies found.

Let's first see how you can check a hard drive using the Windows GUI?

To do this, right-click on the icon of the desired disk and select "properties" from the menu that opens. In the window that appears, go to the "Service" tab.

And there we press the button "Perform verification".


Under "Check Disk Options" we have two checkboxes:

  1. automatically fix system errors
  2. check and repair bad sectors

We can select any of them (or both) and click the "Start" button.

This graphical interface launches the standard "check disk" utility, for hard checks disk using the chkdsk command. Moreover, if there is only the first check mark, the program checks the hard disk in three stages, and if there is a second one, it adds two more levels of verification to these.

After completing all (three or five) verification steps, the program will inform us about the successful completion of the procedure and (for Windows 7) offer to familiarize ourselves with its results. By clicking the arrow next to "Show Details", we can see a list of all the checks that the utility has made.


Graphics, windows, buttons... all of these are great, but let's dive a little deeper with you and see how you can check your hard drive using the command line " cmd»?

Note: we discussed working with the cmd command interpreter in one of the .

There is a task - to check the hard drive of a computer that has stopped loading (as a rule, after a sudden power outage) and restore the operating system to working order.

What do I do in such cases? I remove the drive from the "victim" and connect it, as an additional one, to my computer. I press the "Start" button (for Windows XP - run) and in the field that appears I enter cmd.

Note: a similar procedure can be carried out on the same (affected) computer by booting from some kind of recovery disk of the “Live CD” type, but for me personally it’s more convenient. I, to the heap, carry out general preventive maintenance of the "patient" and test the drive for the presence of . They also like to appear after such "surprises".

Now I suggest typing the following in the command interpreter line: chkdsk /?

Construction " /? ' will allow us to view all the available arguments (switches) that we can apply along with the main command chkdsk.



As you can see, the explanation for each "key" is given in Russian, so it will not be difficult to figure it out. Additional arguments are entered through the sign " / " (right slash). But let's now try to check the hard drive with the chkdsk command.

Take a close look at the screenshot below:



Circled in red at the top is the design " chkdsk d: /f/r» What does it mean? Check (chkdsk) drive d (d:) by applying the keys “ f" and " r” (what they do can be found in the previous screenshot). Just below you can see the completed stages of this check and the number of remaining ones (stage 1 of 5, stage 2 of 5, etc.), as well as the percentage of completion of the current one.

Interestingly, executing the chkdsk command with the attribute /f launches a check in three stages, completely similar to the one that occurs after selecting the first checkmark in the graphical interface:


Adding a key /r identical to the second checkbox in the screenshot above (check and repair bad sectors). In fact, to check the hard drive, the same utility is launched. It's just that it's more convenient for someone to use graphic windows and a mouse, while someone manages the command line.

The check window at boot and before the start of the operating system is slightly different, but the essence remains the same:



At the top it is indicated which logical drive is currently being checked, what type of file system it contains, and below are the verification steps that are already familiar to us. For Windows 7, such information is presented on a black background.

So, back to our console. A complete program report might look like this:



The point marked in red is of paramount importance to us here: the number of kilobytes in bad sectors. If there is "0" here, then everything is fine :)

Let's take a quick look at what exactly does each of the hard drive test steps do?

The first pass checks the files. During this phase, CHKDSK checks the entry information for each file in the main table. MFT.

Note: MFT - Master File Table (main file table), which contains information about all files and their attributes located on a volume with the NTFS file system. Approximately 12% of disk space is reserved for it.

The first step is to check each file for internal consistency (ex: the same data sector is marked as belonging to two different files at the same time)

During the second stage, the indexes are checked. What it is? These are the directories of the file system, it is checked whether the record segment for each directory and file is contained in the main file table, as well as the date on the time the files were modified and their size. The CHKDSK command checks for files that are missing (blank) or have an incorrect record of their location in the MFT.

Further (at the third stage) of the hard disk check, security descriptors are analyzed. They contain information about the owner of files (directories), about the access rights to them at the file system level. Audit information for user datasets is verified.

If the fourth stage of the hard disk check is involved, then it includes the search for bad sectors (bad blocks). If one is found, the program automatically adds information about it to the MFT table and no more entries are made on it, and the sector is excluded from the file table.

The fifth step is to check the free disk space. Nothing much to comment here :)

Thus, we can check our hard drive for the correctness of all the metadata it contains.

The term "metadata", in this case, means "information about data." Metadata ensures the integrity of the file system, and also contains information about all its files and directories. It contains information about the clusters that make up each file, about which clusters are free and which are busy, contain bad sectors, etc.

And now - the harsh reality! :) Unfortunately, it happens that the metadata structure is so corrupted that the command chkdsk not only does not help, but can further complicate the situation of restoring the operating system.

On the other hand, there were cases when my inner instinct told me to still check the hard drive using this tool and I got the result I needed. So try it and decide for yourself whether to use this recovery tool or not?

The screenshot below is a photo of one of the longest verification cycles in my practice. The utility worked for more than two hours, while the following picture was constantly on the monitor:


But by the blinking of the hard drive LED on the front, it was clear that there was an active data exchange with the drive, so I waited stubbornly and waited for the complete completion of this process. After reboot Windows operation has been restored!

The CHKDSK command actually does a lot of checking and can fix a wide variety of errors found in the file system and individual files. For example, you can see such "terrible" inscriptions during a disk scan:

Another example from practice:

And now the team is making corrections to the hard disk file system itself.

In all cases, the final scan result is positive. Do not neglect this possibility of "repair" provided by the developer himself! Sometimes disks with a damaged file system (when you can't even access the disk and its file system is displayed as RAW in its properties) "miraculously" come back to life only after using this command.

The article describes the solution to some problems associated with the incorrect operation of the disk check utility from under Windows. Consider why the following chkdsk error occurs:

  • chkdsk won't run
  • chkdsk runs every time windows starts
  • chkdsk hangs while running

We considered the main ones a little earlier. It is able to solve many problems: from the blue screen of death to the inability to open some files and folders. But, if you are here, then the tool for finding and correcting errors hard drive does not work as it should. This article is about the incorrect operation of the utility when it is aimed specifically at the system drive - when a computer restart is required.

chkdsk error: won't run after reboot.

Right after you try to check system volume for bad sectors, the console will report that this is only possible after a restart. Having agreed, the corresponding entry immediately appears in the autoload. Check . However, nothing happens. There is only one reason - the software component of the kernel blocks the launch of the program, since the logical volume itself is blocked. It's possible that the BootExecute setting in the registry is a bit broken. Check it out right now:

The value of the parameter must be:

autocheck autochk*

Otherwise, do as you should. If after editing the parameter chkdsk error again does not allow the utility to start, its executable file itself is probably beaten. It will help either copying it from a working copy of Windows (from another computer from the system folder system32 copy the utility autochk.exe ) or run another repair utility sfc /scannow. It will check the integrity of the file system.

chkdsk error: check disk runs every time before windows boots.

The same song, but with a different tune. It doesn't matter how the disk check ends: chkdsk runs the check again and again.

  • The reason for this again may be an incorrectly set registry setting. Check it in a familiar path in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager

So, the BootExecute parameter looks a little different during repeated launch:

autocheck autochk*/

It remains for us to remove the slash on the right and give it a familiar look:

autocheck autoch*

Reboot and check.

  • If it doesn’t work, check the desired volume for “cleanliness”:
fsutil dirty query c:

Look at the console response. If it says that the disk needs to be checked and cleaned (the disk is “dirty”), run the check utility in the form:

CHKNTFS /XC:

where the X parameter will tell the utility that there should be no NEXT START check, which will send you straight to Windows. And now it's time to run the chkdsk utility in the format:

Chkdsk /f /r c:

Watch the volume letter. At the end of the check, re-check the volume for “cleanliness” with the command in the console:

fsutil dirty query c:

until you see the answer:

chkdsk error: disk check hangs

The problem is described in the paragraph heading: no matter at what stage chkdsk stuck (10% or 87%). From personal experience, I dare say - the clock will go away, but the check will be completed one way or another. An hour or two, just wait.

I wrote an article about checking hard drives for errors, it also mentioned that it was impossible to check the disk that is used by the system. Checking the system disk is scheduled on the next reboot.

However, sometimes System Disk Check does not run after a reboot. If you encounter such a problem, do the following:

1) The autochk.exe file is responsible for the check that should have happened after the reboot, which is located at the following path: C:\Windows\System32 (C:\ is the drive on which Windows is installed, you may have a different drive letter). You need to check if this file exists in the given directory.

2) Press “Win ​​+ R” type “regedit” and press Ok, the registry editor will start, go to the following path:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager

In the right column, find the BootExecute parameter, double-click on it with the left mouse button. The value should be “autocheck autochk *”, if there is another value, change it to autocheck autochk *.

Incorrect editing of the registry can harm the OS. Before you start working with the registry, I advise you to read.

After you schedule a check of the system disk, the value of the BootExecute parameter will change, the entry will look like this:

autocheck autochk /p \??\C:

After the disk check is done (after a reboot), the “autocheck autochk /p \??\C:” entry will disappear and only autocheck autochk * will remain.

Sound doesn't work

If after you restarted your computer and the system disk was checked, you lost sound, then you need to restart the service Windows Audio. To do this, go to the following path:

Control Panel\All Control Panel Items\Administrative Tools\Services.

Find a service called Windows Audio, right-click on it and select Restart.

mob_info