If I put a USB memory stick (FAT formatted) into a Windows PC, then unplug it without "ejecting" it, then put it in again, Windows is okay with that, without giving any warning about it "possibly having problems".
But if I do the same with Linux (e.g. Ubuntu 15.04), then after inserting it the second time, I get warning messages in the log like:
FAT-fs (sdf1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
And if I subsequently put it in a Windows PC, I get a message popping up prompting me to check it for errors.
Why is Linux handling of the FAT "dirty" flag so basic? I would have thought it would be better to only set the "dirty" flag if it really is potentially "dirty" -- e.g. something like:
- Set the "dirty" flag when a file is written.
- Clear the "dirty" flag when:
- all written files are closed, and/or
- the write cache is written out to disk,
- and of course, when the disk is unmounted.
It would be nice if there was at least some mount option to operate in that mode, to reduce the chance of users getting "dirty" flag false alarms for merely plugging and unplugging a removable device, even though nothing was actually written.