usb flash, drives, cameras etc

Message
Author
rs55
Posts: 273
Joined: Sun Feb 24, 2019 4:24 pm

Re: usb flash, drives, cameras etc

#21 Post by rs55 »

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.

rs55
Posts: 273
Joined: Sun Feb 24, 2019 4:24 pm

Re: usb flash, drives, cameras etc

#22 Post by rs55 »

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!

rs55
Posts: 273
Joined: Sun Feb 24, 2019 4:24 pm

Re: usb flash, drives, cameras etc

#23 Post by rs55 »

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.

User avatar
BitJam
Developer
Posts: 2283
Joined: Sat Aug 22, 2009 11:36 pm

Re: usb flash, drives, cameras etc

#24 Post by BitJam »

rs55 wrote: Fri Mar 15, 2019 1:50 pm 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.
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

User avatar
figueroa
Posts: 1053
Joined: Fri Dec 21, 2018 12:20 am

Re: usb flash, drives, cameras etc

#25 Post by figueroa »

rs55 wrote: Thu Mar 14, 2019 12:33 am OK - I reformatted my 64 GB samsung bar flash to FAT32. Then I copied 11 GB of data on to it (took about 4 minutes).
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.
Andy Figueroa
Using Unix from 1984; GNU/Linux from 1993

User avatar
figueroa
Posts: 1053
Joined: Fri Dec 21, 2018 12:20 am

Re: usb flash, drives, cameras etc

#26 Post by figueroa »

rs55 wrote: Thu Mar 14, 2019 8:27 pm USB sticks: changed the following items in /etc/sysctl.conf
vm.dirty_ratio = 10
vm.dirty_background_ratio = 5
vm.dirty_writeback_centisecs = 100
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.
Andy Figueroa
Using Unix from 1984; GNU/Linux from 1993

Post Reply

Return to “Software / Configuration”