Tip: Run Check Disk from a Command Line to Check for and fix Disk Errors

You should periodically use the Check Disk tool to check the integrity of disks. Check Disk examines disks and can correct many types of common errors on FAT16, FAT32, and NTFS drives. One of the ways Check Disk locates errors is by comparing the vol¬ume bitmap with the disk sectors assigned to files in the file system. Check Disk can’t repair corrupted data within files that appear to be structurally intact, however. You can run Check Disk from the command line or through a graphical interface.

Follow Our Daily Tips

RSS | Twitter | Blog | Facebook

Tell Us Your Tips

Share your tips and tweaks.

Running Check Disk from the Command Line
You can run Check Disk from an elevated command prompt or within other tools. At the elevated command prompt, you can test the integrity of drive C by typing the following command:
chkdsk C:

Check Disk then performs an analysis of the disk and returns a status message regarding any problems it encounters.Unless you specify further options, Check Disk won’t repair problems, however.To find and repair errors on drive C, use this command:
chkdsk /f C:

When you use this command, Check Disk performs an analysis of the disk and then repairs any errors it finds, provided that the disk isn’t in use. If the disk is in use, Check Disk displays a prompt that asks whether you want to schedule the disk to be checked the next time you restart the system. Click Yes to schedule this check.

The complete syntax for Check Disk is as follows:
CHKDSK [volume[[path]filename]] [/F] [/V] [/R] [/X] [/I] [/C] [/L[:size]]

The options and switches for Check Disk are used as follows:
volume Sets the volume to work with
path/filename Specifies files to check for fragmentation (FAT16 and FAT32 only)
/F Fixes errors on the disk
/V Displays the full path and name of every file on the disk (FAT16 and FAT32); displays cleanup messages if any (NTFS)
/R Locates bad sectors and recovers readable information (implies /F)
/X Forces the volume to dismount first if necessary (implies /F)
/I Performs a minimum check of index entries (NTFS only)
/C Skips checking of cycles within the folder structure (NTFS only)
/L:size Sets the log file size (NTFS only)
/B Re-evaluates bad clusters on the volume (NTFS only; implies /R)

From the Microsoft Press book Windows 7 Administrator’s Pocket Consultant by William R. Staneck.

Looking for More Tips?

For more tips on Windows 7 and other Microsoft technologies, visit the TechNet Magazine Tips library.