Page 1 of 1

[SOLVED] USB Key and cache problem?

PostPosted: Jul 20th, '14, 14:10
by alopez
Hi,

currently using M3, I noticed that when I insert a USB key and write some large (1~1.5Gb) files using nautilus, the progress bar moves incredibly fast (reported transfer speed is also very high), until a moment when it completely freezes and stays there for several (up to 15) minutes. Usually this happens when the file is reported to be copied up to 99%, but depending on the number and sizes of the files, this can happen before. This progress bar is then completely useless, because it means nothing.

My guess is that the progress bar is reporting the information it gets from fuse which is actually reporting fake information because it is write-caching the file. And when it receives the last byte of the files, it blocks until the cache is completely written to the key. This is a safe behavior, but makes the cache useless because the operation will not end until the last byte is written to the device. There is no gain using this cache.

So my question is, do you guys think I'm right thinking it is a write-cache problem? If yes, do you know how I can disable the write-cache only for USB keys? My guess is that it should be gvsfd.

I searched the internet but found no one complaining about this specific behavior, although I found several people with related but slightly different problems with solutions that don't apply to mine.

Thanks.

Re: USB Key and cache problem?

PostPosted: Jul 20th, '14, 21:06
by doktor5000
Actually that's a question how the kernel itself or more specifically the usb and filesystem device drivers handles that, syncronous or asyncronous.

You may want to check
http://superuser.com/questions/526248/t ... untu-linux
http://askubuntu.com/questions/5051/how ... ting-to-it
http://www.linuxquestions.org/questions ... an-424136/

Re: USB Key and cache problem?

PostPosted: Jul 22nd, '14, 22:51
by alopez
Thanks doktor5000 for your answer.

I had already seen those pages and they only propose to manually use hdparm to disable the cache. I want this done automatically when the device is plugged into the system, at the same time it is auto-mounted. I was hoping Mageia would include a way to do this, but now I guess it doesn't.

I think udev might be of use, using the DRIVER=usb-storage condition, but I don't have much experience with udev and I'm not sure how to proceed with out breaking anything. I'll give it a try during the week-end.

Any other idea to use instead of udev?

Re: USB Key and cache problem?

PostPosted: Jul 23rd, '14, 20:32
by doktor5000
This is nothing that Mageia can provide, this is closely tied to the various mount helpers, depending on what desktop environment you're using. Sadly for most of them, advanced options cannot be configured.

Re: USB Key and cache problem?

PostPosted: Dec 21st, '14, 20:40
by alopez
It seems that the recent kernels fixed this problem.