Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Files copied to USB thumb drive completely gone



On 2009-11-04 13:19 +0100 (Wed), Niels Kobschätzki wrote:

> > I haven't seen such issues so far, but I have noticed that some of
> > my (old) USB flashdrives continue to blink for a second or two after
> > `umount` has returned.
> 
> If you write to an USB-flash-drive often data is not directly copied  
> but goes only into a write cache. When you unmount the device the  
> content of the write-cache will be written to the USB-flash-drive.

Note that he said "after `umount` has returned". From what I've seen,
umount won't return under Linux until the unmount is complete, meaning
that the buffer cache has been entirely written.

I suspect that it's simply hysteresis in the light. An actual write
operation will happen in a few milliseconds, and a light flash that
short would be rather hard to see. A typical way to deal with this is to
give the light two modes: off and blinking at 2 Hz. Whenever the drive
receives a request for an operation, it sets the light to blinking mode
with a timeout of 2 seconds until it goes back to non-blinking mode.
Thus, the light will always blink for long enough that the user can see
it, will continue to blink as long as operations are being performed,
and it will never flicker so fast it can't be seen.

cjs
-- 
Curt Sampson       <cjs@example.com>        +81 90 7737 2974
           Functional programming in all senses of the word:
                   http://www.starling-software.com


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links