Computers Windows Internet

Check disk for errors and bad sectors Chkdsk. Check disk for errors and bad sectors Chkdsk Check hdd logs in win 7

The integrity of files on a hard disk is an important component of a stable computer system. The appearance of various errors in files and file structure, violation of the logical structure of the disk, the appearance of bad sectors on the disk leads to incorrect work PCs, system crashes, glitches and freezes. To prevent such problems in the operating system, from archaic MS DOS to modern versions of Windows 10, a special tool is provided to check and restore the integrity file system, deal with logical and physical errors on the disk. We are talking about the system utility CHKDSK, and in this material I will tell you what this utility is, what it is for, and how the CHKDSK / F / R command can help to fix file system corruption on your PC.

Use CHKDSK / F / R to repair file system corruption

What is CHKDSK?

CHKDSK (short for English "check disk" - check disk) Is a system tool designed to check the hard disk for logical errors, bad sectors, and fix problems it finds.

Functionality CHKDSK allows you to restore the logical structure of the disk, including the correction of incorrect entry points MFT (master file table). In the case of finding broken sectors, acting in two main forms - "soft" (appear when the data was written incorrectly) and "hard" ( broken sectors caused by physical damage to the disk), CHKDKS usually recovers "soft" bad sectors, and marks the "hard" sectors so that they cannot be used by the system.

The operation of this utility can take quite a long time, and for its operation CHKDSK requires the obligatory presence of exclusive rights to write the disc. Therefore, if you, while in Windows OS, want to check the system drive (usually C) using this instrument, then the system will prompt you to restart your computer, and, at the next start, CHKDSK will receive extended rights, and then it will check your disk for errors.

Functionality of the CHKDSK command

There are two main forms of activating this utility, allowing you to run chkdsk:

Set the required checkboxes and click on "OK"
  • If the disk is not a system disk, then the check will be carried out immediately, if the disk is a system disk, then the computer will add the check to its schedule. this disk, and at the next reboot your disk will be checked by the CHKDSK functionality;
  • Command Line Activation... Run command line as administrator, enter in it:

CHKDSK (volume name) / (flag)

For example, a commonly used form of CHKDKS activation is the command:

CHKDSK C: / F / R

where C: is the volume name, / F and / R are the flags used.

The command I gave runs CHKDSK, instructing the latter to check the C drive for bad sectors, and restore the data on them ( flag / F obliges CHKDSK to fix disk errors, flag / R obliges CHDSK to look for bad sectors on the disk and try to recover data on them).


Other flags (commands) of CHKDSK are as follows:

  • / V- while checking the FAT / FAT32 file system, it shows the path to files on the disk and their names;
  • / X- preliminary disconnection of the volume (mandatory activation of the / F flag is required);
  • / I- disables scrutiny of indexes. Used only in the NTFS file system, it can speed up the disk check;
  • / C- disables checking of cycles inside folders. Used only in NTFS, also allows you to speed up the scan;
  • / L: (size in kilobytes)- resize the log file to the specified size (NTFS only);
  • / B- repeated check of damaged disk clusters (only NTFS, requires the mandatory / R key)

If you just enter the command "CHKDSK" (without quotes) on the command line, then the utility "CHKDSK / F / R for repairing file system corruption" will scan your disk for errors in the "read only" mode, not correcting them.

Conclusion

Using the CHKDSK / F / R command in the command line on behalf of the administrator allows you to correct logical errors on the disk, as well as search for bad sectors on the disk and try to restore them later. Use CHKDSK at the slightest suspicion of damage to the file system, its functionality, as well as functionality system utility SCANNOW is a useful tool in the hands of an experienced PC user.

CHKDSK is a standard application for checking hard disk for errors, detecting bad sectors on the hard disk, fixing file system errors. CHKDSK (short for Check Disk) is built into operating system Windows.

The Chkdsk.exe program finds file system errors, bad bad sectors on the hard disk, and fixes the detected faults. If the disk check for file system errors reveals a problem, the CHKDSK check is launched when the computer is turned on.

When using Chkdsk.exe in different Windows versions, there are some differences:

  • In the operating room Windows system XP chkdsk utility finds file system errors and repairs bad sectors on the disk.
  • In Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Vista, with the default settings, the CHKDSK application finds file system errors, but does not fix them. To fix file system errors and check disk sectors, you must manually set certain parameters.

Problems in the Windows operating system affect its performance. Filesystem errors occur in the following situations:

  • Due to a power outage - when sudden shutdown the computer may experience an unexpected system failure (to prevent such situations, use a UPS - uninterruptible power supply).
  • In case of system infection with malware software.
  • Due to a malfunction of the computer hardware.

On a surface hard disk bad sectors may appear. When checking a disk using chkdsk, bad bad sectors of the hard disk are marked as bad, the system no longer reads or writes information from bad sectors of the disk. The system will try to recover data from bad sectors (clusters, directories), if possible.

Chkdsk disk check runs in two modes:

  • in the graphical interface by means of the system;
  • using the command line.

If the computer does not boot due to problems, you can check the hard drive using the Windows installation DVD. After booting from removable media, in the system recovery options, select the command line to run a disk check for errors.

In this tutorial, I'll show you how to use the CHKDSK app using the Windows 10 operating system as an example.

CHKDSK check to troubleshoot file system problems in the GUI

The easiest way to check the file system for errors is to run the CHKDSK program in the graphical interface using the system tools.

Follow these steps:

  1. Launch File Explorer.
  2. Click right click mouse on the local disk on which you want to check.
  3. In the "Properties: Local Disk (X :)" window enter the "Service" tab.
  4. In the "Check for errors" section, click on the "Check" button.
  1. In the Error Checking (Local Disk (X :)) window that opens, select Check Disk, even though the operating system says that no errors were found when checking the disk.

In Windows 7, additional check options are available; to run them, you need to check the boxes opposite the items:

  • Automatically fix system errors.
  • Check and repair bad sectors.
  1. The scanning process begins, which will take some time. The check time depends on the size of the local disk and the amount of data on the disk.

During file system error checking, the state is scanned:

  • The basic structure of the file system is checked.
  • File name associations are checked.
  • Security descriptors are checked.
  • The USN journal is checked.
  1. After the completion of the verification process, information about its result will open. In this case, the disk was successfully checked, no errors were found. If errors are found, you will be prompted to fix them.

For details, click on the Show Details link.

In the Event Viewer snap-in, click Details.

In the "Event Properties" window, in the "General" and "Details" tabs, you can detailed information the result of the disk check.

The information obtained about checking the disk for file system errors can be copied into Notepad or another text editor for further study.

How to run CHKDSK (check disk) in command line

The chkdsk command to check the hard disk with the specified parameters is executed from the command line:

  1. Run Command Prompt as Administrator. Read How To Find Command Prompt On Windows
  2. To check the system partition (system disk) in the command line interpreter window, enter the command:
chkdsk c: / f
  1. Press the Enter key.
  2. A message appears in the Command Prompt window stating that the CHKDSK command could not be executed because the specified volume is in use by a system process. To start checking the system disk after rebooting the system, press the "Y" key, and then press the "Enter" key.
  3. During the system reboot, the system disk will be checked and restored.

An example command pattern looks like this: ["chkdsk" (application name)], space, [letter of the scanned drive with a colon ("c:", "d:", "f:", etc.), path, or filename], space, [command parameters].

Command parameters have the following meanings:

  • / F - checks the file system and automatically fixes found errors.
  • / R - performing a search for bad sectors on the disk, restoring the contents (the command requires a mandatory key / F, for example: "chkdsk C: / F / R").
  • / V - display full paths of files, display names of files on the disk, in the NTFS file system - display messages about cleaning.
  • / X - unmount the disk before checking, the descriptors of this disk will not be checked (the mandatory / F switch must be set, example of the command: "chkdsk C: / F / X").
  • / I - Performs less stringent checks on index entries, CHKDSK performs faster but less thorough checks.
  • / C - skip checking cycles inside the folder structure.
  • / L: size - resize the log to the size specified in kilobytes.
  • / B - reset the scan results, re-scan previously found damaged sectors of hard disk (the / R key is required, example of the command: "chkdsk C: / F / R / B").

In most cases, to check the file system and fix bad sectors on the hard disk, it is enough to use the "F" and "R" flags.

How to disable check disk in CHKDSK at Windows startup

In some cases, the disk check is launched when the computer is turned on, before the Windows operating system boots. In most cases, you need to wait until the end of the check; a restart will not follow.

Constant disk check every time the system starts, signals the presence of problems and the need to eliminate them. Perhaps you should consider replacing your hard drive. There are programs, for example, that constantly monitor the health of your computer's disks.

To disable the launch of Chkdsk when booting Windows you can use 2 methods: change values ​​in the operating system registry, or use the command line.

Disable check disk on the command line:

  1. Run Command Prompt as Administrator.
  2. In the command line interpreter window, enter the command ("C:" is the name of the disk on which you want to disable the start of the disk check at system boot), and then press the "Enter" key:
chkntfs / x with:
  • If you need to disable scanning on multiple disks, add the appropriate drive letters separated by spaces to the command, for example, "chkntfs / x with: d:".
  • Using the "chkntfs / d" command, you can restore the original settings.

You can turn off automatic disk check when loading the operating system in the following way:

  1. Launch Registry Editor (type "regedit" in the search box, run the command).
  2. Follow the path:
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Session Manager
  1. Click on the Session Manager parameter.
  2. Find the parameter "BootExecute", click on it with the left mouse button.
  3. The default value is displayed in the Edit Multiline window.

  1. To disable disk check during Windows startup, add a parameter before the asterisk:
autocheck autochk / k: C *
  1. To disable scanning on several partitions, add drive letters separated by a space. Example for "C:" and "D:" drives:
autocheck autochk / k: C / k: D *

Conclusions of the article

The system application CHKDSK, built into the Windows operating system, is used to check the file system for errors and to detect bad sectors on the computer's hard drive. Using the utility, you can correct system errors and eliminate the negative impact (disable writing and reading) on ​​the system due to the presence of bad sectors of the hard disk.

On your local drive C :. After chkdsk finished, the results flickered on the screen for a few seconds, and then the computer booted. I was unable to read the results in time. Are the results saved in a text file?

4 Solutions collect form web for “Where are the chkdsk results located on Windows 7?”

As Randolph mentions, it's in the event viewer. More specifically, here:

Control Panel -> Administrative Tools -> Event Viewer -> Windows Logs -> Application -> Wininit

Wininit is in the column source .

To add to Paul's post:

Go to Start, then type Event Viewer (without quotes) in the search bar, and then select Event Viewer.

Since the Event Viewer can display tens of thousands or more events, it can be very difficult to find the "Wininit" event (chkdsk log).

To make it easier, when in " Event Log "Windows Logs" "Application"Go to" Filter the current log ... "Filter" Event Sources "check" Wininit »:

This will cause the Event Viewer to display only those sources that are "Wininit" (chkdsk logs only).

There are also chkdsk .log files which can be viewed in text editor located in: \ System Volume Information \ Chkdsk. You can view it only if Control Panel is selected Folder Options Hidden Files and Folders Show hidden files, folders and drives ”,“ Hide protected operating system files ”is unchecked, and you have acquired ownership of this folder.

Here alternative way view results (see here):

    Click on Windows keys+ R to open the Run dialog box, type powershell.exe and press Enter.

    In PowerShell, copy and paste the command below and press Enter. (See screenshot below). NOTE. To paste the copied command into PowerShell, you just need to right click in PowerShell.

    Enter the command

    Get-winevent -FilterHashTable @ (logname = "Application"; id = "1001") | ? ($ _. providername –match "wininit") | fl timecreated, message | out-file Desktop \ CHKDSKResults.txt

    You will now have a CHKDSKResults.txt file created on your desktop, which is the log file of your chkdsk scan results from the Event Viewer.

Event Viewer in System Application, but in some cases it doesn't show up at all.

CHKDSK used to check disks and display reports on the results of the check. Command line format:

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

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

File name Files scanned for fragmentation (FAT / FAT32 only).

/ F Correction of errors on the disk.

/ V Verbose Mode withdrawal. 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 a key / F).

/ L: size NTFS only: Resize the log file to the specified size (in KB). If no size is specified, the current value of the size is displayed.

/ X If necessary, forcibly dismount the volume. Any open descriptors for this volume will be invalid. (requires parameter / F).

/ I NTFS only: Less stringent check of index items.

/ C NTFS only: Skip checking loops inside 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! The F parameter is not specified.

CHKDSK is performed in read-only mode.

Checking files (stage 1 of 3) ...
The file check is complete.
Checking Indexes (Step 2 of 3) ...
Index check completed.
Checking Security Descriptors (Step 3 of 3) ...
Security descriptor validation completed.
CHKDSK checks the USN log ..
USN Journal Check Completed

488384000 KB total disk space.
482155688 KB in 332072 files.
108552 KB at 14989 indexes.
0 KB in bad sectors.
1120884 KB used by the system.
65536 KB used by the log file.
4998876 KB free on disk.

Cluster size: 4096 bytes.
Total clusters on disk: 122,096,000.
1249719 clusters on disk.

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

If in this mode checks CHKDSK cannot get exclusive access to the scanned volume, the program will ask you to set the mode to automatically start testing the specified disk at the next system reboot. The check will be performed by the Windows Session Manager service, according to the contents of the registry key
HKLM \ System \ CurrentControlSet \ Control \ Session Manager \ BootExecute
Check results can be viewed in the system event log - (Control Panel - Administrative Tools - Event Viewer - Application) service notifications Winlogon... The presence of a sign that the CHKDSK program starts at the next Windows restart can be checked using the command CHKNTFS, a link to the 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 of the test parameters.

The CHKDSK program is divided into three main passes, during which CHKDSK checks all the metadata on the volume, and an additional fourth pass. The term "metadata" means "data about data." Metadata is a file system add-on that tracks information about all 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, clusters containing bad sectors, etc. On the other hand, the data contained in the file is referred to as "user data". In NTFS, metadata is protected by the transaction log. The process of changing metadata is divided into certain logical stages, or transactions, which are recorded in the log. If the sequence of actions for changing the metadata is not logically completed, then the transaction log data is rolled back to the moment when this change was not started yet. In other words, using the transaction log significantly 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, as well as the amount of verification completed, expressed as a percentage (from 0 to 100). During this phase, CHKDSK checks the write segment of each file in the main file table ( MFT) volumes.

Stage 2. Checking indexes

Essentially, indexes are directories of a file NTFS systems... CHKDSK checks that there are no "orphaned" files and that all directory lists contain existing files. A lost file is a file for which a valid file record segment exists, but which is not listed in any directory listing. The lost file can be restored in its corresponding directory, if this directory still exists. If the corresponding directory no longer exists, CHKDSK creates a directory in the root directory of the disk and moves the file to it.

Stage 3. Checking security descriptors

Security descriptors contain information about the owner of a file or directory, about NTFS permissions for of this file or directory, and auditing for that file or directory. CHKDSK verifies the structure of each security descriptor, but does not verify that the listed users or groups actually exist or that the permissions were granted.

Stage 4. Checking sectors

This stage of the CHKDSK execution is determined by the presence of the parameter / R when starting the program. Searching for bad sectors in free space volumes... CHKDSK attempts to read every sector on the volume, and if an error is found, the cluster that contains the sector is marked as bad and removed from the logical structure of the volume. Even without using a key / R the program always checks by reading 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 phases of the CHKDSK.

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

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

In Windows 7 and earlier, the chkdsk disk check was launched when the PC was turned on, as a result of an incorrect shutdown. However, it could also be started independently via the command line. At the end of the scan, the user could see the results of the scan and the corrected errors. This feature is not available in Windows 10. On the monitor screen, the chkdsk scan report is displayed as a total percentage of completion. It would seem that this is enough, but experienced users you may need information about fixed bugs and changes made to the operating system. How to view chkdsk report in Windows 10?

Checking the disk and looking at the scan results in Windows 10

To check HDD for errors, you should run the chkdsk command. To do this, click "Start", then "Command line (administrator)". In the window that opens, enter "chkdsk D / f / r / v".

After scanning, close the command line and click "Start". In the search box, enter "Event Viewer".

A new window will open. In the left menu, select the section "Windows Logs" and "Application".

Right-click on "Application" and select "Find". Enter chkdsk and click "Enter".

The search will return the first log with ID 1001. At the bottom, go to the "General" tab and see the results.

Also running the command line with administrator rights and entered the request "get-winevent -FilterHashTable @ (logname =" Application "; id =" 1001 ") | ? ($ _. providername –match "wininit") | fl timecreated, message | out-file c: \ CHKDSK_REPORT.txt ", you can get a scan report.

You can open it in any text editor.