WHY !!! ?

Mihai T. Lazarescu mtlagm at gmail.com
Sun Sep 15 22:43:16 UTC 2013


On Sun, Sep 15, 2013 at 06:27:08PM +0200, Reindl Harald wrote:

> Am 15.09.2013 18:03, schrieb Jim:
> > On 09/14/2013 08:11 PM, Sam Varshavchik wrote:
> >> Do you explicitly unmount your flash drives, before yanking them out.
> > I have to admit that is the one thing I don't do
> 
> so answering with your subject in normal letters: why?

Indeed.  Linux uses (extensive) buffering.  Your write
command may return but the data be still in memory instead
of written on the drive.  If you disconnect it right away,
besides a corrupted file system you may find that your files
are incomplete or missing.

So, with FAT FS issue a sync and wait for it to return or,
much better, unmount (which forces a flush of the associated
write buffers).

Regarding the mount read-only, the kernel may decide to do so
if the FS has errors.  It should resume mounting it RW once
the errors are fixed.

Mihai


More information about the users mailing list