Recently when developing a Linux device that presents itself as USB Drive to Windows, with a filesystem created every mount using mkfs.fat, however when mounted (via g_mass_storage) and presented to Windows it always shows the message "There might be a problem with some files on this device or disc. This can happen if you remove the device or disc before all files have been written to it."

After letting windows fix it, Windows reports that there were no errors found.

What causes Windows to report "there is a problem with this drive"?

  • It looks like I can't have the word "problem" in my title, can someone with more rep edit it in for me?
    – Mark Omo
    Apr 10, 2019 at 20:28
  • The work is not allowed in titles regardless of the editors rep.
    – DavidPostill
    Apr 10, 2019 at 20:29
  • @DavidPostill Thanks for letting me know, let me know if my new title is not clear enough
    – Mark Omo
    Apr 10, 2019 at 20:38
  • How are you removing the device from Linux when you're done writing to it? Unmounting safely, or just unplugging it? Maybe the filesystem really does have some minor errors, but I didn't think fat could get marked as "dirty"
    – Xen2050
    Apr 11, 2019 at 9:04
  • 1
    That should be safe... guessing but maybe next time you could try running chkdsk in a terminal & see all the output, I think windows might like to hide all the details with it's basic popup "yes/no" & "done" windows?
    – Xen2050
    Apr 11, 2019 at 19:49

1 Answer 1


The FAT32 and vFat filesystems have a "Dirty" flag which is supposed to be set to indicate writes are in progress, in order to signal that the filesystem may be partially written (and therefore needs checking).

Linux sets the "dirty" flag on the drive when it is mounted read-write, and does not unset it until it is unmounted. This means if the drive is removed without being unmounted first then the dirty flag will still be set, even if no changes are pending or have been made.

What it should do, is set it when a file or directory is first opened for writing, then unset it when all such files are closed and pending writes are complete.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .