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

Re: Preventing delayed USB writes



pedxing wrote:
Lenny AMD64.

When I write to a USB device (stick or mp3 player), I notice that
the writes appear to happen quickly, but actually take a long time to
complete.  I assume there is some form of caching going on.

To be safe, I issue a sync command from a terminal and wait for it
(up to 15 minutes!) to complete before unmounting the drive.

Is there any way to prevent the caching from occuring?  I would like
to configure things so that, for instance, when I (ok, actually my
wife) use konqueror to copy songs to my mp3 player, when the copy
dialog says 100%, I can immediately unmount the device without
having to wait for a delayed write.

I am not sure if you realize this, but you cannot do that even in Windows. There you actually have to click on the little USB icon on the system tray and choose to "remove the device safely". This is exactly what we do in Linux as well, well, at least in Gnome and KDE. In KDE for example, you right click on the USB icon and click on "safely remove". In both cases, it is never a good idea just to yank out the usb device, otherwise is likely you will get corrupted data on your USB device.

I have found it pretty easy to make users understand this by explaining "just as you safely remove by clicking on the USB icon on your system tray in Windows, similarly, safely remove your USB devices in Gnome or KDE before disconnecting the device". Surprisingly, not many knew that they had to do this in Windows as well. Some of them learned the hard way ... "I copied my powerpoint to the USB stick, took out the stick, went to the class and tried to project the lecture to the screen but it won't work!"

Lesson: Always safely remove the device no matter how you are syncing your data.

my two cents,
->HS




I have looked at the mount man page, but it says the sync option
(which I think is what I want) is only available for ext2/3 and ufs
file systems.

-Ped





Reply to: