Check Disk or
chkdsk command is used to detect FAT16, FAT32, NTFS file system related errors, and fix them. Chkdsk can not recover corrupted files which are a hard situation. Chkdsk can be run from the command line or from GUI but the command line use is the most practical way.
What Is Chkdsk?
chkdsk is a system tool which is command line based. There is also a GUI to run chkdsk command. The chkdsk command is very similar to the Linux counter part fsck command. The chkdsk command is used to verify integrity of a volume and fix logical file system errors. The chkdsk command can be used in different Windows versions like Windows XP, Windows 7, Windows 8, Windows 10 and Windows Servers.
Syntax of chkdsk is very simple. There is two types of parameters like OPTIONS and VOLUME.
chkdsk OPTIONS VOLUME
OPTIONSis used to specify the behavior of the chkdsk command.
VOLUMEis the drive, partition, or volume we want to operate with the chkdsk command.
Print chkdsk Help Information
We can use the
/? option in order to print detailed help information about the options and usage.
> chkdsk /?
In general following options are provided by the chkdsk command.
|Specifies the drive letter (followed by a colon), mount point, or volume name.|
|[ ||Use with file allocation table (FAT) and FAT32 only. Specifies the location and name of a file or set of files that you want chkdsk to check for fragmentation. You can use the ? and * wildcard characters to specify multiple files.|
|/f||Fixes errors on the disk. The disk must be locked. If chkdsk cannot lock the drive, a message appears that asks you if you want to check the drive the next time you restart the computer.|
|/v||Displays the name of each file in every directory as the disk is checked.|
|/r||Locates bad sectors and recovers readable information. The disk must be locked. /r includes the functionality of /f, with the additional analysis of physical disk errors.|
|/x||Forces the volume to dismount first, if necessary. All open handles to the drive are invalidated. /x also includes the functionality of /f.|
|/i||Use with NTFS only. Performs a less vigorous check of index entries, which reduces the amount of time required to run chkdsk.|
|/c||Use with NTFS only. Does not check cycles within the folder structure, which reduces the amount of time required to run chkdsk.|
|/l[:||Use with NTFS only. Changes the log file size to the size you type. If you omit the size parameter, /l displays the current size.|
|/b||Use with NTFS only. Clears the list of bad clusters on the volume and rescans all allocated and free clusters for errors. /b includes the functionality of /r. Use this parameter after imaging a volume to a new hard disk drive.|
|/scan||Use with NTFS only. Runs an online scan on the volume.|
|/forceofflinefix||Use with NTFS only (must be used with /scan). Bypass all online repair; all defects found are queued for offline repair (for example, |
|/perf||Use with NTFS only (must be used with /scan). Uses more system resources to complete a scan as fast as possible. This may have a negative performance impact on other tasks running on the system.|
|/spotfix||Use with NTFS only. Runs spot fixing on the volume.|
|/sdcleanup||Use with NTFS only. Garbage collect unneeded security descriptor data (implies /f).|
|/offlinescanandfix||Runs an offline scan and fix on the volume.|
|/freeorphanedchains||Use with FAT/FAT32/exFAT only. Frees any orphaned cluster chains instead of recovering their contents.|
|/markclean||Use with FAT/FAT32/exFAT only. Marks the volume clean if no corruption was detected, even if /f was not specified.|
|/?||Displays help at the command prompt.|
Schedule Check Disk At System Start
One of the most popular use cases for
chkdsk is scheduling a check at the system startup or restart. Because we can not check system volume which is generally
C: at run time. Before mounting the volume the check operation is done.
> chkdsk /F C:
Fix Errors On Disk
File systems used to store files and folders, user data in an appropriate way. file systems have very complex structures related to their features. Shutdown down a system in an unexpected way Halting system, disk-related issues may create errors in file systems. We can simply use
/F option with the volume name which is
D: in this example.
> chkdsk /F D:
Locate Bad Sector
Disk drives store data in sectors. Each sector holds some data according to its size configuration. Disk drives can lose some of their sectors in time. This is physical damage so it can not be fixed in a physical way. We can locate and label these sectors as bad sectors and prevent them to be used by the file system. We can do this with
/R option. In this example, we check bad sectors of volume
> chkdsk /R D:
Force Unmount Of Volume, Partition or Disk
While doing disk related operations we need to unmount the volume in order to prevent unexpected errors. Checking mounted volumes and file systems will create conflicts. We can unmount the filesystem and volume before the operation with
> chkdsk /X D:
Fast Check Of Volume, Partition or Disk
Checking the file system and disk errors may take some time. By default, chkdsk uses very detailed check procedures. But some of them are not necessary in most cases. We can prevent to use detailed checks to make check faster. We will use
/I /C for checking in a fast way.
> chkdsk /I /C D:
Check Disk In Verbose Manner
Verbose mode provides more detailed information about the current operation. We can get details with
> chkdsk /V D:
There is a GUI for the chkdsk command. Even we can access this GUI the most practical way is right clicking on the disk or partition we want to check like below. Then we will click to the
Properties screen provides the
Tools tab where we can access from the
Error checking part by clicking to the
Check button like below.
We will see the followin screen where we will click to the
Scan drive button. Alternatively we can cancel by clicking to the
During the disk or partition error check we will see the following screen. This screen will provide information about the current status and remaining time.
When the scan or check is completed we will see the following screen which will provide short information about the like error count etc.