How to stop scan message when USB flash drive is plugged in?

Discussion in 'other software & services' started by allizomeniz, Oct 25, 2013.

Thread Status:
Not open for further replies.
  1. allizomeniz

    allizomeniz Registered Member

    Joined:
    Aug 23, 2009
    Posts:
    906
    In Vista I keep getting a message when I plug in one of my flash drives. Not sure if it matters but it's a Cruzer Glide. The message tells me I should scan the drive. If I scan it, there's never a problem and it doesn't do it on any of the XP machines I've used so I believe it must be Vista. On one of the Vista forums I read you should scan it from the command prompt so I tried that and it stops the message for about a week then it's back again. Anyone else ever encountered this and figured out a way to stop it permanently?
     
  2. stapp

    stapp Global Moderator

    Joined:
    Jan 12, 2006
    Posts:
    7,303
    Location:
    England
  3. allizomeniz

    allizomeniz Registered Member

    Joined:
    Aug 23, 2009
    Posts:
    906
    Thanks stapp. Some of those ideas work but they disable AutoPlay completely. I can't remember how I formatted the drive before but I formatted it again on Vista and I'll try that. It's FAT32 and optimized for quick release so I can't figure out what its problem is. If it starts doing it again I'll just live with it.
     
  4. allizomeniz

    allizomeniz Registered Member

    Joined:
    Aug 23, 2009
    Posts:
    906
    I found this information in the Help file of USB Drive Letter Manager (USBDLM). It's very technical but it's the most detailed analysis of this I've seen, so I thought I'd post it in the event it might help someone. I finally just bit the bullet and started always using Safely Remove. I absolutely hate it, but my flash drives do work a whole lot better. :)

    Vista / Windows 7 "Scan and Fix"

    When a FAT formatted "removable" USB drive is attached then under Vista and Win7 the "Scan and Fix" dialog is often shown.

    After executing this "Scan and Fix" (never seen it really finds an error) it shall not be shown again, but in real life it happens that is comes again and again...

    Why?

    A look at the FAT partition's boot sector reveals that the "Scan and Fix" is shown when there is a certain bit set. When this bit is set back to 0 then "Scan and Fix" is not shown anymore.

    USBDLM can do exactly this:

    [Settings]
    PreventVistaScanAndFix=1

    What exactly does USBDLM?

    This aforesaid bit is found in a value with the very meaningful name "BS_Reserved1", see Microsoft's FAT32 File System Specification (fatgen103.doc).

    Usually its value is 0, when "Scan and Fix" was trigged you will find a 1 there.

    When a new USB drive is attached then USBDLM looks for a FAT partition and resets the value to 0 in its bootsector. If this succeeds before Windows reads the value then "Scan and Fix" is not shown. Usually it works well, but sometimes Windows is too fast...

    Of course this suppresses the symptom only. It is far better to prevent having this "dirty bit" set.

    As far as I have discovered, Windows sets the bit whenever a file size is changed and when a file is created or deleted.

    Here is my dirty bit watch tool: WatchFatDirtyBit.zip

    Under Windows 7 It is set back to 0 about 1.5 Seconds after a file size change but very long 30 Seconds after a file was deleted or created! Having a write cache active or not seems to have no effect on the dirty bit handling under Windows 7. But this there are very first results, more research is to come...

    So, if you delete a file on a FAT formatted USB drive and remove it within 30 Seconds then you have set dirty bit.

    Just always use "Eject" or the "Safely remove hardware" facility, this flushes all data and sets the bit back to null.
     
  5. SirDrexl

    SirDrexl Registered Member

    Joined:
    Apr 14, 2012
    Posts:
    545
    Location:
    USA
    I'm not sure why, but I get this message if I have put files on the drive within a Linux environment and then insert it in Windows. Maybe Windows stores something about the drive and then sees that it has changed, I don't know.
     
Loading...
Thread Status:
Not open for further replies.