You Choose What to Pay

How much do you think the help you received is worth? Click below to pay what ever you think is fair. 

 

Contact Tim

Use the module below to place a free call to Tim directly:

(Standard carrier rates apply)
Q/A Archive
« Site news: Instant chat. | Main | Sound, Power, and/or Network icon disappeared from my system tray. »
Thursday
Nov192009

Chkdsk keeps running every time I restart my computer

From a forum user;


Problem:

 

On XP pro 32 bit, I un-installed some programs, and now chkdsk runs every time I restart the computer.

Explanation:

Click below to see a long explanation

When you do a chkdsk and ask it to “/f” or “/r”, it should state that it needs to un-mount the drive to do a chkdsk unless it's in read-only mode (That means no /fixing or /repairing) - It asks you if you want to do it after reboot. If you say yes, it switches around the bootexecute value in your registry, under “HKLM\system\currentcontrolset\control\session manager”. (We’ll be getting back to the bootexecute value at the bottom of the article.)

 

This change (on the next reboot), calls a program just like chkdsk but that operates earlier in the boot-up and doesn't require windows be loaded. This module is called autochk.exe, and it is what's responsible for un-mounting and scanning the drive before you boot up. This also happens when a drive is found to be “dirty” by the system.

When you say "yes, do this on my next reboot" by typing “Y” and pressing enter when chkdsk asks you, you're basically 'marking' the drive as 'dirty' manually. This is what calls autochk.

(NOTE: Autochk, unlike chkdsk, can't write to the system logs directly because windows hasn't booted up yet, so it will instead wait until it's finished and write a log file to the root of the C: drive, which is then written into the application event logs by winlogon.exe - so if you want to see the resultant logs of an autochk scan, look in the error logs for any entries made by winlogon.exe)

The command (the context of which I'll research whilst I type this sentence... done!) to UN-mark the drive as "dirty" is "chkntfs":
So here's what you do...



Solution:

 

First, you need to open a command prompt with Administrative privileges.
-In xp, simply click the start menu, then RUN, then type "cmd" and hit enter.
-In Vista and 7, click the start menu, then type “cmd”. Right-click the icon at the top of the search field, and click “Run as Administrator”, then accept the user account control prompt.
Once you’ve got command prompt open, just type one of these commands (in bold, below) depending on what you’d like to do. (Click "Read more" for more information.)

Chkntfs C:
This will tell you if the drive is dirty or not. If it's telling you it IS dirty, you should probably backup your data before doing anything else, since this means the system (erroneously, or not) has identified a “dirty bit”. (It's also possible the drive is being seen as dirty when it's not due to a bad SATA/IDE cable. That's a hardware issue, and I won't address that here since it's also fairly rare.)

Chkntfs /d
This will set the drives to their default status. At boot-up they'll be checked for dirty-ness, and will be scanned accordingly IF found to be dirty.
If it still tries to scan on the next reboot after using this command, you can manually mark a drive as clean with the following:

Chkntfs /x c:
This should return the message: "The type of file system is NTFS" if successful.
This excludes the drive from chkdsk.
Be careful when using this command as it won't call a chkdsk/autochk even if it needs one!


The exception:

There’s one more thing you should know – If this chkdsk scan was initiated by the user with the command: “chkdsk c: /f /r”, in SOME cases the only way to stop this (assuming actually running the chkdsk at your next reboot doesn’t stop it, or isn't an option...) is to remove the addition created in the bootexecute value.
That value should look something like this:
autocheck autochk /r \??\C:
and it should exist in your registry, in the location above (HKLM\system\currentcontrolset\control\session manager).
To fix this, start by opening regedit.
-In XP, click the start menu, then run, and type in “regedit”, then hit enter.
-In Vista and 7, just click the start menu, type regedit, and hit enter.

!!IMPORTANT!! Back up your registry at this point, before making any changes. To do that, click FILE, then EXPORT. In the next window, at the bottom left, make sure “ALL” is selected, and save the file to your C: drive as “reg_backup” or something along those lines.

Once you have regedit open, navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager, and then double-click on “BootExecute”.
If you see the entry: “autocheck autochk /r \??\C:” in BootExecute, delete that entire line, but leave anything else in there, that’s in there.

That should do it!

 

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>