View previous topic :: View next topic |
Author |
Message |
if0720 n00b


Joined: 19 Mar 2003 Posts: 16
|
Posted: Thu Feb 15, 2007 8:27 am Post subject: Problems copy files to USB-Mass Storage device |
|
|
Hi,
i can plugin and mount my usb devices normaly. But then i copy a big file (~ 100MB) on that device, the copy command (also with drag & drop in konqueror) is finished very fast. I can even see the file on the device with the right size.
When i now plugoff the device and re-plugin - the file is not listed on the device anymore.
It seems to me, that the copy command says finished although it isn't. I compiled my kernel with some other USB options and with debug messages. No luck so far.
But then i copy a file to a usb-device i can see the IO-Transfers in the LOG although the copy command is finished.
During that transfers i can't unmount the device (because its busy i believe).
Is this a normal behaviour ? Does anybody else have this kind of problem.
Thanks in advance. |
|
Back to top |
|
 |
dentharg Guru


Joined: 10 Aug 2004 Posts: 438 Location: /poland/wroclaw
|
Posted: Thu Feb 15, 2007 9:08 am Post subject: |
|
|
Seems like you have some extreme caching for that device. The file is first copied to this cache and then quitely moved to the device in the background - at least that's what I think.
In KDE I always use "safely remove" for any usb stick I plug before removing it. |
|
Back to top |
|
 |
JeliJami Veteran


Joined: 17 Jan 2006 Posts: 1086 Location: Belgium
|
Posted: Thu Feb 15, 2007 9:34 am Post subject: |
|
|
before you physically remove the device, run
it will flush any file system buffers
you could also mount your device with the 'sync' option
this will prevent any buffering/caching
but that has other drawbacks _________________ Unanswered Post Initiative | Search | FAQ
Former username: davjel |
|
Back to top |
|
 |
if0720 n00b


Joined: 19 Mar 2003 Posts: 16
|
Posted: Thu Feb 15, 2007 8:54 pm Post subject: |
|
|
Thank you for your answers.
I added the 'sync' option in my /etc/fstab. This works great. The copy command takes as long as the file completly transfered.
Great hint davjel
What are the drawbacks you were talking about ? |
|
Back to top |
|
 |
JeliJami Veteran


Joined: 17 Jan 2006 Posts: 1086 Location: Belgium
|
Posted: Fri Feb 16, 2007 7:34 am Post subject: |
|
|
With the sync option, not only all file operations are written directly to disc, but also all filesystem operations!
(see the comments of nephros, maguire and Gentree in
https://forums.gentoo.org/viewtopic-t-350769.html)
If you use the 'sync' option, you may also want to use the 'noatime' option (see man mount), and probably some others. _________________ Unanswered Post Initiative | Search | FAQ
Former username: davjel |
|
Back to top |
|
 |
if0720 n00b


Joined: 19 Mar 2003 Posts: 16
|
Posted: Sun Feb 18, 2007 4:08 pm Post subject: |
|
|
With the sync option in /etc/fstab set, file transfer to the usb-device is horrible slow - you cant use it
Just for testing i booted up with knoppix and found out, that in this distribution the transfer works with caching also. A 100MB file is "copied" in a second - but as mentioned - not realy copied.
OK obviously thats just the way coping to usb-device works in linux. I will use "safely remove" in kde now, although i would prefer to know when the file transfer is completed ... |
|
Back to top |
|
 |
|