• The chkdsk utility. Checking and fixing disk errors using the Windows Chkdsk utility

    Checking the hard drive for errors necessary in case of slow operation or freezing of the computer, as well as failure of the operating system. Often, many users try to resort to third-party software, which is inconvenient for simply checking the hard drive for errors. Therefore, in this article we will consider “ how to check hard drive for errors» using two methods integrated into Windows OS.

    There are two ways to run disk scan:

    • running the chkdsk utility using the command line (be sure to run it with administrator rights);
    • checking the disk using standard tools in the Windows graphical interface, or rather through “disk properties”.

    Checking the hard drive for errors using the command line (method I)

    To launch the built-in utility CHKDSK You must run the command line console with administrator rights. To open it, use the keyboard shortcut “Win+R”, in the “Run” window, enter the value “cmd” in the empty field and run it. For more information, see: "Windows Command Line".

    As indicated in the figure, we have entered one command with additional parameters that will check the hard drive for errors - CHKDSK C: /F /R, Where:

    Chkdsk– specify the name of the utility for checking the hard drive;

    C:– this parameter means that we will check partition C (system disk);

    /F– this option will correct errors on the disk.

    /R– search for damaged sectors and recovery of surviving information.

    After entering the command, a message will appear indicating that the disk will be checked for errors the next time the system is rebooted. Agree, enter "Y" from the keyboard and restart the computer to begin the test.

    Additional information about utility parameters сhkdsk can be obtained by running it with key "/?".

    Checking the hard drive for errors using the graphical interface (II method)

    Regardless of the operating systems used - Windows XP, Windows 7 or Windows 8, you need to go to the icon on the desktop “My Computer” - “This Computer” - “Computer”.

    Next, select the desired drive, right-click and select “Properties”. To check your hard drive, go to the “Service” tab. In the window that opens, click the “Check” button. When you click on the button, a special window will appear, move the cursor and click “Check disk”.

    After clicking, a scanning window will appear, which notifies you about the analysis of checking the hard drive for errors. The disk check process may take some time.

    If completed successfully, the above image will appear.

    And if the scanned disk actually contains errors, the program will offer to restore this disk. Therefore, you need to click on the “Repair disk” button and if the operating system cannot fix the errors, this usually occurs on the system drive C, then the error checking program will suggest “Repair the disk at next reboot”, click this button, the program will close and you will need to restart your computer.

    After the reboot, when your computer starts to start, a special application will open that will check and correct errors on the hard drive being checked. Here are two simple ways you can check any local drive for errors.

    Windows operating systems are equipped with internal tools for emergency troubleshooting and subsequent troubleshooting. If the user does not have the opportunity to use additional software, and standard OS tools do not help, you can use the chkdsk command. The command and the utility it runs have shown excellent effectiveness in solving Windows crashes.

    Launch via Disk Properties

    If the OS is stable enough, the utility can be launched in windowed mode. On different versions of Windows there are practically no differences in launching from “Disk Properties”:

    The system will prompt you to restart your PC. During boot, a system disk check will run. If the user has checked the appropriate boxes, Windows will fix damaged files and sectors.

    Run from the command line

    The command line is activated either by the Win+R key combination, or in the start menu, where there is a search bar (you need to enter the query “cmd”). You only need to run the command line as Administrator.

    In the black window that opens, enter the command “chkdsk C: /F” and press the enter key.

    • C: - the name of the disk to check, can be changed;
    • /F – type of operation that the utility will perform.

    If launched from the command line, the scan begins immediately, without restarting the PC.

    How to start if Windows won't boot

    Some critical errors, unsuccessful updates and operations lead to the fact that the operating system cannot fully turn on. Neither safe mode nor running the latest working version helps. In this case you should:

    1. Connect a boot disk or USB flash drive with Windows to the computer;
    2. Enter the BIOS and set it to run not from the hard drive, but from the connected media;
    3. Start the device;
    4. In the OS installation menu that opens, find the “System Restore” button, click;
    5. Click “Next” when the program prompts you to use OS recovery tools;
    6. Click “Command Prompt” in the window that opens.

    When the command line opens in front of the user, you need to use the algorithm from the previous section - enter the chkdsk command and wait for the system to be diagnosed / troubleshooted.

    CHKDSK options

    The /F value is not the only possible command parameter:

    • /F – diagnoses and corrects failures on the specified disk;
    • /V – displays a message about cleaning or the full path for each file on the disk;
    • /R – search and restore damaged sectors of the hard drive;
    • /X – forced disk disconnection;
    • /I – lowering the criticality of file evaluation during diagnostics;
    • /B – re-evaluation of clusters assessed as damaged;
    • /spotfix – spot fixing of errors;
    • /sdcleanup – collection and removal of unnecessary files;
    • /offlinescanandfix – offline scan, correction of errors in the specified disk;
    • /markclean – marks the disk as clean if no errors were found during the scan.

    It is not necessary to run the utility several times if the user needs to perform different functions. The command might look like this: “chkdsk C: /F /R”. Utility parameters are added and removed as necessary.

    How to remove CHKDSK startup at OS startup

    If the utility has completed its functions, but continues to start every time you boot the PC, you can disable it in the Windows registry:

    1. Open the registry editor, enter “regedit” in the Start menu search;
    2. Go to the path “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager”;
    3. In the right part of the window, find the “bootexecute” parameter, double-click on it;
    4. Enter the value autocheck autochk /k:C *, save.

    The CHKDSK program (from English “check disk” - check disk) is a utility utility for Windows and DOS operating systems for checking the hard drive file system for errors. In Microsoft's OS, the built-in utility also analyzed disks for the presence of physically damaged clusters. Starting with Windows 7, the program finds and fixes only system failures.

    Operating principle

    CHKDSK does not correct errors, but only detects them on the disk surface. To eliminate failures, you need to select the F flag; to search for damaged areas of the hard drive, you need to select the R flag. If you select the F and R flags, it will be impossible to work on the disk being checked. You must close all files on it. Depending on the size of the HDD, its contents and the number of errors on it, the scan can take from ten minutes to several hours. The utility can restore bad sectors, find lost files, files with broken clusters, and directory errors.

    The program log is located at (for Windows 7):

    Execution from the command line

    To run CHKDSK, administrator rights are required. Let's look at how to perform the check from the command line.
    The syntax for specifying the path to the hard drive looks like this:

    Where:

    • Volume – Just the letter of the disk being analyzed;
    • file_name – Check a single file. Specified only if the file system is FAT/FAT32. The parameter must contain the entire file name;
    • /F - Enables error correction. Example:

    • /R We are looking for bad sectors. Works with /F enabled:

    • /V Specifies that the utility should display the file path in the report. For NTFS, additional cleaning messages are displayed;
    • /X disables the volume before analysis, valid when /F is enabled. Looks like this:

    • /L Specifies the size of the log file in kilobytes. Example, for a 55 MB file:

    • /I Makes the analysis less deep, but faster;
    • /C The program will not check for loops inside directories;
    • /B does not affect previously detected bad sectors. View:

    If chkdsk cannot start immediately, the command prompt will display the following message:

    You need to press Y on your keyboard and then Enter.
    It should be noted that the most useful parameter is R, as it allows you to fix bad sectors. The utility itself, of course, does not repair mechanical faults. The team looks for bad sectors and restores lost information. Launching from the console works on all Windows operating systems.

    Windows 7

    Since the seventh version of Windows is the most common, let's look at another popular way to run the CHKDSK program. In Windows 7, you can run it from the “My Computer” folder by clicking on the icon of the disk being scanned and selecting Properties, going to the Tools tab, and clicking the “Run scan” button. If required, check the boxes:


    And

    then press Launch.
    After fixing system errors, in Windows 7 you may see the following message:

    When you start Windows 7 again, the program will automatically start working. If after a reboot it does not start on its own, you should launch it again from the command line (see above).

    Checking the disk if the OS does not boot

    If, after a sudden failure, the OS refuses to start, you can check it using a boot disk. To begin, insert the CD into the drive and start the computer. A message will appear on the screen telling you to start from a bootable CD. Usually it looks like this:

    Next, you will see a blue screen on the Windows console. You need to run OS recovery from the console. If you set an administrator password, you will need to enter it. If not, you will not be prompted for a password. Press R on the keyboard and press Enter.
    A black command prompt window should appear. You can already enter commands there. Before running CHKDSK, it is advisable to enter the HELP command. In the list of commands that appear, find the name of the utility. All movements in the command line are carried out using the keyboard (in this case, using the up and down arrows). Or, immediately enter on the command line: CHKDSK/? or CHKDSK HELP.

    We already talked about command line switches above, but it’s still worth reading the detailed information.
    The command is entered with the label of the hard disk volume, if there is more than one, and the R key. It looks like this:

    To run the program from the console, you need the AUTOCH.EXE file. if it does not find it on the disk, it will start from the CD, but if it is not there, then a message will be displayed asking you to indicate the path to this file.
    This method is effective for all Windows operating systems, including Windows 7. It is quite possible that you will be lucky and the utility will correct errors resulting from a system failure. After the check is completed, the program will display a report. Now you can try to start from the hard drive. Reboot using the CTRL+ALT+DEL keys. Remove the boot CD from the drive. You may need to change the boot method in the BIOS. The errors have been corrected, which means the system should start!

    Errors when running the utility

    No matter how useful the sector check utility is, unfortunately, the developers made a number of mistakes in it. In the Windows OS line from NT to Vista (SP1), they were not fully corrected. This error does not occur in Windows 7.
    The following situation may arise: after analyzing and correcting errors, the disk cannot be accessed. Reinstalling Windows will help, as will an additional utility from Microsoft Fix It, which restores security settings.

    Always running on boot

    If there is any mechanical damage on the hdd or a so-called “dirty bit” (a cluster that cannot be repaired), the system will automatically run CHKDSK every time it boots. There are several ways to solve this problem. Firstly, you can still try to replace/repair the disk, defragment it, format it. This is not always possible, we will try to disable the check from startup.

    1. Make changes to the registry. Run REGEDIT on the command line. We find:

    In the BootExecute parameters we delete all information, having previously saved the original value of the parameter. The value looks like this: autocheck autochk *. After reboot, CHKDSK should not start.
    2. In the same registry section, set the value of the parameter BootExecute type:

    where C is the volume label. If you need to specify other drives, this can also be done via /, for example:

    Finally, to revert everything back, set the BootExecute parameter to autocheck autochk. Making changes to the registry requires experience and is not advisable for the average user; it is recommended to use it only when absolutely necessary.

    You need to check regularly by running the CHKDSK program if the disk contains:

    • There are databases;
    • Large spreadsheet files are located;
    • A large amount of information is recorded and deleted.

    It is better to analyze the disk from which the operating system is launched for errors before booting.

    Both comments and trackbacks are currently closed.

    Abbreviated as "check disk", the CHKDSK command is a Prompt command used to check a specified disk and repair or restore data on the disk if necessary.

    Chkdsk also marks any damaged or faulty sectors on a hard drive or disk as "bad" and recovers any information not already damaged.

    Availability of the Chkdsk command

    The CHKDSK command is available from the command line in Windows 10, Windows 8, Windows 7, Windows Vista and Windows XP operating systems.

    The CHKDSK command is also available through the Command Prompt in Advanced Startup Options and System Recovery Options. It also works from the Recovery Console in Windows 2000 and Windows XP. Chkdsk is also a DOS command available in most versions of MS-DOS.

    Note. The availability of some chkdsk commands and other chkdsk command syntax may vary from operating system to operating system.

    Chkdsk command syntax

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

    volumeThe drive letter (followed by a colon), mount point, or volume name. (eg C:)
    file nameFiles checked for presence
    fragmentation (FAT/FAT32 only).
    /F This option of the chkdsk command will correct any errors found on the disk.
    /V For FAT/FAT32: displays the full path and name of each file
    on disk. For NTFS: Displays cleanup messages (if available).
    /R Searches for damaged sectors and restores the surviving ones
    information (requires /F when /scan is not specified).
    /X Preliminarily dismounts the volume (if necessary).
    All open handles for this volume will become invalid (requires /F).
    /I NTFS only: Performs a less stringent check of index entries.
    /C NTFS only: Skips checking for loops within the folder structure.
    /B NTFS only: Re-evaluates damaged clusters on the volume (requires /R).
    /L:size Use this chkdsk command to change the size (in KB) of the log file. The default log file size for chkdsk is 65536 KB; you can check the current log file size by running /L without the "size" option.
    /perf This option allows chkdsk to run faster while using more system resources. It must be used with /scan.
    /scan This chkdsk option runs an online scan on an NTFS volume but does not attempt to repair it. Here "online" means that the volumes do not need to be mounted, but can remain online/active instead. This is true for internal and external hard drives; you can continue to use them throughout the scan.
    /spotfix This chkdsk option simply dismounts the volume to fix the problems sent to the log file.
    /sdcleanup NTFS only: Collects unnecessary descriptor data
    safety as garbage (requires /F).
    /offlinescanandfix Runs an offline scan and repair of the volume.
    /freeorphanedchains FAT/FAT32/exFAT only: frees orphaned cluster chains
    instead of restoring their contents.
    /markclean FAT/FAT32/exFAT only: Marks the volume as clean if no corruption is detected, even if the /F option is not specified.
    /? Use the help switch with the chkdsk command to show detailed help about the commands listed above and other options you can use with chkdsk.

    Note: The /I or /C option reduces Chkdsk execution time by skipping some volume checks.

    Note: There are other less commonly used chkdsk command switches such as /B to re-evaluate bad clusters on a volume, /forceofflinefix which runs an online scan (scan while the volume is active) but then forces the repair to work offline (after the volume has been taken offline), /offlinescanandfix, which runs an offline chkdsk scan and then fixes all the problems found and others which you can read more about via /? switch.

    Note. Parameter /offlinescanandfix matches parameter /F except that it is only allowed on NTFS volumes.

    If you are using the chkdsk command from the recovery console on older versions of Windows, use /p instead of /F above to instruct chkdsk to perform an extensive disk check and fix any errors.

    Chkdsk Command Examples

    In the example above, since no drives or additional options were entered, chkdsk simply runs in read-only mode.

    Note. If problems were found when running this simple chkdsk command, you should make sure to use the example below to fix any problems.

    chkdsk c: /r

    This example uses the chkdsk command to perform an extensive disk check C: to correct any errors and search for any recovery information from bad sectors. This is best used when you are running chkdsk from outside of Windows, such as from a recovery drive where you need to specify which drive to scan.

    chkdsk c: /scan /forceofflinefix

    This chkdsk command runs online scanning on volume C: so you don't have to unmount the volume to run the test, but instead of fixing any problems while the volume is running, the problems are sent to a queue to be resolved offline.

    chkdsk c: /r /scan /perf

    In this example, chkdsk will fix disk problems C:, when you use it, and will use as many system resources as allowed to keep it running as quickly as possible.

    Related Chkdsk commands

    Chkdsk is often used with many command line commands and recovery console commands.

    The chkdsk command is similar to the scandisk command used to check a hard drive or floppy disk for errors in Windows 98 and MS-DOS.

    Displays a disk status report in a form that depends on the file system used. Team chkdsk also lists errors on the disk and corrects them. Command executed without parameters chkdsk displays information about the status of the current disk.

    Syntax

    chkdsk [volume: ][[path] file name] [/f] [/v] [/r] [/x] [/i] [/c] [/l[: size]]

    Options

    volume : Specifies the drive letter (followed by a colon), mount point, or volume name. [ path] file name Specifies the location and name of the file or set of file names for which the command chkdsk will check the degree of fragmentation. You can use wildcard characters (* and ?) to specify multiple files. /f Specifies correction of errors on the disk. The disk must be locked. If the disk is not locked with the command chkdsk, you are prompted to check the disk the next time you restart your computer. /v Displays the names of the files and directories being scanned. /r Detects bad sectors and repairs the part of the data that can still be read. The disk must be locked. /x Use only with the NTFS file system. If necessary, initiates a volume dismount operation as the first action. All open disk handles will be invalid. Parameter /x also includes parameter functionality /f. /i Use only with the NTFS file system. Performs less thorough checking of index entries, which reduces the time required for the command to run chkdsk. /c Use only with the NTFS file system. Skips checking for loops in the folder structure, reducing the time it takes for a command to run chkdsk. /l[:size] Use only with NTFS file system. Sets the specified log size. If the size is not specified, the parameter /l displays the current size. /? Display help on the command line.

    Notes

    • Executing a command chkdsk

      To run the command chkdsk For hard drives, you must be a member of the Administrators group.

    • Checking for locked drives on reboot

      If you need to fix disk errors using the command chkdsk, you cannot open files on this drive. Otherwise, the following error message is displayed:

      The Chkdsk command cannot be executed because the specified volume is in use by another process. Should I scan this volume the next time I reboot the system?

      If the user chooses this option, the command chkdsk will check the disk and automatically correct errors when you restart the computer. If the disk partition being checked is bootable, the command chkdsk will automatically restart your computer after checking this disk.

    • Error Report

      Team chkdsk Performs disk space and usage checks for File Allocation Table (FAT) and NTFS file systems. Team Chkdsk allows you to obtain a status report with information for each file system. The disk status report includes a list of errors found. If the team chkdsk launched without parameter /f on the active partition, you may receive a message indicating that there are serious errors because the disk cannot be locked. To find errors, command chkdsk needs to be run from time to time on each disk.

    • Bug fixes

      If the command line option is specified /f, program chkdsk corrects errors on the disk. When working chkdsk It must be possible to lock the disk to correct errors. Since correcting errors usually changes the file allocation table and sometimes results in data loss, the program chkdsk requests confirmation in the following form:

      Lost clusters: 10; chains: 3.

      Convert lost cluster chains to files?

      If you enter Y Windows saves each orphaned chain in the root directory as a file with the format name File nnnn.chk. After completion of execution chkdsk You can check these files for the information you need. If you enter N, Windows corrects disk errors without saving data from orphaned blocks.

      If the command line option /f not used, program chkdsk It only displays a message about the presence of errors in the file, but does not correct them.

      If the team chkdsk /f is running on a large disk (for example, 70 GB) or the disk contains a large number of files (for example, several million), to terminate the program chkdsk may take a very long time (possibly several days). During this entire time, the computer will be unavailable to users, since chkdsk does not return control until completion.

    • Checking disks with the FAT file system

      chkdsk about the status of a disk with the FAT file system in the following format:

      Volume Serial Number: B1AF-AFBF

      72214528 bytes total on disk

      73728 bytes in 3 hidden files

      30720 bytes in 12 directories

      11493376 bytes in 386 user files

      61440 bytes in bad sectors

      60555264 bytes available on disk

      2048 bytes per cluster

      Total clusters on disk: 35261.

      29568 clusters on disk

    • Checking disks with the NTFS file system

      Windows system displays program report chkdsk about the status of a disk with the NTFS file system in the following format:

      File system type: NTFS.

      Checking files...

      File verification is complete.

      Checking indexes...

      The Indian check has been completed.

      Checking security descriptors...

      The security descriptor check is complete.

      12372 KB total on disk.

      3 KB in 1 user files.

      4217 KB is used by the system.

      8150 KB free on disk.

      Cluster size: 512 bytes.

      Total clusters on disk: 24745.

      16301 clusters on disk.

    • Usage chkdsk with open files

      If the parameter is specified /f, team chkdsk displays an error message if open files are found on the disk. If the parameter /f is not specified and open files were found on the disk, chkdsk can display messages about lost disk blocks. This will happen when the open files are not yet recorded in the file allocation table. If the program chkdsk reports a large number of lost disk space blocks, disk repair should be considered.

    • Detecting physical disk errors

      Use a command line option /r to detect physical disk errors in the file system. For information about how to recover physically damaged files using the command recover click the link.

    • Bad disk sectors report

      Bad sectors reported by the command chkdsk, were marked when the disk was first formatted. Such sectors are not dangerous.

    • General information about program termination codes

      The following table lists the exit codes that may be contained in a program report chkdsk after completion of its execution.

    • Team chkdsk with other parameters is available in the recovery console.

    Examples

    If you want to check the disk in drive D and fix any errors found in Windows, enter the following command:

    If an error is detected, program execution сhkdsk pauses and appropriate messages are displayed. Upon completion of the command chkdsk A report containing information about the current status of the disk is displayed on the screen. Until work is completed chkdsk You cannot open any files on the specified drive.

    To check the fragmentation of all files in the current directory on a FAT drive, enter the following command:

    Chkdsk will report the disk status, followed by a list of fragmented files that match the command pattern.

    For questions, discussions, comments, suggestions, etc., you can use the forum section of this site (registration required).