Helping people with computers... one answer at a time.

Windows tracks unfinished business on your hard drive with a "dirty" flag. Turning off your computer improperly can leave the dirty flag set.

During a chkdsk scan, the system was characterized as "dirty". What does that imply?

For the record, it has nothing at all to do with porn. Smile

But it does have everything to do with how Windows manages your hard disk, how it optimizes reading and particularly writing to the disk, and how you turn off your computer.

Yes, the most common reason for a dirty hard drive is turning off your system the wrong way.

To oversimplify, the concept is very simple, Windows sets a "dirty" flag on your hard drive whenever it has unfinished business with the drive.

One example of "unfinished business" is that Windows can optimize disk access by buffering data to be written so that it can be written in a single, larger operation, rather than a number of smaller ones. While the data has been collected, but before it's completely written to disk, the disk is considered "dirty" - not all the data that should be written to the disk has been. Once all the data has been actually, physically placed on the hard disk, the disk might be considered "clean".

"... Windows sets a 'dirty' flag on your hard drive whenever it has unfinished business with the drive."

This kind of halfway state, with data only partially written on the hard disk, is actually common, and programs running on the system - and even large parts of Windows itself - are completely unaware that this is happening. They hand off data to the disk management system to be written, and simply assume that it will be, in some kind of timely fashion. (Optimizing disk access while maintaining data integrity and system speed is actually a very complex topic and the subject of a lot of system design effort. How data eventually makes it to the disk and in what order can be thought of as so much black magic these days.)

So why is all of this important? Well, consider this: you perform a "Save As..." in your favorite word processing program to save a copy of your document under a new name. Until both all of the file's data, and its entry in the filesystem's list of files or "directory" are physically on the disk, the filesystem could be considered dirty. What happens if the power goes out halfway through writing the file?

Your machine has been shut down with a dirty file system.

Typically, that means on reboot CHKDSK will be run automatically to check for and repair any errors on the disk.

And it also means you might lose the file you were writing at the time the power went out.

Now, losing power in the middle of editing a document is something most people understand, but the situation is actually a lot more common than you might think for two reasons:

  • For all intents and purposes, Windows is constantly writing files to the hard disk.

  • Many people "shut down" their computer by just turning off the power. This is bad.

By just turning off the power to your computer there's a very high chance that you would be interrupting Windows as it writes its files to your hard disk. Most of the time it turns out to be benign, but sometimes it can be disastrous. Sometimes you'll get unlucky enough to interrupt Windows writing something extremely important and you could suffer significant loss of data.

The correct way to turn off your system is to click on the Start button (to Start the process of shutting down), and click "Turn off Computer" or the equivalent. Windows will take a little time to clean things up, shut down all the programs on your machine, and ensure that the disks are marked "clean" before finally turning your machine off.

One source of confusion is that the power button on many computers will actually act as a software shortcut to this process of shutting down. If pressing and releasing the power button starts what appears to be a sequence of applications closing, and eventually the message "Windows is shutting down", then you're ok. If everything suddenly just turns off, or if you have to hold down your power button for several seconds and everything turns off, then you're risking a serious problem.

Article C3655 - February 21, 2009 « »

Share this article with your friends:

Share this article on Facebook Tweet this article Email a link to this article
Leo Leo A. Notenboom has been playing with computers since he was required to take a programming class in 1976. An 18 year career as a programmer at Microsoft soon followed. After "retiring" in 2001, Leo started Ask Leo! in 2003 as a place for answers to common computer and technical questions. More about Leo.

Not what you needed?

5 Comments
Jean
February 24, 2009 5:11 PM

Oops, glad someone asked that. We have some really "slow" computer days here on the island, going from one web page to another takes ages, so it's easier to just shut the whole thing off pulling out the plug! I'm going to learn more patience!

Jennifer
June 10, 2009 3:50 PM

My start-up programs will not shut off causing my computer to become extremely slow and freezing. I tried running "MSCONFIG" but the problem is still there. What do you suggest?

If chkdsk continues to run with each start-up how do I turn it off?

If chkdsk says the system is dirty - how do I fix it?

Of chkdsk fails - what should I do next?

Thanks.

Dhanuja Kaluarachchi
July 4, 2010 1:40 AM

Once my computer shut down improperly and I think it has slowed down my system. Now CHKDSK is running every time I boot and it finds nothing serious. But the computer is still slow and CHKDSK still runs. I tried mscofig but CHKDSK wasn't there. I tried to do it your way by running "regedit" but the "BootExecute" file has the instruction "autocheck autochk *". I'm really helpless. Please help me.

Thank you.

jonathan
October 1, 2010 8:55 AM

i have done the chkdsk /f /x

i checked the registry and it appears exactly as it is supposed to without any changes needed.

i use a disk utility that shows no problems with SMART,etc.

my problem started after i did a fresh install of windows 7. immediately it started this check disc every boot up after this fresh install on a new drive. please advise. I really don't want to got thru the ordeal of another fresh install, if at all possible. i should note that the new OS drive is a 2 TB drive. is it possible this is too large of a drive for the OS?

Vicky
June 28, 2011 10:40 PM

Thanks, answer was good enough for clearing my concept of dirty and clean file system.

Comments on this entry are closed.

If you have a question, start by using the search box up at the top of the page - there's a very good chance that your question has already been answered on Ask Leo!.

If you don't find your answer, head out to http://askleo.com/ask to ask your question.