Checking NTFS dirty bit during shutdown?

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!

the idea of loading your driver as a boot driver sounds like the best
one. if you load as a boot driver you will not be able to access
storage devices directly (the volume managers and the file systems
aren’t online yet) nor is anything outside the system key of the
registry available.

-p

-----Original Message-----
From: Taed Wynnell [mailto:xxxxx@vertical.com]
Sent: Friday, July 19, 2002 5:40 AM
To: NT Developers Interest List
Subject: [ntdev] Checking NTFS dirty bit during shutdown?

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!


You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to %%email.unsub%%

Fsutil has a command that will allow you to query or set the volume dirty
flag.
This command is built in to XP. If you really want to know how to query the
dirty bit, that tool might be able to show you.

-elliot

-----Original Message-----
From: Taed Wynnell [mailto:xxxxx@vertical.com]
Sent: Friday, July 19, 2002 8:40 AM
To: NT Developers Interest List
Subject: [ntdev] Checking NTFS dirty bit during shutdown?

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!


You are currently subscribed to ntdev as: xxxxx@veritas.com
To unsubscribe send a blank email to %%email.unsub%%

Flush the volume when the timer expires. This will clear the dirty bit.

Jamey

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Taed Wynnell
Sent: Friday, July 19, 2002 5:40 AM
To: NT Developers Interest List
Subject: [ntdev] Checking NTFS dirty bit during shutdown?

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!


You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to %%email.unsub%%

The watchdog timer should not be activated until the driver starts. If the
system won’t get to the point where the system can boot correctly, the
endless cycle is really useless. Manual intervention is required. If the
device has an external communications capability it could be designed to
call for help if the activation doesn’t occur in an hour or so.

----- Original Message -----
From: “Taed Wynnell”
To: “NT Developers Interest List”
Sent: Friday, July 19, 2002 8:39 AM
Subject: [ntdev] Checking NTFS dirty bit during shutdown?

> 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!
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@yoshimuni.com
> To unsubscribe send a blank email to %%email.unsub%%