Microsoft KB Archive/160963

From BetaArchive Wiki
Knowledge Base


CHKNTFS.EXE: What You Can Use It For

Article ID: 160963

Article Last Modified on 2/22/2007



APPLIES TO

  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Windows 2000 Datacenter Server
  • Microsoft Windows NT Workstation 4.0 Developer Edition
  • Microsoft Windows NT Server 4.0 Standard Edition
  • Microsoft Windows Server 2003 Service Pack 1
  • Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
  • Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
  • Microsoft Windows Server 2003, Standard Edition (32-bit x86)
  • Microsoft Windows Server 2003, Web Edition



This article was previously published under Q160963

IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry


SUMMARY

The Chkntfs.exe utility has been developed by Microsoft and is available in Microsoft Windows NT 4.0 Service Pack 2 and later versions of Windows. It is designed to disable the automatic running of chkdsk on specific volumes, when Windows restarts from an improper shutdown. Chkntfs can also be used to unschedule a chkdsk if chkdsk /f was used to schedule a chkdsk on an active volume on the next system restart.

MORE INFORMATION

Every time Windows restarts, Autochk.exe is called by the Kernel to scan all volumes to check if the volume dirty bit is set. If the dirty bit is set, autochk performs an immediate chkdsk /f on that volume. CHKDSK /f verifies file system integrity and attempts to fix any problems with the volume. It is always advisable to run chkdsk on volumes that have been improperly shutdown, however, there may be some situations in which running chkdsk after every improper shutdown is not possible or practical. In some cases, chkdsk may take several hours or even days to completely check the volume or may hang while checking the volume. In these situations, it is more practical to postpone the chkdsk until a more convenient time.

Chkntfs is a utility that enables a system administrator to exclude volumes from being checked by the autochk program. The utility is run from a command prompt and has the following command line options:

   chkntfs drive: [...]
   chkntfs /d
   chkntfs /x drive: [...]
   chkntfs /c drive: [...]

     drive:         Specifies a drive letter.
     /D             Restores the machine to the default
                    behavior; all drives are checked at boot
                    time and chkdsk is run on those that are
                    dirty. This undoes the effect of the /X
                    option.
     /X             Excludes a drive from the default boot-time
                    check. Excluded drives are not accumulated
                    between command invocations.
     /C             Schedules chkdsk to be run at the next
                    reboot if the dirty bit has been set.
                

If no switches are specified, chkntfs displays the status of the dirty bit for each drive.

Examples:

chkntfs /x c: This disables chkdsk from running on drive C:

chkntfs /x d: e: This disables chkdsk from running on drives D: and E:.

The chkntfs /x commands are not cumulative, the command overwrites any previous drive exclusions that have been established. In the above example, chkntfs only disables the chkdsk checking on drives D and E, drive C is not checked for the presence of a dirty bit.

The chkntfs utility works by modifying the BootExcecute value in the system registry. The BootExecute value is located in the following registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\CONTROL\Session Manager


The default value is:

BootExecute:REG_MULTI_SZ:autocheck autochk *


Chkntfs /x adds a /k parameter prior to the asterisk. The /k parameter excludes volumes from being checked for the presence of a dirty bit.

For example, the command

chkntfs /x D:

would modify this registry entry to autocheck autochk /k:d *

Chkdsk /f schedules itself to run at the next reboot by setting the dirty bit on the drive. Chkdsk /x disables the checking for this bit. Chkdsk /f can never run on volumes that are excluded from dirty bit checking by chkntfs.

In order to run a chkdsk /f on a drive that has been excluded by the chkntfs utility, you must run the chkntfs /d option to return the system to its normal state or edit the BootExecute value in the registry and remove the applicable drive letter from the /k parameter.

Warning If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.
Chkdsk /f /r enables chkdsk to check volumes for file system errors and bad sectors on the physical disk. Chkdsk /f /r schedules itself to be run on the next system reboot, by adding an entry into the BootExecute value. For example,

chkdsk c: /f /r

adds the following entry to the BootExecute value:

   autocheck autochk /r \??\C:
                

Because this entry is actually placed in the registry, the chkdsk /f /r is unaffected by any chkntfs commands. The only way to disable a chkdsk /f /r is to remove the line from the BootExecute value that references this command.

The Chkntfs.exe utility treats all drives as local to the node. This includes Microsoft Cluster Server (MSCS) physical disk resources on a shared drive array. When using Chkntfs.exe to exclude shared drives on a cluster, you must run the exlusion command on each node. This must be done to ensure each node's registry will have the proper entries. You can only run the command for the shared drive(s) that node owns. If the node does not own the physical disk resource you will receive an error.


Additional query words: chkdsk chkntfs

Keywords: kbhowto KB160963