Create and display status reports for disks based on the file system used. Chkdsk Errors on the disk are also listed and corrected. If you do not take any parameters, CHKDSK The status of the disks in the current drive is displayed.
chkdsk [volume:][[Path] FileName] [/f] [/v] [/r] [/x] [/i] [/c] [/l[:size]]
Specify a drive letter (colon delimited), mount point, or volume name.
Specify needs chkdsk Check the location and name of the defragmented file or file set. Use wildcards (* and ?） You can specify multiple files.
Fix errors on disk. The disk must be locked. If chkdsk If the drive cannot be locked, a message appears asking if you want to check the drive the next time you restart the computer.
When checking the disk, displays the name of each file in all directories.
Find the bad sector and recover the readable information. The disk must be locked.
Only in NTFS Used on. If necessary, force unmount the volume first. All open handles for this drive are invalid/ x / F is also included The function of.
Only with NTFS use. Perform sufficient checks on index entries to reduce running time chkdsk The amount of time it takes.
Only with NTFS use. Skip the periodic check in the folder structure and reduce the running time chkdsk Amount of time required.
Only with NTFS use. Change the size of the log file to the size entered by the user. If this parameter is omitted, the / l The current log file size is displayed.
Displays help at the command prompt.
To run on a fixed disk chkdsk Command, you must be the Administrators Members of the group.
Check locked drives on reboot
If you want chkdsk If you fix a disk error, you cannot open files on this drive before. If a file is open, the following error message is displayed:
Chkdsk cannot run because the volume is in use by another processWould you like to schedule this volume to be checked the next time the system restarts?(Y/N)
If you choose to check the drive the next time you restart the computer, after you restart the computer chkdsk Automatically checks the drive and fixes errors. If the drive partition is a boot partition, then chkdsk After checking the drive, the computer will restart automatically.
Report disk errors
chkdsk The command checks the disk space and file allocation table ( Fat) and NTFS File system usage. Chkdsk Provide information specific to each file system in the status report. The status report displays errors found in the file system. Run on active partition chkdsk If not included / f Command line option, it may report false information because the drive cannot be locked. It should be used irregularly chkdsk Check for errors on each disk.
Fix disk errors
Only specified / f Command line options, CHKDSK Command to fix disk errors. Chkdsk You must be able to lock the drive to correct the error. Because repair usually changes the file allocation table of the disk and sometimes loses data, so chkdsk A confirmation message is first sent as follows:
10 lost allocation units found in 3 chains.
Convert lost chains to files?
If press Y，Windows All missing chains are saved in the root directory in a file named Filennnn.chk In the file. chkdsk When finished, you can check whether these files contain the required data. If press N，Windows The disk is repaired, but it does not save its contents for missing allocation units.
If not used / f Command line option, CHKDSK is disabled when a file needs to be repaired A message is sent, but it does not fix any errors.
If on a large disk (for example, 70 Millions of GB or millions of GB of files on disk chkdsk / f. This may take a long time (for example, several days) to complete. because chkdsk It will not hand over control until the work is completed, so the computer will not be available during this time.
inspect FAT disk
Windows Display in the following format FAT Disk chkdsk Status report:
Volume Serial Number is B1AF-AFBF
72214528 bytes total disk space
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 in each allocation unit
35261 total allocation units on disk
29568 available allocation units on disk
inspect NTFS disk
Windows Display in the following format NTFS Disk chkdsk Status report:
The type of the file system is NTFS.
CHKDSK is verifying files…
File verification completed.
CHKDSK is verifying indexes…
Index verification completed.
CHKDSK is verifying security descriptors…
Security descriptor verification completed.
12372 kilobytes total disk space.
3 kilobytes in 1 user files.
2 kilobytes in 1 indexes.
4217 kilobytes in use by the system.
8150 kilobytes available on disk.
512 bytes in each allocation unit.
24745 total allocation units on disk.
16301 allocation units available on disk.
Use when there are open files chkdsk
If there are open files on the drive, specify / f After the command line option, CHKDSK An error message is sent. If not specified / f Command line options and there are open files, then chkdsk Missing allocation units on disk are reported. This can happen if an open file is not recorded in the file allocation table. If chkdsk A large number of lost disks can be reported.
Find physical disk error
use / r The command line option looks for physical disk errors in the file system. About use recover For information on repairing physically corrupted files, see.
Report bad sectors of disk
When the disk is ready to run for the first time, CHKDSK Bad sectors reported are marked as damaged. They are not dangerous.
Understand exit code
The following table lists chkdsk Exit code reported after completing the task.
Exit code explain
0 No errors were found.
one The error was found and fixed.
two Disk cleanup (such as fragment collection) was performed, or because no disk was specified / f Disk cleanup was not performed.
three Because not specified / f Option, unable to check the disk, the error cannot be repaired or the error is not repaired.
The recovery console provides with different parameters chkdsk Command.
If you want to check the drive D And want to Windows To fix the error, type:
If an error is encountered, CHKDSK Pauses and displays a message. Chkdsk A report listing the disk status is displayed when the task is completed. Unless chkdsk You cannot open any files on the specified drive unless you have completed the task.
stay FAT On disk, to check for non contiguous blocks of all files in the current directory, type:
Chkdsk Displays a status report and lists files that meet the criteria for having non adjacent blocks.