We have a watchdog timer on our system which will cause a reset if the
driver doesn’t clear it within 15 minutes. The intent is to reset if the
system is stuck for whatever reason.
Unfortunately, when NTFS wants to run an AUTOCHK at startup, it usually
takes more than 15 minutes. The driver which clears the watchdog has not
yet started. Thus, the system gets reset, starts the AUTOCHK again, then
gets reset, and so on. This results in a system which never boots.
The first idea, and probably the cleanest, would be to have the driver that
resets the watchdog start much earlier in the boot process. Are there any
gotchas there? Such as, perhaps the file system / Registry / etc. aren’t
available to Boot drivers?
Another is to check the NTFS “dirty bit” during shutdown of the driver and
to extend the watchdog timer to 30 minutes or whatever in such a case.
Unforunately, I can’t find any information on where the dirty bit is located
for NTFS. (I found it for FAT.) I’m kinda thinking that perhaps the dirty
bit doesn’t exlicitly exist, but actually is considered set whenever there
are pending transactions (in the logfile?). (Speaking of which, is there
any utility or whatever to read the logfile?) Any ideas on how this could
be done?
Another idea is similar to the above, but to spawn off the command line
“chkntfs”, which outputs whether the volume is dirty or not. Unfortunately,
since this is during shutdown, I don’t think we’ll be able to run that.
Also, I’m not even sure that the dirty bit will always be set at that time
or not, particularly if it’s not actally a bit, but an uncompleted
transaction. I know it will be sometimes, such as if someone tries to
manually run “chkdsk /f”.
Any other ideas are also welcome.
Thanks for any advice!