Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an external USB hard drive that Windows 7 doesn't properly recognize as being a USB device, it thinks it's a regular internal drive. As such, it won't let me eject it, and I've been using an ad-hoc method of removing the drive letter via Computer Management in order to ensure the drive isn't being accessed when I disconnect it.

The problem with this is that Windows frequently refuses to let me write to the drive because it thinks it was disconnected improperly. Running chkdsk clears the dirty volume flag (or whatever it is that it's relying on), but it never finds any actual errors. It's a completely pointless exercise.

How can I prevent Windows from doing this?

share|improve this question

3 Answers 3

up vote 4 down vote accepted

Can't add this as a comment to Synetech's answer (rep too low) but you can, indeed, find the dirty bit and clear it using a hex editor. It's a bit hair raising, though (Find a bit pattern that looks like this one, which hopefully isn't actual data, then twiddle it from 1 to 0.)

Linux gparted/parted or ntfsresize also apparently know where the dirty bit is, because they set it as soon as you touch an NTFS partition.

share|improve this answer
    
You should be able to make it a comment now :) –  Matthew Read Feb 15 '12 at 18:01
1  
Hilarious. You're a prince. ;) –  Li-aung Yip Feb 15 '12 at 18:05
    
> Hilarious. You're a prince. ;) And you’re a cowboy. :-D –  Synetech Feb 15 '12 at 18:28
    
Nice. I’m not surprised that somebody eventually found it—though why Microsoft purposely kept it secret is beyond me. (I just wish I hadn’t been too busy and given up on it.) :-P –  Synetech Feb 15 '12 at 18:30
    
Actually, the dirty bit is at different places depending on the filesystem and version of the OS (and in fact, there may be more than one): [1], [2], [3]. –  Synetech Feb 24 '12 at 18:26

See this page for details on the dirty bit.

There is no apparent way for them to clear the dirty bit.

This is confirmed by the many pages that discuss using fsutil, but end up agreeing that it can only set the bit, not clear it and that the only way to clear it is to run chkdsk. The page goes on to say that

Microsoft has never released the location of the dirty bit, so they are stuck.

(That’s interesting because a long time ago, I actually tried to identify where it was located but gave up pretty quickly. That note has stoked my interest in finding it again.)

In any case, I would not recommend arbitrarily just clearing the dirty bit. I would suggest finding a way to get the drive to work as expected instead. First off, have you set the drive’s policy in the Device Manager? Open the Device Manager (devmgmt.msc) and double click your drive and disable Write Caching in the Policies tab (if Optimize for quick removal is not disabled, select that as well).

share|improve this answer
    
Thanks very much for the info, I may make my own stab at finding it. I'm not really interested in needing to clear the bit though -- I'd rather it wasn't set, or Windows didn't force me to act on it. I do believe I've tried toggling write caching without luck. –  Matthew Read Feb 15 '12 at 17:53
    
There is unlikely to be a way to prevent it from being set or acted upon without hacking the guts of Windows. –  Synetech Feb 15 '12 at 18:27
    
Probably true, I guess I was hoping for a simple registry tweak or something. –  Matthew Read Feb 15 '12 at 18:29
    
Well if they purposely kept it secret, meaning that they don’t want users to be able to control it, then I doubt they would have made it easy. :-( –  Synetech Feb 15 '12 at 18:34

Sounds to me like you should try to get the device set as a removable device so you don't have this problem in the first place! Thankfully, we've already had a community response.

USB stick appearing as hard disk drive, not removable storage device

Hope this helps!

share|improve this answer
    
This didn't work on my hard drive, sadly. –  Matthew Read Mar 24 '12 at 3:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.