The Dirty Bit - Techist - Tech Forum

Go Back   Techist - Tech Forum > Computer Software > Microsoft Windows and Software
Click Here to Login
Closed Thread
 
Thread Tools Display Modes
 
Old 07-19-2004, 03:43 PM   #1 (permalink)
Newb Techie
 
Join Date: Jul 2004
Posts: 13
Send a message via AIM to WalnutMon
Default The Dirty Bit

I have heard alot about the "dirty bit" and how it applies and works in applications... Word, or Excell for example. But how does the dirty bit on the Hard drive work? and how does Chkdsk know when to run???
__________________

WalnutMon is offline  
Old 07-19-2004, 06:49 PM   #2 (permalink)
Master Techie
 
Join Date: Oct 2003
Posts: 2,258
Default

ok, so i have been around the block a few times, and so asking this I'm bound to feel stupid, but What in the Sam Hell are you talking about? Dirty bit?
__________________

Inaris is offline  
Old 07-20-2004, 01:26 PM   #3 (permalink)
Newb Techie
 
Join Date: Jul 2004
Posts: 13
Send a message via AIM to WalnutMon
Default

the "dirty bit" is a bit, that can be either set (1) or cleared (0). I am at least pretty sure that is how that goes. It is used by the operating system windows to to decide if it is going to run chkdsk. If the "dirty bit" is set then it will run due to an improper shutdown or something like that. However, it is a little more complicated to figure out how exactly this bit gets set and that is what I am hoping to find out... Perhaps that explanation will at least send someone down the right road...
WalnutMon is offline  
Old 07-20-2004, 09:22 PM   #4 (permalink)
Wizard Techie
 
Join Date: Apr 2004
Posts: 3,247
Default

more than likely this "dirty bit", and I've not heard that term either... is a setting within the registry using using algorythms to determine its setting. If you know much in programming then think of it like setting a do while/do while not/ do until/If statements. Say, forexample, its set to monitor the system time. If the system time equals a certain time, then set this bit to 1, else its 0. Then the program that monitors that bit setting says, oh you just changed your state... this is what I'm supposed to do... and then it does its designated runtime.
__________________
If you argue with an idiot he will drag you down to his level and beat you with experience.

I am not a fast writer.
I am not a slow writer.
I am a half-fast writer.

-Robert Asprin
killians45 is offline  
Old 07-21-2004, 09:15 AM   #5 (permalink)
Newb Techie
 
Join Date: Jul 2004
Posts: 13
Send a message via AIM to WalnutMon
Default

"dirty bit" is actually something that is implemented by windows. It is used in two ways, read and write caching and for maintaining the integrity of a hard drive. The latter is the use I am interested in... somehow windows knows when your computer has been shutdown improperly, and sometimes, based on whether your partition, or disk volume is "dirty", runs chkdsk. What I don't understand is how the computer knows when to flip that dirty bit, and if there are more than one used for this purpose. go to your comand prompt (if your running XP) and type in "fsutil dirty query c:" or whatever your drive is and it will return either "C: is NOT dirty" or "C: is dirty". You can also set the dirty bit to one by typing "fsutil dirty set c:". At that point you set the dirty bit and the only way it can go back is by running checkdisk at start up. This will not do any damage to your computer, try it, its a good way to schedule checkdisk... although just schueduling a check disk is just as well... and then we get to use the fun chkdsk operators!
WalnutMon is offline  
Old 07-21-2004, 10:01 AM   #6 (permalink)
Master Techie
 
Join Date: Oct 2003
Posts: 2,258
Default

ok, so I think I understand what you are looking for.
First the Checkdisk stuff is just flagged by two ways.
1. You set it to run, which alters the bootup mode, setting a DOS like command switch.
2. You shut the system down hard or reboot hard and then the system wants to see if everything is ok.
The second one is the one you are refering to as the dirty bit. All that is happening here is when the system shuts down normally, there are entries made in the HKLM registy hive indicating such, as well as the primary system files are released as clean. But when that doesn't happen, they system reacts to it, due to the "Dirty bit" which is just a flag indicating improper closure . IN windows 98 all the way up thought XP it works in basically the same way.
This site dicusses this a bit.
http://www.mvps.org/vb/hardcore/html/thedirtybit.htm
this as well
http://www.mcse.ms/message778952.html
and this too
http://www.microsoft.com/windowsxp/h...util_dirty.asp
Inaris is offline  
Old 07-21-2004, 09:55 PM   #7 (permalink)
Wizard Techie
 
Join Date: Apr 2004
Posts: 3,247
Default

that's is pretty much what I stated above walnutmon... it knows this by setting a bit in the registry by using something similar to algorythms in programming. So If you turn windows off, it WILL have enough time to flip that bit in the registry to a 1, when windows starts it will see that setting of 1, will run the appropriate commands and then run scandisk. at the end of this scandisk it will get a command to reset that bit to a value of 0. All done by algorythms.
__________________
If you argue with an idiot he will drag you down to his level and beat you with experience.

I am not a fast writer.
I am not a slow writer.
I am a half-fast writer.

-Robert Asprin
killians45 is offline  
Old 07-22-2004, 11:13 AM   #8 (permalink)
Newb Techie
 
Join Date: Jul 2004
Posts: 13
Send a message via AIM to WalnutMon
Default

The problem with the explanation I have gotten from most websites on this bit is that they say that certain conditions, such as pending file moves, and other possibly dangerous operations, set the bit to 1, and then after they conclude are set back to 0... that is why when you hard power down your computer sometimes check disk runs, and sometimes it doesn't... it won't run checkdisk if you were not doing something potentially harmful. However, if you set the "dirty bit" using fsutil, it will run check disk, no matter what you do. So there must be secondary "dirty bits" because if there were not then when you set the dirty bit to 1, after the windows shut down it would clear to 0. So under what condition is that bit actually set to 1 by the operating system... sometimes I wish I just said, yeah, hehe
WalnutMon is offline  
Old 07-22-2004, 04:05 PM   #9 (permalink)
Wizard Techie
 
Join Date: Apr 2004
Posts: 3,247
Default

ah, now I got what your asking. well, I'm sure its probably in the registry as a reg value somewhere.
__________________
If you argue with an idiot he will drag you down to his level and beat you with experience.

I am not a fast writer.
I am not a slow writer.
I am a half-fast writer.

-Robert Asprin
killians45 is offline  
Old 07-22-2004, 04:16 PM   #10 (permalink)
Wizard Techie
 
Join Date: Apr 2004
Posts: 3,247
Default

1. Make sure CheckDisk is not enabled in your startup list - if it is,
uncheck it:

Start / Run / Msconfig / Startup


2. Clear your BootExecute entry:

Start / Run / regedt32

HKEY_LOCAL_MACHINE / SYSTEM / CurrentControlSet / Control / Session
Manager
BootExecute

-Delete all autocheck entries, especially: autocheck autochk /f *


HKEY_LOCAL_MACHINE / SOFTWARE / Microsoft / Windows NT /
CurrentVersion / Winlogon

-Highlight the Winlogon file.

-Set "SFCScan" to 0 (zero).

Hopefully one of those will help.
__________________

__________________
If you argue with an idiot he will drag you down to his level and beat you with experience.

I am not a fast writer.
I am not a slow writer.
I am a half-fast writer.

-Robert Asprin
killians45 is offline  
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 10:58 PM.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.