topic title: pendrive won't stop
Posts: 4
patrick013
Joined: 24 Jan 2013
#1
Lately have been having trouble installing anything to a pendrive, but was
able to fully install antiX-base from an ISO put on a pendrive. The full
install is also to a pendrive.

Problem is pendrives don't have drive caches and the pendrive is
constantly looking for something, it's always flashing trying to do
something and can't. Can't find what it is looking for.
Otherwise the distro seems to work OK.

Previously when this happens I resolve it by doing one of these:

- turn off selinux or msec
- don't use ext4 with flex_bg (big improvement)
- turn off all auto-updates everyplace
- use private browsing
- anything else that appears unnecessary, cron jobs, debug daemons, etc..

This time I just can't find it. I suspect the kernel is telling the
program to use the drive cache for some operation and the program can't
find it and the pendrive is just running eternally trying to find and do something very minor.
CPU %'s seem normal.

First question, is there a command one can put in menu.lst that would tell
the kernel we are not using a drive cache today ?

I have some distros on pendrives that run almost as well as if on a
regular HD. Their system is obviously scaled down somewhat by me but just
can't do things that would need the drive cache extensively.

THX

patrick
Posts: 1,308
BitJam
Joined: 31 Aug 2009
#2
The quality (read/write performance) of pen drives varies by orders of magnitude. On a pen drive you will usually be much better off doing a Live (Frugal) install instead of a full install. This is what the Live install is all about. It minimizes the disk (pen drive) usage that you want minimized. IOW, we have already solved this problem and the solution involves doing a Frugal install.

Edit: Also, how you partition the pen drive can have a HUGE impact on performance. It is very important to align the the partitions (actually the blocks in the filesystems) with the blocks on the physical device. Usually you don't know the blocksizes of the physical device so you just align your partitions to start at locations that are 2^N + 1 where N is reasonably large. The last time I checked, most (all) Linux partitioning tools get it wrong OOTB.
Posts: 4
patrick013
Joined: 24 Jan 2013
#3
BitJam wrote: On a pen drive you will usually be much better off doing a Live (Frugal) install instead of a full install.
I still need to do a full install. Alot more flexible overall.
It's just recently these eternal searching's started on
the drive. I'm looking for a kernel parameter right now,
cache related. Might be a new USB-3 setting.

I used to run KDE from a 16GB pendrive formatted XFS
and I can barely tell the difference performance-wise.
Alot better than ext4 because of flex_bg. It's not the
read/write performance here it's the lack of drive cache
and what or how it keeps looking for it.

Haven't lost faith in them yet.

Thanks for the response.

Patrick
Posts: 1,308
BitJam
Joined: 31 Aug 2009
#4
patrick013 wrote:It's not the read/write performance here it's the lack of drive cache
Read cache is only limited by your available (free) RAM. You can use the"free -m" command to see what is available (in megabytes). The first number in the"free" column is the size of RAM that is totally unused. This RAM is available for disk caching. The amount being used for cache is in the first row of the"buffers" and"cached" columns.

For normal drives you can check if write caching is enabled with"hdparm -W /dev/sdX" but that doesn't work on usb drives here. You can do"grep /dev/sdX*" /proc/mounts and see if the"sync" option is there. This option will disable write caching.

I can't remember ever running a Linux system where disk caching was disabled by default. You always need to do something extra to disable it.

How do you know the problem is not with the random write access times of the pen drive? Have you benchmarked this recently? The random write access of a pen drive can be orders of magnitude slower than a conventional hard drive (according to Linus Torvalds).

I've put a lot of time and effort over the years to optimize the performance of antiX on pen drives. It is unfortunate that you don't want to take advantage of any of this work.
Posts: 4
patrick013
Joined: 24 Jan 2013
#5
BitJam wrote:
patrick013 wrote:It's not the read/write
I've put a lot of time and effort over the years to optimize the performance of antiX on pen drives. It is unfortunate that you don't want to take advantage of any of this work.
That's good because I always test distros on the pendrive
before I decide to fully install them. With a full install on the
pendrive.

I haven't found them that slow for web browsing, music,
word processing, etc.. But they have to use block
descriptors to find files directly not pretend there is a disk buffer
when there isn't. Things like selinux completely wipe them
out.

It could even be some program trying to upgrade itself, and taking
up the whole pendrive's operation cause there's no buffer
there to let it not do so.

Need to try to resolve this one. Installs on my machine OK
other than that. Don't need to jump into frugal yet.

Have a good one.

Thanks for the response.

Patrick
patrick013
Posts: 4
patrick013
Joined: 24 Jan 2013
#6
Hi,

I see what you mean about frugal. Very interesting.
The"lean" options especially. I have several 8GB
flash drives I can try that on. You have many working
copies of that no doubt.

Hate not to be able to resolve my initial problem however.
"lean" gives me a few clues to try, the unetbootin ISO
runs quite well, no problem, and I can add root persistence
to that quite easily it says. Very good idea with unetbootin.

thanks for the advise.

patrick