Does Windows flush drive caches on standby?

13

3

Does Windows flush the drive caches when entering standby mode?

It seems like an obvious thing to do and I for one would design it like that if I were on the Windows team, but over the years, I have learned not to make such assumptions.

I only managed to find a single page that asked this (in regards to XP), but no answer was given, just a generic response.

Is there any sort of definitive information that Windows flushes disk caches on standby?

Synetech

Posted 2012-07-25T15:38:37.917

Reputation: 63 242

"On standby?" Or "before going to standby?" – Jonathon Reinhart – 2012-07-25T15:40:22.003

I assumed that is what you meant, but the verbiage wasn't clear. – Jonathon Reinhart – 2012-07-25T15:41:53.860

Going obviously; it’s suspended during standby. (I assumed from the context, and the usage of on rather than during that it was clear that I used the term as a verb, not an adjective.) – Synetech – 2012-07-25T16:05:43.873

I have always wondered this. I always assumed it was safe because there was no I/O to the flash drive, so I'm curious as to what the answer is. – nathpilland – 2012-07-25T16:59:52.403

Wow, someone must be bitter and petty to have down-voted and run. (Don’t worry Jason, I know it wasn’t you.)

– Synetech – 2012-07-25T17:57:45.950

Answers

7

The answer is yes according to this MS Support article + some "Sherlock Holmes deductions":

The FLUSH CACHE command is not issued and the hard disk may become corrupted when you enter standby or hibernate

MSKB 331060

This article apply to Microsoft Windows XP Service Pack 2 and MS issued an HotFix to correct the problem therefore we can assume (!? ;) ) that a Flush Cache Command is issued each time Windows XP (an later?) enter in standby mode. I found no other article issued by MS to clarify this point but this is the well known obscure MS communication style...

climenole

Posted 2012-07-25T15:38:37.917

Reputation: 3 180

+1 Okay, then I guess XP SP3 and up (and SP2 with the appropriate patch), it can be assumed that it does. I’m curious however, why they felt the need to specifically state the the problem applies to “large hard disk that has a 48-bit logical block address (LBA) enabled”. Does that mean that it does flush small hard-drives, flash-drives, memory-cards, etc.? Unfortunaetly like you said, Microsoft is usually “clear as mud”. :-| – Synetech – 2012-07-26T00:21:10.170

1@Synetech: It's an implementation detail. Not everything is documented to prevent developers from creating dependencies on behaviors that may change in the future. – surfasb – 2012-07-26T02:32:13.457

2

It depends on the hardware settings for the drive.

A drive that Windows recognizes as a removable drive by default has the write cache turned off, which generally makes it safe to remove without "ejecting" the drive.

http://lifehacker.com/5863810/do-i-really-need-to-eject-usb-drives-before-removing-them

Hope that helps.

Jason Kirby

Posted 2012-07-25T15:38:37.917

Reputation: 57

1Yes, I’m familiar with that setting, but it doesn’t explain Windows’ specific policy on flushing caches on standby. – Synetech – 2012-07-25T16:05:12.877

4If the cache is turned off though, is there a cache to flush? – Jason Kirby – 2012-07-25T16:31:34.737

Are you assuming that there is only one removable drive? Did you read the page that you linked to? It clearly says that it is recommended to eject drives even when they are set to quick-removal. Who says the drive is set to quick-removal anyway? If you need it, mentally edit my question to be specifically about drives that are not set to quick-removal. In fact, forget about flash-drives altogether, read the question as does Windows flush internal, non-removable, hard-drive caches when entering standby? – Synetech – 2012-07-25T16:57:30.080

I don’t know why this was up-voted, it absolutely has nothing to do with the question at hand. – Synetech – 2012-07-25T17:25:29.033