There are several ways that you can run Chkdsk on a volume. You must be logged on with an account that is a member of the local Administrators group.
In Windows NT 4.0, Chkdsk does a folder-by-folder check of indexes. If Chkdsk encounters a folder with a large number of files, the Chkdsk progress indicator may change very slowly. Also, if Chkdsk encounters bad sectors, the progress indicator changes very slowly because I/O operations that touch bad sectors are typically retried multiple times with a delay between each retry. When the progress indicator moves that slowly, a common mistake that users make is to assume that the computer has stopped responding (is “hung”) and then to restart the server. The status reporting in Windows 2000 has been improved so that it correctly reports the progress. To validate whether Chkdsk is still to performing actions, you can check disk activity. Some of the tasks that Chkdsk performs can be CPU intensive, so even moderate-to-light disk activity is a sign that Chkdsk is still making progress.
Run Chkdsk in Read-Only Mode
Running Chkdsk in read-only mode does not correct any corruption. After Chkdsk runs against the volume and the results are displayed, you can then you can determine whether the volume is potentially corrupted and take action. To run Chkdsk in read-only mode, follow these steps:
Click Start, click Run, type cmd.exe in the Open box, and then click OK.
At the command prompt, type chkdsk VolumeLetter:(for example, chkdsk c:), and then press ENTER.
If the volume is potentially corrupted, run Chkdsk in repair mode, or schedule Chkdsk to be run during a convenient time.
When you review the results of Chkdsk in read-only mode, keep in mind that all files reported to be corrupted may not actually be corrupted. Because the volume is online and Chkdsk cannot lock the volume for exclusive use, any file Chkdsk finds that is currently in use, with an open handle, will be incorrectly reported by Chkdsk to be corrupted.
If Chkdsk in read-only mode reports corruption, one method to determine whether there really is corruption is to run Chkdsk against the volume three or four times and then compare the results to see whether the same files are being reported as corrupted. In-use files should have their handles released after a period of time, and in-use files should not appear in the list of corrupted files in all instances.
For more information about running Chkdsk in read-only mode, see “About Running Chkdsk in Read-only Mode” on page 27 of this white paper.
To set Chkdsk so that it will repair corruption, use the chkdsk command at the command prompt, and include one of the command-line switches that is listed in the “Chkdsk Syntax and Optional Command-Line Switches” section on page 7 of this white paper.
Another way to run Chkdsk in repair mode is to use the graphical user interface (GUI). To do so, follow these steps:
Open My Computer.
Right-click the drive on which you want to run Chkdsk, click Properties, and then click the Tools tab.
Under Error-checking, click Check Now.
Click to select the check boxes for the options that you want to run.
If you want to run the chkdsk /f command, click to select the Automatically fix the file system errors check box.
If you want to run the chkdsk /r command, click to select the Scan for and attempt to recovery of bad sectors check box.
Note If you run Chkdsk from the command-line, using the /r command-line switch implies the /f option. However, in the GUI, selecting Scan for and attempt recovery of bad sectors does not imply that Automatically fix file system errors be used. Therefore, to get the same results as running the chkdsk /f /r command from the command line, select both options.
Although running Chkdsk from the command line and the GUI produces the same scan and repair results, running Chkdsk from the command line provides more verbose output.
Chkdsk Syntax and Optional Command-Line Switches
The syntax for running Chkdsk from the command line is the following:
Table 1 describes the Chkdsk command-line switches.
Chkdsk creates and displays a status report for a disk and lists the errors as it corrects them. If Chkdsk cannot lock the drive, it will offer to check it the next time the computer restarts.
Table 1: Chkdsk Command-Line Switches (Options)
Used without command-line switches, Chkdsk runs in read-only mode and displays the status of any corruption found.
Note Files that are currently in use may be misinterpreted by Chkdsk to be corrupted, when they are not.
Specifies the drive that contains the disk that you want Chkdsk to check. If no drive letter is specified, the currently selected drive is used.
Specifies the location and name of a file or set of files that you want Chkdsk to check for fragmentation. You can use wildcard characters (* and ?) to specify multiple files. If no path is specified, the whole volume is validated; this is the recommended practice.
Locks the volume and fixes errors on the volume. If Chkdsk cannot lock the volume, it displays the following message before it prompts you to schedule Chkdsk the next time the system is restarted:
Chkdsk cannot run because the volume is in use by another process. Chkdsk may run if this volume is dismounted first. ALL OPENED HANDLES TO THIS VOLUME WOULD THEN BE INVALID. Would you like to force a dismount on this volume?
If you schedule Chkdsk to run the next time the system is started, Chkdsk does not set the “dirty bit” on an in-use volume to check the volume at the next startup process. (A “dirty bit” is a bit on the physical disk that is used by the operating system to mark a volume as corrupted and in need of corrective actions.) Instead, it sets a registry entry to tell Autochk to run against that volume. The dirty bit is set by the file system itself only when it detects a problem. (Versions of the chkdsk /f command in Windows NT 4.0 and earlier set the actual dirty bit.)
For NTFS volumes, displays cleanup messages, if any. (For FAT/FAT32, /v displays the name of each file in each folder as the disk is checked.)
Locates bad sectors and recovers readable information. The disk must be locked.
NTFS only. Changes the log file size to the size that you enter. Displays the current size if you do not specify one.
Runs chkdsk /f and forces a volume dismount to close the open file handles on non-system volumes so that the volume can be checked immediately. With this command-line switch, you do not have to restart the computer to run Chkdsk and repair the volume.
NTFS only. Performs a less-vigorous check of index entries, reducing the time that is needed to run Chkdsk.
NTFS only. Skips the checking of cycles in the folder structure, reducing the time that is needed to run Chkdsk.
Table 2: Chkdsk Examples
chkdsk d: /f
Runs Chkdsk on drive D and corrects the corruption.
chkdsk d: /f /r
Runs Chkdsk on drive D, corrects the corruption, and looks for bad sectors.