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

Re: Thunar, USB-sticks and big files

On Sunday, November 18, 2012 01:43:54 PM Andreas Rönnquist wrote:
> > Try 'sync' after the write is supposedly complete; see what happens
> > when the system actually tries to write to the device. Open a shell
> > and 'tail -f /var/log/messages' to see if anything is griping about
> > the device during writes.
> > 
> > Hmmm. You *are* waiting for the cached data to be flushed to the
> > drive before unplugging it, right?
> hmm, I now I have tried several different USB-sticks, and I still have
> the problem (It perhaps isn't quite as serious as I believed though)...
> If having copied a "big" file, unmounting through Thunar pretty much
> always results in the following error message:
> > Failed unmounting 'Devicename'
> > "Did not receive a reply. Possible causes include: the remote
> > application did not send a reply, the message bus security policy
> > blocked the reply, the reply timeout expired, or the network
> > connection was broken."
> - after a short while (way before the actual writing is done) - But, if
> I keep waiting for some time _after_ this, the data is still written to
> the device as it should. However, it doesn't give any clue whatsoever
> to when it actually is finished writing the files to the device, so it
> is easy to (by mistake) physically take the USB-stick before the data is
> actually written.
> However, I do have one USB-stick, that actually lights up a LED during
> copying, making it pretty easy to spot when it is safe to remove it and
> not, but I kind of wish that that sort of feature wouldn't be necessary
> to safely use an USB-stick...
> If I don't copy any files, or just copy small files, I get that
> standard "It's now safe to remove the device" when unmounting - This
> is what I expect in the scenario with bigger files described above
> too after copying is done, but no...

The current version of teh command line umount does seem to wait until all 
data are flushed to the drive before exiting; older versions, IIRC, didn't 
necessarily wait.

Hmmm. You said 'timeout'. Could it be that Thunar doesn't wait long enough? 
See if there's a way to increase that timeout. 10 seconds generally ought to 
be long enough, unless you have a *very* slow flash drive.

Or, if there's a way to do it, tell Thunar to mount using "-o sync"; this 
should disable caching (that is, make the effective policy 'write-through'). 
Writes will be slower, but you won't have to wait for the flush to complete 
when unmounting.

Reply to: