ScanDisk from the Windows 7 command line. How to cancel a scheduled disk scan. The easiest way is graphical

When any problems arise with a hard drive, many people immediately ask the question of how to run chkdsk.

These problems can be very different - from banal braking, which cannot be fixed in any way, to a complete failure to load the operating system.

The point is that this The best way solve everything possible problems with HDD or even SSD. Most experts advise using it in such situations.

We will look at all the really working methods that help launch the hard drive recovery tool in Windows.

Method number 1. Using "Computer"

This option assumes that your system is somehow loading, that is, there is no complete refusal to boot. Yes, it may slow down, reboot spontaneously from time to time, and so on, but you can still, albeit with some effort, still see the desktop and other elements of the system. If so, do this:

  • Open Computer.
  • On the main (system), and most often this is on C, right-click and select “Properties” from the drop-down menu.
  • In the window that opens, go to the “Service” tab at the top. In the “Check” block, click on “Run check...”.
  • Then a new window will appear, smaller. Check the boxes next to “Automatically correct system errors" and "Check and repair bad sectors." However, you don’t have to do this, but it’s better to check these boxes, since you won’t be able to correct all the errors yourself. Click the "Launch" button.

After this, you just have to wait until the tool completes its main task.

In some cases, after completing all the above operations, another window appears with the text: “Windows cannot check which this moment used."

This means that some kind of error has occurred (another one), or you do not have access rights to certain files. IN different versions Operating system this window may look different.

Without going into details, let's say that it will have the option to click the “Yes” or “OK” button. So, you just need to do this and continue to calmly watch the recovery tool work.

Important! In some cases, you will need to restart your PC in order to continue. So if nothing happens after all the above steps, restart your PC or laptop. It happens that the computer will restart automatically. There is no need to be afraid of this.

Method number 2. Using the program execution window

In addition, the recovery tool in question can be launched using the standard execution of commands or programs, which is found in all Windows versions.

Tip: To run programs, you can go to the Start menu and click Run. You can also do this by simultaneously pressing the “Win” and “R” buttons.

  1. Enter the command in the following format: "chkdsk [drive letter]: /[command]". That is, for example, to check C, you need to enter “chkdsk c: /f”. Here we use the one that corrects errors on the disk (“/f”). In addition, you can enter the following parameters:
  • /f – checking and automatic error correction;
  • /i – no analysis of the so-called index parts (if you don’t know what this means, don’t use this parameter);
  • /v – display messages along the way with scanned files (and their paths on the hard drive), as well as other messages about the progress of cleaning and analysis;
  • /c – no loops inside folders (again, if you don’t know what this means, don’t take it);
  • /x – disconnect the disk before starting (the system will automatically check if this is necessary and take the appropriate action);
  • /r – search for “broken” sectors and, of course, automatically restore them;
  • /l:[size] – to change the file size, the size must be indicated in kilobytes.

In most cases, it all comes down to entering a simple command “chkdsk c: /f” and clicking “OK”.

  • After this, the verification process will begin. It looks as shown in Figure No. 5. All you have to do here is wait until everything is over.

In newer versions, the process looks almost the same, but the interface is slightly different.

Again, after completing the above steps, another one may appear stating that the drive “cannot be locked.”

Meaning of this message boils down to the same thing we talked about above - the disk is currently in use, which means that another failure has occurred or you do not have access to certain elements. In any case, all you have to do here is enter the command “Y” and press the “Enter” button.

Important! To use both methods, you must have administrator rights on the computer. The best way to do this is by opening cmd as an administrator. In Windows 7 and below, there is a corresponding item in the Start menu - “Command Prompt (Administrator)”. In later versions, you must click on the Start menu or Windows menu to see this option. In the line that opens, enter “net user Administrator /active:yes”.

Method No. 3. Using the Windows installation disk

This happens differently in different versions. In the simplest version, already when the system boots from installation file Several options appear, including launching an error correction program.

For example, in Windows XP you can simply press “R” and wait until the console starts. This is shown in Figure 8.

Hint: To see this menu, it is not enough to simply insert a disc with operating system, you also need to boot from it into the BIOS. How to do this, read the documentation for your PC. In the simplest case, you need to go to the “Boot” section and select the appropriate device next to the inscription “1st Boot Device”.

Once the console is running, do the following:

Select the version of the operating system you will work with, that is, enter its number and press “Enter” on the keyboard. If you have a single OS installed on your computer, simply enter “1” and press “Enter.” In any case, it will be indicated below full list systems installed on a PC. In our example, there is only one OS, so we enter “1” and press “Enter”.

And then enter in the same format as we discussed in the previous method, that is, “chkdsk [drive letter]: /[command].” The list here is exactly the same. So enter these instructions, press “Enter” and watch the progress.

In this case, the program may require an administrator password. If you have it, enter it.

If not, then you either don’t know that it’s still there (since the program requires it), or it’s a glitch and you can just press “Enter” to continue.

In the first case, you will need to contact the person who installed the operating system or someone else who may know this very password.

Thanks to this simple method, anyone can run the checker with complete peace of mind. hard drive and watch him work.

One of the above methods is clearly shown in the video below.

CHKDSK used to scan disks and display reports on scan results. Format command line:

CHKDSK [volume:[[path]filename]] ]

Volume Specifies the mount point, volume name, or drive letter of the drive being checked, followed by a colon.

file name Files checked for fragmentation (FAT/FAT32 only).

/F Correcting disk errors.

/V Detailed mode output. For FAT/FAT32: Displays the full path and name for each file on this drive. For NTFS: also displays cleanup messages.

/R Search for bad sectors and restore their contents. (requires key /F).

/L:size For NTFS only: Changes the log file size to the specified size (in KB). If a size is not specified, the current size value is displayed.

/X If necessary, forcefully disable the volume. All open handles to this volume will be invalidated. (requires parameter /F).

/I NTFS only: Less strict checking of index elements.

/C NTFS only: Skip checking for loops within the folder structure.

Keys /I or /C reduce CHKDSK execution time by skipping some volume checks.

Examples of using:

CHKDSK- check the current disk (volume) in read-only mode

Sample report:

File system type: NTFS.

Volume label: DISK_C.

ATTENTION! Parameter F is not specified.

CHKDSK runs in read-only mode.

Checking files (step 1 of 3)...
File verification is complete.
Checking indexes (step 2 of 3)...
The index check is completed.
Checking security descriptors (step 3 of 3)...
The security descriptor check has completed.
CHKDSK checks the USN log..
USN log check completed

488384000 KB total on disk.
482155688 KB in 332072 files.
108552 KB in 14989 indexes.
0 KB in bad sectors.
1120884 KB is in use by the system.
65536 KB are occupied by the log file.
4998876 KB free on disk.

Cluster size: 4096 bytes.
Total clusters on disk: 122096000.
1249719 clusters on disk.

CHKDSK D:/F- check the disk D: in error correction mode.

If in this mode checks CHKDSK cannot obtain exclusive access to the volume being checked, the program will prompt you to set the mode to automatically start testing the specified disk the next time the system is rebooted. The check will be performed by the Windows Session Manager service, in accordance with the contents of the registry key
HKLM\System\CurrentControlSet\Control\Session Manager\BootExecute
The scan results can be viewed in the system event log - (Control Panel - Administrative Tools - Event Viewer - Application) service notifications Winlogon. You can check whether CHKDSK is running the next time you restart Windows using the command CHKNTFS, a link to a description of which can also be found on the page with a list of Windows CMD commands. In addition, it can be used to change some testing parameters.

CHKDSK's work is divided into three main passes, during which CHKDSK checks all metadata on the volume, and an optional fourth pass. The term "metadata" means "data about data." Metadata is a layer on top of the file system that keeps track of information about all the files stored on a volume. The metadata contains information about the clusters that make up the data volume of a particular file, which clusters are free, which clusters contain bad sectors, etc. On the other hand, the data contained in the file is referred to as "user data". In NTFS, metadata is protected using a transaction log. The process of changing metadata is divided into certain logical stages, or transactions, which are recorded in a log. If the sequence of actions to change metadata is not logically completed, then a rollback is performed using the transaction log data to the moment when this change has not yet been started. In other words, using a transaction log greatly increases the likelihood of metadata integrity.

This method is not used to protect user data (not metadata) in the NTFS file system.

Stage 1. Checking files

During the first pass, CHKDSK displays a message indicating that files are being scanned and the amount of file scans performed, expressed as a percentage (0 to 100). During this phase, CHKDSK checks the record segment of each file in the master file table ( MFT) volumes.

Stage 2. Checking indexes

Essentially, indexes are directories in the NTFS file system. CHKDSK checks that there are no "orphan" files and that all directory listings contain existing files. An orphaned file is a file for which a valid file record segment exists, but for which there is no data in any directory listing. A lost file can be recovered in its corresponding directory, if that directory still exists. If the corresponding directory no longer exists, CHKDSK creates a directory at the root of the disk and moves the file to it.

Step 3: Checking security descriptors

Security descriptors contain information about the owner of the file or directory, NTFS permissions for the file or directory, and auditing information for the file or directory. CHKDSK checks the structure of each security descriptor, but does not verify the actual existence of the listed users or groups or the validity of the permissions granted.

Stage 4. Checking sectors

This stage of CHKDSK execution is determined by the presence of the parameter /R when starting the program. Searches for bad sectors in volume free space. CHKDSK attempts to read every sector on the volume, and if an error is detected, the cluster that contains the sector is marked as bad and excluded from logical structure volumes Even without using a key /R the program always reads the sectors related to the table MFT(to metadata). In addition, the sectors that are used for the user data area are checked in the previous stages of CHKDSK.

It is necessary to take into account the fact that the execution time of CHKDSK with the key /R may be significant. In addition, modern hard drives have a built-in self-test and parameter monitoring system (S.M.A.R.T), the presence of which makes it pointless to use the search mode for bad sectors using CHKDSK, since all modern drives constantly perform internal routines for monitoring technical condition and self-diagnosis, as well as procedures built into the firmware for reassigning poorly readable sectors (unstable sectors) to sectors from the reserve area (remap or remap procedure). These processes occur invisible to the computer user. Therefore, the presence of Bad Blocks is possible only if there is no free space in the reserve area for reassignment, or if failures occur while writing data to the sector, for example, during an emergency shutdown of the primary power supply.

When lost files are detected, the program CHKDSK creates them in the file system structure as files with the extension .CHK. In practice, information from such files can be recovered manually only in cases where it is presented in text form. In some cases, you can use software third-party manufacturers, such as the utility

Restoring a hard drive or flash drive does not always require the use of special software; Sometimes you can eliminate errors using the built-in Windows utilities, which is called CHKDSK (check disk). This program will check the disk for errors and correct them if found. CHKDSK can be launched in several ways, but we will focus on the option using the command line.

Command line recovery

To execute hard restoration disk using the CHKDSK utility, run the command line:

  1. Press Win+R and execute "cmd".
  2. Enter a command like “chkdsk E: /F /R”.

If the disk is in use by the system, the computer will reboot to complete the check. Correcting errors on a flash drive using the CHKDSK utility does not require a reboot.

Let's look at the command syntax:

  • “Chkdsk” – launch the checking utility.
  • “E:” is the letter of the hard drive or flash drive partition that needs to be checked using CHKDSK.
  • “/F” – error correction.
  • “/R” – recovery of damaged sectors.

If you don't like working with the command line, run disk check via Windows interface:

Checking a hard drive or flash drive partition through the Windows interface is no different from this procedure on the command line. If the disk partition is in use, the system will reboot.

Windows won't boot

If the system constantly restarts due to hard drive errors or does not boot at all, then to restore the hard drive via the command line you will have to use the installation flash drive. If you have Windows XP, then run the recovery console:


If the verification utility manages to detect and eliminate errors and bad sectors, then after a reboot you will get a normally functioning system.

On Windows 7, after the first installer screen appears, you need to go to the “System Restore” section. On Windows 8.1 and Windows 10, the section is called “Diagnostics”, it has a subsection “Advanced options”. From the list of available tools, select Run Command Prompt.

At this point, many users make the mistake of entering the chkdsk command without taking into account the drive letter from installed Windows. The problem is that in the recovery environment the letters are assigned slightly differently - “C” denotes a 100 (500) MB partition allocated for the needs of the system, and a volume with Windows files becomes "D", etc.

To find out the exact letter, type “notepad” in the command interpreter window and press Enter. Notepad will open: expand the File menu, click Open. In the Explorer window, go to “Computer” and see what letter is assigned to the Windows file partition.

Once you know the partition letter, write it in the command syntax: for example, chkdsk D: /f. The disk check will start. If you need to scan HDD to detect bad sectors, then run chkdsk D: /f /r. When prompted that it cannot be completed, type "Y" and press Enter.

The disk scan and recovery will start. If everything was done correctly, then after completing the procedure the system will work correctly. Don't forget to disable booting from the flash drive if you set it in the BIOS, otherwise Windows will not start.

CHKDSK is short for check disk, which roughly translates to “disk check.” This standard application for the Windows operating system, which checks the hard drive for file system errors. Moreover, the application can fix file system errors.

The utility is built into the operating system, so you won’t have to search for it for long. So, attention.

Open “Computer” and select the hard drive that interests us. We right-click on it, after which a menu appears. Select “Properties” from the menu.

The disk properties window will appear in front of you. Select the "Service" Tab and click "Run Check".

A small window will appear. In it you need to check the boxes (or check them as you wish) next to the items “Automatically correct system errors” and “Scan and repair bad sectors”. Next, click the “Launch” button.

If it is not system disk, the check will be launched, which is what you will see.

If the disk is a system disk, that is, it is currently in use, you will be prompted to check it the next time you start the computer. Click OK or, in my case, “Schedule Check Disk.” In this case, the check will be performed the next time you restart the computer.

How to run CHKDSK from the command line?

There is nothing complicated here. Click “Start” and in the “Search programs and files” line write the word cmd. A shortcut will appear at the top of the window. Right-click on it and select “Run as administrator.”

After you have launched the command line as an administrator, enter the command chkdsk c: /f, where c is the drive letter that needs checking, and /f is a parameter that specifies how errors on the drive will be corrected. Press Enter.

If the drive is a system drive, you will receive an error that the drive cannot be locked and the CHKDSK command cannot be executed. You will be prompted to check the volume upon reboot. Type Y and press Enter if you agree, or N and press Enter if you do not want to check on reboot.

If the disk is not a system one, the application will perform a scan and all scan results will be displayed on the command line. By the way, the process of finding errors and correcting them can take from several minutes to several hours, depending on the configuration of the disk and system.

And removable storage media are quite susceptible to various kinds of software failures, errors and even physical breakdowns, which leads to damage to the information stored on them. It is not surprising that sometimes you can see system messages like “The file is damaged. Run the CHKDSK utility." What kind of program is this, what is it for, how to launch and use it correctly will be shown at the most simple examples.

What kind of program is CHKDSK?

Let's start our consideration of this utility utility with the fact that it is present in all versions of operating systems. Windows systems, however, depending on the OS modification used, it can behave completely differently. Each user should clearly understand that the main purpose of this program (and this is precisely the program, since it corresponds to an executable EXE file) is to run a disk scan, and it may not necessarily be a hard drive. In this case, it is implied that this applet can also be used to check any removable media, and for logical partitions.

The file or directory is damaged. Run CHKDSK

Let's see why the system displays messages about damaged files and directories? In fact, notifications appear when you try to open or run a file (or even without it at all), like “The file is damaged. Run the CHKDSK program”, it may not mean problems with the file object. Everything may be fine with the file itself, but problems may be found with the media on which it is recorded. In particular, this concerns the fact that the system simply cannot read the sector or cell in which information about this file. However, there is also another side to the coin. The fact is that the capabilities of the verification utility are such that it can not only correct errors of any information carrier, but also restore file system, if it has been corrupted or converted, for example, to unreadable RAW format. And to restore the initial file structure Without resorting to low-level formatting tools, you can just use the CHKDSK utility, which allows you to completely save the information present on the disk.

We’ll look at how to run CHKDSK on Windows systems a little later, but for now let’s dwell on the issues related to the automatic activation of the check when the system is restarted, which is clearly observed in Windows versions 7 and below.

As a rule, a warning about running the disk check program when you turn on the computer or restart Windows with a countdown appears if the shutdown, as the system itself considers, was carried out incorrectly (for example, a non-standard mode was used to shutdown, but a shutdown was performed by long pressing the power button on system unit or on the laptop panel). It is in such situations that the system immediately gives itself an indication that errors may have appeared on the disk, although in reality this may not be the case. The same may apply to removable storage devices when they were removed incorrectly - either at the time of copying files, or even during the formatting process. Only in this case is a proposal issued, and in the case of stationary hard drives, the check, if not canceled within a certain period of time, starts automatically and can, by the way, be launched every time the system starts, although hypothetically present errors and failures were corrected in the past once.

How to disable disk check at system boot?

To get rid of the disk check starting every time you turn on the computer, you will have to dig a little into the system registry (regedit). First, you should search and pay attention to the RunOnce directories (only two will be found). The corresponding active key can be registered in them.

But usually, to deactivate the execution of the CHKDSK applet at startup, as if it were in the system startup, you need to use the HKLM branch, and through the control sections in the SYSTEM directory you should find the Session Manager folder, and in it for the BootExecute parameter on the right, delete the key value, leaving the field completely empty. If you look closely, this is the value that corresponds to launching the disk check utility. However, such actions should be performed only at your own peril and risk. Even Microsoft specialists who recommend such drastic methods of disabling verification say that they are not responsible for the actions performed by the user.

How to run CHKDSK on Windows 7 or any other system via GUI

But let's get back to the hard drive or removable media scan tool itself. First, let's see how to run the CHKDSK program, so to speak, in the standard version, using for this purpose known to everyone Windows user facilities.

To start the verification tool, just use the most common “Explorer”, select the properties item through the RMB menu, go to the service tab, and then click the corresponding button. In modification systems seventh and lower, you can use additional verification parameters, which consist of enabling automatic error correction and eliminating problems with bad sectors. In the eighth and tenth modifications such actions are not required.

Why doesn't the scan start?

How to run CHKDSK one of the most simple methods, figured it out. Now let's look at the situation when, when starting the utility or when using additional parameters, an error message is displayed stating that the selected disk with the parameters being set cannot be checked because this disk is in use. Many users are put off by this notification, but in reality there is nothing scary here. It’s just that the operating system cannot automatically correct errors in the system partition, where it itself is located. How to run CHKDSK in this case? There are options too.

Start scanning from a file

First of all, pay attention to the eponymous executable file utility, which is located in the System32 directory. Despite the fact that usually executable components located in this folder can be opened through the Run console, such actions cannot be performed with the verification utility.

If you want, you can run it as administrator directly by using the file, but in this case the tool will open in command console, and the system will report that parameter F (automatic error correction) is not activated.

Start disk check from the command line

Therefore, it is best to run the CHKDSK utility from the command line. It is advisable to open the command console itself with administrator rights. As for the options for starting the scan, you can simply enter the main command and press the enter key.

By default, the system partition will be scanned in several stages. To start the utility in relation to other logical partitions or media currently connected to the computer, you should indicate their designation in the form of the corresponding letter with a colon. So, for example, if the flash drive in the system is designated “Disk F”, the check command will look like this: chkdsk F:. Many have probably already noticed that the case plays absolutely no role when entering command letters in the console. Capital letters usually included simply for convenience, to emphasize the commands themselves or to differentiate them from attributes.

Benefits of the Shell and Commonly Used Validation Attributes

As for using the command line itself, there is a lot of interesting stuff here. The very first and main advantage is that you can use additional verification attributes that are not available for the utility tool with its standard call. Attributes can be combined with each other in completely different variations.

View full information You can learn about all available tools by calling help with the chkdsk /? command. The second point is related to the fact that in a running system, through the command console (and only through it), you can restore the file system of any partition or media if it has been damaged or changed to unreadable (RAW). To do this, the command uses the above F attribute. The third positive aspect is related to the fact that the command line is available in the toolkit of any installation or recovery disk, that is, you can use disk check with all the ensuing consequences even if the operating system does not boot as times due to problems with the hard drive.

Alternative methods for checking and repairing a disk

Now let's look at the appearance of the request “The file is damaged. Run CHKDSK" on the other side. Basically, if the user doesn't like using regular funds Windows, you can do things differently and check using other methods. We are talking about the use of specialized programs, which include all kinds of optimizers like CCleaner, Advanced SystemCare, etc. Here you don’t really need to think about how to run CHKDSK (meaning disk check).

It is enough to simply mark the required module in the troubleshooting section in one click or call the corresponding tool separately, if its availability in this form is provided. Of course, its functionality is completely analogous to the standard one. Windows tools cannot be named, since sometimes even other verification and optimization methods can be used. However, this absolutely does not mean that such modules work worse.

Recovering a disk after critical failures if Windows tools have no effect

Finally, we can note one more tool, which, if completely analogous standard means operating systems are not, then by at least, very close to them. We are talking about restoring hard drives or removable media using a unique HDD programs Regenerator. Actually, here you also don’t need to think about how to run CHKDSK in the form in which the command is presented in this particular package. Scan and recovery will be initiated automatically. True, this particular utility is no longer designed to correct errors, but to eliminate performance problems hard drives due to magnetization reversal of their surface.

Conclusion

This is briefly all about the standard Windows utility CHKDSK, used to check hard drives and external drives for errors with the ability to automatically correct them. If we can draw a conclusion about the optimal use of this tool, it is best to launch it exclusively from the command line, although many ordinary or novice users do not like it. But in vain, because it is the command console tools that allow you to eliminate many problems with the operating system, including hard drives and removable drives.