Chkdsk won’t run upon reboot

I ran into problem when Windows server doesn’t run chkdsk on logical volume even though it’s corrupted. Some research on this issue revealed that there is a registry key HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Control\ Session Manager\ BootExecute which has default value:

autocheck autochk *

Each time Windows restarts it runs Autochk tool which checks if some of volumes are dirty (means potentially corrupted). It’s implemented through dirty bit. You can check if dirty bit is set or set it by yourself with by:

fsutil dirty query d:

fsutil dirty set d:

Default value of BootExecute parameter means that all volumes have to be checked for dirty bit upon reboot. When Autochk find dirty volume it runs Chkdsk on it. But it turns out it doesn’t work in our OS instance due to bug or some misconfiguration.

There is a tool called chkntfs which can schedule check. But it’s useful since it won’t make any effect if dirty bit isn’t set. You can set it by yourself using Fsutil but once again dirty bit isn’t working for us for some reason. And moreover setting dirty bit by Fsutil is enough to force volume check even without Chkntfs. In fact Chkntfs is designed for another goal. It allows to exclude some volumes from checking by Chkdsk at all.

Solution for us is either run

chkdsk /f /r d:

from command line. But it could in some cases start online check which we would like to prevent. Or adjust registry. So solution is to change BootExecute to:

autocheck autochk /P /r \??\D:

/P in this case tells Autochk not to look at dirty bit and force check of logical volume.


Tags: , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: