Updated: September 28, 2007
Checks the file system and file system metadata of a volume for logical and physical errors. If used without parameters, chkdsk displays only the status of the volume and does not fix any errors. If used with the /f, /r, /x, or /b parameters, it fixes errors on the volume.
For examples of how to use this command, see Examples.
chkdsk [<Volume>[[<Path>]<FileName>]] [/f] [/v] [/r] [/x] [/i] [/c] [/l[:<Size>]] [/b]
<Volume>
Specifies the drive letter (followed by a colon), mount point, or volume name.
[<Path>]<FileName>
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[:<Size>]
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
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.
/?
Displays help at the command prompt.
Chkdsk cannot run because the volume is in use by another process. Would you like to schedule this volume to be checked the next time the system restarts? (Y/N)
10 lost allocation units found in 3 chains. Convert lost chains to files?
0
No errors were found.
1
Errors were found and fixed.
2
Performed disk cleanup (such as garbage collection) or did not perform cleanup because /f was not specified.
3
Could not check the disk, errors could not be fixed, or errors were not fixed because /f was not specified.
If you want to check the disk in drive D and have Windows fix errors, type:
chkdsk d: /f
If it encounters errors, chkdsk pauses and displays messages. Chkdsk finishes by displaying a report that lists the status of the disk. You cannot open any files on the specified drive until chkdsk finishes.
To check all files on a FAT disk in the current directory for noncontiguous blocks, type:
chkdsk *.*
Chkdsk displays a status report, and then lists the files that match the file specifications that have noncontiguous blocks.
Command-Line Syntax Key