Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I regularly have the problem that my Linux (Ubuntu 12.04) writes some files to an USB drive that are afterwards missing or broken in Windows. Windows often also tells me that it found problems with the drive. The drive is FAT32 and yes, I always use the small eject icon in Nautilus or simply shutdown the system before removing the drive.

To workaround the problem, I now use sudo sync to force any pending writes to execute, hoping that this will avoid these problems in the future.

What I am actually looking for is an option that tells my Ubuntu/Linux to perform any pending writes as soon possible and afterwards doing a safety check if the data was really written correctly. Currently the default strategy looks rather like "do not write everything too soon and do not double check".

share|improve this question

migrated from askubuntu.com Oct 25 '12 at 17:06

This question came from our site for Ubuntu users and developers.

You seem to be the only one (or at least very rare one) who faces that kind of problems, really. Try using blockdev --flushbufs – poige Oct 25 '12 at 23:07
But I am still not sure why this happens to me. I guess I need to grab an empty USB drive and play through the various scenarios: nosync + unplug, "eject" + unplug, "sleep" + unplug, etc. to really find out why it is not working for me :( – Juve Oct 29 '12 at 16:54

Your Answer


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

Browse other questions tagged or ask your own question.