2.2 Checking for Disk Errors
As part of automated maintenance, Windows 8 performs a proactive
scan of your computer’s NTFS volumes. As with other automated
maintenance, Windows scans disks using Check Disk at 3:00 A.M. if
computer is running on AC power and the operating system is idle.
Otherwise, Windows scans disks the next time the computer is running on
AC power and the operating system is idle. To change this schedule, you
need to modify the run time for automated maintenance. Although automated maintenance triggers the disk scan, the process of calling and managing Check
Disk is handled by a separate task. In Task Scheduler, you’ll find the
ProactiveScan task in the scheduler library under
Microsoft\Windows\Chkdsk, and you can get detailed run details by
reviewing the information provided on the task’s History tab.
You can periodically use the Check Disk tool to check the integrity
of disks as well. Check Disk examines disks and can correct many types
of common errors on FAT16, FAT32, exFAT, and NTFS drives. One of the
ways Check Disk locates errors is by comparing the volume 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 the graphical user
interface (GUI).
With Windows 8, Check Disk performs enhanced scan and repair
automatically, instead of the legacy scan and repair available with
earlier releases of Windows. Here, when you use check disk with NTFS
volumes, check disk performs an online scan and analysis of the disk
for errors. Check Disk writes information about any detected
corruptions in the $corrupt system file. If the volume is in use,
detected corruptions can be repaired by taking the volume offline
temporarily. However, unmounting the volume for the repair invalidates
all open file handles. With the boot/system volume, the repairs are
performed the next time you start the computer.
Storing the corruption information and then repairing while the
volume is dismounted allows Windows to rapidly repair volumes. It also
allows you to keep using the disk while a scan is being performed.
Typically, offline repair will only take a few seconds, compared to
what otherwise would have been hours for very large volumes using the
legacy scan and repair technique.
FAT, FAT32, and exFAT (FAT volumes) do not support the enhanced
features. When you use Check Disk with FAT volumes, Windows 8 uses the
legacy scan and repair process. This means the scan and repair process
typically requires taking the volume offline and preventing it from
being used.
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 /scan 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 repair
errors on drive C, use this command:
chkdsk /spotfix C:
Fixing the volume requires exclusive access to the volume. The way this works depends on the type of volume:
-
For non-system volumes, you’ll see a prompt asking whether you would
like to force a dismount of the volume for the repair. In this case,
you can type Y to proceed or N
to cancel the dismount. If you cancel the dismount, you’ll see the
prompt asking whether you would like to schedule the volume for the
repair the next time the computer is started. In this case, you can
type Y to schedule the repair or N to cancel the repair.
-
For system volumes, you’ll see a prompt asking whether you would
like to schedule the volume for the repair the next time the computer
is started. In this case, you can type Y to schedule the repair or N to cancel the repair.
You can’t run Check
Disk with both the /scan and /spotfix options. The reason for this is
that the scan and repair tasks are now independent of each other.
The complete syntax for Check Disk is as follows:
CHKDSK [volume[[path]filename]] [/F] [/V] [/R] [/X] [/I] [/C] [/B]
[/L[:size]] [/scan] [/forceofflinefix] [/perf] [/spotfix]
[/sdcleanup] [/offlinescanandfix]
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 (FAT volumes only)
-
/B Re-evaluates bad clusters on the volume (NTFS only; implies /R)
-
/C Skips checking of cycles within the folder structure (NTFS only)
-
/F Fixes errors on the disk using the offline (legacy) scan and fix behavior
-
/I Performs a minimum check of index entries (NTFS only)
-
/L:size Sets the log file size (NTFS only)
-
/R Locates bad sectors and recovers readable information (implies /F)
-
/V Displays the full path and name of every file on the disk (FAT volumes); displays cleanup messages if any (NTFS)
-
/X Forces the volume to dismount first if necessary (implies /F)
On NTFS volumes, these options can be used to manage the enhanced Check Disk capabilities of Windows 8:
-
/forceofflinefix Must be used with /scan. Bypasses all online repair and queues errors for offline repair.
-
/scan Performs an online scan of the volume, the default. Errors detected during the scan are added to the $corrupt system file.
-
/perf Performs the scan as fast as possible using more system resources.
-
/spotfix Allows certain types of errors to be repaired online (the default).
-
/sdcleanup Cleans up unneeded security descriptor data. Implies /F (with legacy scan and repair).
-
/offlinescanandfix Performs an offline scan and fix of the volume.
Running Check Disk Interactively
You can also run Check Disk interactively using Computer Management. You can check disk drives on the local computer by following these steps:
-
In Computer Management, select the Storage node and then the Disk
Management node. In Volume List or Graphical View, press and hold or
right-click a drive, and then tap or click Properties.
-
On the Tools tab, tap or click Check. This displays the Error Checking dialog box, shown in Figure 1. For NTFS volumes, you’ll have a Scan Drive option. For FAT volumes, you’ll have a Scan And Repair Drive option.
-
Click Scan Drive or Scan And Repair Drive, as appropriate,
to start the scan. If no errors are found, Windows will confirm this.
If errors are found, you’ll be prompted with additional options. As
with checking disks at a prompt, the way this works depends on whether
you are working with a system or non-system volume and whether the
volume is formatted with NTFS or FAT.