Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problems copy files to USB-Mass Storage device
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
if0720
n00b
n00b


Joined: 19 Mar 2003
Posts: 16

PostPosted: Thu Feb 15, 2007 8:27 am    Post subject: Problems copy files to USB-Mass Storage device Reply with quote

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
View user's profile Send private message
dentharg
Guru
Guru


Joined: 10 Aug 2004
Posts: 438
Location: /poland/wroclaw

PostPosted: Thu Feb 15, 2007 9:08 am    Post subject: Reply with quote

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
View user's profile Send private message
JeliJami
Veteran
Veteran


Joined: 17 Jan 2006
Posts: 1086
Location: Belgium

PostPosted: Thu Feb 15, 2007 9:34 am    Post subject: Reply with quote

before you physically remove the device, run
Code:
$ sync

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
View user's profile Send private message
if0720
n00b
n00b


Joined: 19 Mar 2003
Posts: 16

PostPosted: Thu Feb 15, 2007 8:54 pm    Post subject: Reply with quote

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 :D

What are the drawbacks you were talking about ?
Back to top
View user's profile Send private message
JeliJami
Veteran
Veteran


Joined: 17 Jan 2006
Posts: 1086
Location: Belgium

PostPosted: Fri Feb 16, 2007 7:34 am    Post subject: Reply with quote

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
View user's profile Send private message
if0720
n00b
n00b


Joined: 19 Mar 2003
Posts: 16

PostPosted: Sun Feb 18, 2007 4:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum