Oh - my thinkpad W520 on which Iam testing this stuff has 16GB ram. So the default values for dirty_background and dirty , at 10% and 20% equate to 1.6 GB before the flusher starts, and 3.2 GB before the process starts writeback. Thats a lot.
So , when you eject the flash drive, there maybe as much as 3.2 GB sitting in ram waiting to be written to disk. With a disk write speed of , say, 30 MB/s, that is close to 2 minutes of write activity before it can eject.
That matches my experience.
usb flash, drives, cameras etc
Re: usb flash, drives, cameras etc
After a bit of messing around - I have successfully automounted my camera (usb) and have reasonable flash drive performance. Here is what I did , maybe it will come in handy for someone else:
Camera:
- Set up a folder called "camera" in my home directory.. eg. /home/me/camera
- Install gphoto2, gphotofs and all related library files
- create a startup item with the following script: gphotofs /home/me/camera
Thats it ! So simple. It would seem to be something that could be on the vanilla mx install?
USB sticks: changed the following items in /etc/sysctl.conf
vm.dirty_ratio = 10
vm.dirty_background_ratio = 5
vm.dirty_writeback_centisecs = 100
made a bit of a difference. My main issue was the 2 minute delay after the file manager announces its done - and when its really done. That is now like 10 seconds. I do think this number is quite variable depending on file sizes, the type of usb stick etc. But my usb SSD also works fine.
I am starting to see why different folks may have different priorities - some may want to prioritize performance and dont mind a long period of background disk IO - in which case the default is probably fine. This is well above my pay grade - but it was fun starting to learn this stuff.
Cheers!
Camera:
- Set up a folder called "camera" in my home directory.. eg. /home/me/camera
- Install gphoto2, gphotofs and all related library files
- create a startup item with the following script: gphotofs /home/me/camera
Thats it ! So simple. It would seem to be something that could be on the vanilla mx install?
USB sticks: changed the following items in /etc/sysctl.conf
vm.dirty_ratio = 10
vm.dirty_background_ratio = 5
vm.dirty_writeback_centisecs = 100
made a bit of a difference. My main issue was the 2 minute delay after the file manager announces its done - and when its really done. That is now like 10 seconds. I do think this number is quite variable depending on file sizes, the type of usb stick etc. But my usb SSD also works fine.
I am starting to see why different folks may have different priorities - some may want to prioritize performance and dont mind a long period of background disk IO - in which case the default is probably fine. This is well above my pay grade - but it was fun starting to learn this stuff.
Cheers!
Re: usb flash, drives, cameras etc
More - well that camera setup worked for my Fuji camera , but could not get it to mount my wife's Canon !!
So - she is now on Mint. Mint seems to have no problem with usb devices, incl cameras ... out of the box.
So this usb issue is not a Linux thing.
So - she is now on Mint. Mint seems to have no problem with usb devices, incl cameras ... out of the box.
So this usb issue is not a Linux thing.
Re: usb flash, drives, cameras etc
I wonder if your usb problems are related to this bug: Bogus hard drive IO errors on certain hardware.
If IO errors show up in the output of dmesg after you have trouble with a usb device then it may be the same problem. If so, the kernel devs are asking for more information from someone who experiences the problem.
"The first principle is that you must not fool yourself -- and you are the easiest person to fool."
-- Richard Feynman
-- Richard Feynman
Re: usb flash, drives, cameras etc
Flash drives over 32G are a problem for FAT32. Most are default formatted to exFAT. If you don't need Windows compatibility, consider formatting EXT3. As you already know, your mileage may vary.
Re: usb flash, drives, cameras etc
Brilliant. BTW, all Linux are not created equal -- my default vm.dirty settings are vary according to distribution. Also, different hardware also needs different settings for optimizing. Lots of articles on the Internet on the subject. You've probably already found sysctl -a to show you all your settings.