Checks the status of a disk and displays a status report. Can also fix disk errors.
The status report shows errors found in the operating system filing system, which consists of the file allocation table and directories. CHKDSK also displays a summary of disk usage. (CHKDSK does not verify that the information in your files can be accurately read.) If errors exist on the disk, CHKDSK alerts you with a message.
Note: The SCANDISK program is the preferred method of fixing drive problems, and should be used instead of the CHKDSK /F command. For more information, see the SCANDISK command.
CHKDSK [drive:][[path]filename] [/F] [/V] [/R] [/X] [/I] [/C] [/L[:size]]
Display the current drive disk status:
- GUI based Disk Repair.
CHKNTFS - schedule CHKDSK to run at boot time.
Equivalent Linux BASH commands:
cksum - Print CRC checksum and byte counts (can detect problems but not fix them)
The operating system displays CHKDSK status reports similar to:
Volume DISK1PART01 created 12-06-1998 7:35p Volume Serial Number is 4F8D-2A5B 201,031,680 bytes total disk space 8,769,536 bytes in 49 hidden files 851,968 bytes in 194 directories 176,619,520 bytes in 2,546 user files 14,790,656 bytes available on disk 4,096 bytes in each allocation unit 49,080 total allocation units on disk 3,611 available allocation units on disk 647,168 total bytes memory 588,304 bytes free
The SCANDISK program is the preferred method of fixing disk errors. For more information, see the SCANDISK command.
If you want to use CHKDSK to fix disk errors, use the /F switch. (CHKDSK corrects disk errors only if you specify the /F switch.) CHKDSK /F displays a prompt similar to:
10 lost allocation units found in 3 chains. Convert lost chains to files?
If you press Y, the operating system saves each lost chain in the root directory as a file with a name in the format FILEnnnn.CHK. When CHKDSK finishes, you can examine these files to see if they contain any data you need. If you press N, the operating system fixes the disk but does not save the contents of the lost allocation units.
If you do not use the /F switch, CHKDSK alerts you with a message if a file needs to be fixed but does not fix the error(s).
Never use CHKDSK when files are currently open. CHKDSK is designed for use when the files on the disk are in an unchanging state -- that is, when they are not open. When a file is open, it is probably changing, and the operating system will update the file allocation table and the directory structure to reflect changes. Such updates are not always made immediately, and updates to the file allocation table and the directories occur at different times. If you run CHKDSK when files are open on the disk, it interprets differences between the directory structure and the file allocation tables as errors.
Running CHKDSK /F when files are open can result in corruption or loss of data. Therefore, never run CHKDSK /F from another program, or when Microsoft Windows or the operating system Task Swapper is running.
The CHKDSK command does not work on drives formed by the SUBST command. You cannot use CHKDSK to check a disk on a network drive.
The CHKDSK command finds only logical errors in the file system, not physical disk errors. To identify and repair physical disk errors, use the SCANDISK program. For more information, see the SCANDISK command.
Bad sectors reported by CHKDSK were marked as "bad" when your disk was first prepared for operation. SCANDISK and other physical disk-error correction utilities can also mark sectors as "bad." Bad sectors pose no danger.
CHKDSK reports a cross-linked file if two files or directories are recorded as using the same disk space. If CHKDSK finds a cross-linked file, it displays a message similar to:
File is cross linked on allocation unit nnn; Some of the information in these files or directories has been lost.
CHKDSK will not fix a cross-linked file, even if you specify the /F switch. To correct a cross-linked file, run SCANDISK. Or, to fix them manually, copy the specified files or directories elsewhere and delete the originals.
You can save a CHKDSK status report by redirecting the output to a file. Do not use the /F switch when you redirect CHKDSK output to a file.
The command-line tool CHKDSK is not as capable as the GUI tool SCANDISK. Under NT SCANDISK is only available from the GUI in NT Explorer - select a drive, choose Properties then "Check For Errors"
I have more than once seen SCANDISK repair a disk where CHKDSK failed.
A good strategy is to schedule an AT job to detect any disk problems by running CHKDSK - then use SCANDISK to manually fix any problems as they occur.
To find out how much data is stored on drive C and how much space is still free, and to check the disk for errors, type:
CHKDSK pauses and displays messages if it encounters errors.
To redirect the output of CHKDSK to a file named STATUS, type:
CHKDSK A: > status
Because the output is redirected, the operating system does not repair errors it encounters during the check; but it records all the errors in a report file. Afterward, you can use CHKDSK with the /F switch without redirection to correct any errors noted in the status report.