CHKDSK has been around since before the days of Windows. This utility has in some ways changed dramatically for new environments and new disk formats. Yet in other ways, it’s pretty much the same old disk checking utility that we’ve been using since the days of DOS.
Regardless of its age or origins, CHKDSK is an important tool for disk maintenance and recovery (in some cases) from a variety of disk-related issues.
Let’s run CHKDSK.
CHKDSK on a non-system drive
The simplest usage of CHKDSK is on a drive that is not your system (Windows) drive.
In Windows Explorer, right-click on the drive you want to check.
Click Properties. In the resulting dialog box, click the Tools tab.
Click the Check now… button.
There are two options presented before CHKDSK begins its work:
- Automatically fix file system errors. If not checked, CHKDSK will simply report, but not fix, any problems that it finds.
- Scan for and attempt recovery of bad sectors. This is a more time-consuming scan of the disk that I’ll discuss below.
In general, the default setting is fine when you suspect there is a problem that needs to be fixed.
Click Start, and you may get this message:
CHKDSK can only check or repair a disk when it is the only program using that disk; even the rest of Windows cannot be accessing the disk while CHKDSK does its job. Forcing a dismount makes that happen. If a program is actually accessing the drive or files on the drive about to be dismounted, the old “results are unpredictable” phrase applies. Programs may simply notice and do the right thing; they may crash or something inbetween.
That’s why the common advice is to close most programs when running CHKDSK, or at least make sure none can access the drive you’re about to check.
Click Force a dismount and CHKDSK begins its work.
Eventually, this is the message you hope to see:
“See details” displays a log of CHKDSK’s activity. Any errors to be repaired would be listed here.
CHKDSK on a system drive
Remember how I said CHKDSK requires exclusive access to the drive in order to be able to repair it? And that even Windows can’t be accessing the disk?
That presents a problem when you want to CHKDSK the system drive – typically your C: drive. If Windows is running, then by definition, it accesses the system drive nearly constantly.
The solution is to run CHKDSK before Windows runs.
If you attempt to CHKDSK your system drive, instead of getting the option to dismount it (not something that can be done while Windows is running), you’ll get a message offering to run the CHKDSK before Windows is loaded the next time you reboot.
Click Schedule disk check. Now, reboot your machine. As the machine reboots, you’ll see something like this before Windows loads:
Once completed, Windows will load normally.
Getting the results of a scheduled CHKDSK
A very common question is where to get the results of a CHKDSK that ran before Windows started. There’s no pause, and the information shown above disappears as soon as Windows starts to boot.
Run the Event Viewer by clicking Start, and then Run, (or type Windows Key + R). Enter in eventvwr and click OK.
In Event Viewer, click the Application log under “Windows Logs”. Look for the line item that ends with Wininit (for Windows Initialization) and has “Checking file system on C:” in the lower General tab.
To make reading the results easier, just double-click on that Wininit line.
The scrolling box near the top contains the results of CHKDSK that scrolled past on the screen before Windows loaded.
CHKDSK via command line
CHKDSK is a command-line tool. All of the options above simply run that same tool in some way that captures its output.
You can do that directly yourself.
Click on Start, All Programs, Accessories, and then right-click Command Prompt.
Click Run as administrator, because CHKDSK does require administrative access to do its job.
In the Command Prompt, type:
…to run CHKDSK with the “/F” or “fix” parameter. Without /F, CHKDSK will simply report, but not repair, any errors.
As you can see, the example above checks the D: drive, and just as in the windowed interface, CHKDSK must dismount the drive before it can be checked.
If you run CHKDSK against the C: drive,
…it similarly requests that the CHKDSK be scheduled at the next reboot.
Scanning for bad sectors
Normally, CHKDSK simply checks that the information stored on the disk is correct. There’s a fair amount of overhead information that tells Windows where files are located and how they’re actually stored and distributed around the disk media. CHKDSK uses its knowledge of what this information is supposed to look like to ensure it’s correct and try to fix it when it’s not.
Scanning for bad sectors is another thing entirely. When this option is selected, CHKDSK actually reads the entire disk, not just the overhead information. As a result, a bad sector scan takes significantly longer than a simple CHKDSK.
As CHKDSK reads, it notices if those reads actually succeed. When they do not, it marks the area that failed as “bad” so that the system won’t attempt to write more information into those areas with problems.
It’s important to note that this scan doesn’t test whether the data found is good or valid – only that it can in fact be read.
As we saw earlier, scanning for errors is a simple checkbox when you run CHKDSK from Windows Explorer. For those that prefer the command line, it’s the “/R” – repair – option.
When to CHKDSK
Normally, CHKDSK only need be run when a problem is suspected.
In particular, a scan for bad sectors only needs to be done once you’ve actually encountered a bad sector – usually in the form of a bad read, write, or explicit CRC error. CHKDSK will do what it can, but most importantly, it will remove the bad area from use.
Running CHKDSK to simply check the validity of the file system is a quicker operation, and it’s not unreasonable to run it every so often, particularly if your machine has been crashing. In most cases, Windows will actually force a CHKDSK after a system crash or improper shutdown. This is done not to fix the cause of the crash (although in some cases it could), but rather to fix any disk-related issues that may have resulted from the crash.
What CHKDSK won’t do
While we talk about CHKDSK “repairing” a hard disk, it is not a data recovery tool per se. Its job is not to recover lost or damaged files, but to ensure that the information currently on the disk is in a consistent and safe state.
When it comes time to search for files accidentally lost or deleted, then you need to use tools like Recuva and similar.
If you’re trying to recover data from a hard drive that has a persistent media problem, or is so damaged that a CHKDSK scan for bad sectors can’t help, then a tool like SpinRite might be your only option.
Unless, of course, you have a backup and can simply replace your failing hard drive.