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

Re: Unmounting/Ejecting removable media



Hello,

On Fri, 10 May 2013 22:47:01 -0400
Curt Howland <Howland@priss.com> wrote:

> It seems logical to me that there would be a way to say "sync 
> immediately" or "do not buffer", so that when the drive was
> inactive it could be yanked without danger of corruption.

IMHO the core of the problem is not in the caching /
buffering / syncing, but in the fact that the OS has no way of
knowing *when* exactly you are going to yank the device out.  So
at the very moment when you are pushing your fingers against
the thumb and pulling it out, a writing operation spanning few
seconds might start and there is no way of ensuring it would not
break the integrity of the filesystem or the files on it.

By the act of unmounting, ejecting or however you call it, you
are telling OS that you are about to do that and by showing a
message "it is safe to disconnect...", OS is telling you that,
well, it is safe to yank the thing out as OS has already
removed access to it from all programs.


So even disabling buffering does not solve the problem
completely, it only shrinks the time when your device is in
unsafe mode  to minimum.  Extent to how is this successful
heavily depends on your use of the drive: e.g. if you use it
for office docs that you edit from thumb, the unsafe time will
probably shrink from seconds to miliseconds per minute, but if
you are running a bittorrent client, it might not help
at all.  (It could actually do more harm by shortening the drive
lifetime.)


So if there is a solution, it's in warning the OS.  Here we
could fancy about body heat detectors that would not work if you
pulled the drive using cable attached string, or light
detectors, which would not work in dark, et cetera et cetera...


aL.
-- 
Alois Mahdal


Reply to: