CHKNTFS.EXE: What You Can Use It For

ID: Q160963


The information in this article applies to:


SUMMARY

Chkntfs.exe is a utility developed by Microsoft and is available on Service Pack 2 and later for Windows NT 4.0. It is designed to disable the automatic running of chkdsk on specific volumes, when Windows NT reboots 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 reboot.


MORE INFORMATION

Every time Windows NT boots, 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 allows 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 will display the status of the dirty bit for each drive.

Examples:

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

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

The chkntfs /x commands are not cumulative, the command will overwrite any previous drive exclusions that have been established. In the above example, chkntfs will only disable the chkdsk checking on drives D and E, drive C will not be 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\SessionManager

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 will 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: Using Registry Editor incorrectly can cause serious, system-wide problems that may require you to reinstall Windows NT to correct them. Microsoft cannot guarantee that any problems resulting from the use of Registry Editor can be solved. Use this tool at your own risk.

Chkdsk /f /r allows 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

will add the following entry to the BootExecute value:

   autocheck autochk /r \??\C: 

Because this entry is actually placed in the registry, the chkdsk /f /r will be 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.

Additional query words: chkdsk chkntfs


Keywords          : kbbug4.00 ntdistrib nthowto ntfilesys ntutil 
Version           : 4.0
Platform          : winnt 
Issue type        : kbhowto 

Last Reviewed: February 3, 1999