# FreeBSD on bootable USB stick: it works but performance is terrible



## robspop (Mar 20, 2013)

I have installed FreeBSD (9.0, 32 bit version) on a USB stick to use at work. It runs ok but it is terribly slow to load anything: even a basic xterm takes time and something like a web browser feels like it is taking forever.

I have colleagues who use bootable Linux USB sticks and these seem to work much faster.  They generally used some sort of live image, or created an image with a utility specifically intended to create bootable USB sticks.  I created mine by installing FreeBSD in the normal way, with the USB stick as the target drive.  I used GPT partitioning.

Does anyone know if there is some simple explanation for the poor performance, and thus a solution to the problem?  I wonder, for example, if the Linuxes are using compressed file systems that improve performance by reducing the amount of data transferred from the USB stick.

The PCs are fairly new and high spec, and the USB stick is also new and was chosen on the strength of a number of reviews that said it was fast (it was a fairly expensive, branded model).

Maybe I should just buy a USB external HDD instead?

Thanks.


----------



## SirDice (Mar 20, 2013)

I'm guessing those linux sticks use some sort of RAM disk and run from there. Something like that is possible too on FreeBSD but requires a bit of tinkering.


----------



## gpw928 (Mar 23, 2013)

Hi,

I run Linux straight off a USB stick on my MythTV clients, and it runs OK (the firefox which I use all the time, and into which I am typing this, also runs on one of those systems -- so I don't have to worry about flash on FreeBSD).

One thought is that all thumb drives are not created equal.  The best ones are just SSDs (and cost the sames as SSDs), but the performance of the others ranges from OK to appalling.

Tom's Hardware has a pretty comprehensive thumb drive benchmark here.  I guess that I'd be looking at the thumb drives in the the "fileserver" benchmark.

Cheers,


----------



## X3RNAL9AN1C (Mar 24, 2013)

gpw928 said:
			
		

> Hi,
> 
> I run Linux straight off a USB stick on my MythTV clients, and it runs OK (the firefox which I use all the time, and into which I am typing this, also runs on one of those systems -- so I don't have to worry about flash on FreeBSD).
> 
> ...



Exactly, *I* have a thumb drive that is slower than on old vista install when it*'*s running a live distro. its It's all about the read speed. *O*ther drives *I* have work just fine (don*'*t have a really fast one yet). *I* would just try to through a Linux on it and see what happens.

*A*s far as a RAM disk *I* don*'*t think this is so. *W*henever *I* run from a CD/DVD it*'*s still ungodly slow. *I* know Puppy Linux loads itself into RAM on boot, but that*'*s only 140 MB. im I'm sure there are are others as well, but *I* think most wouldn't do anything more than using tmpfs for /tmp (as it has nowhere to write its temp files to).


----------



## robspop (Mar 25, 2013)

I take the point about the quality of the USB stick but, as I said in the original post, I chose the USB stick because it is a good one.  In the Tom's Hardware reviews a similar model by the same manufacturer ranks 3rd out of 43.  A review on the Pendrive Linux site gives the specific model I have a very high rating and describes it as a good candidate for a bootable USB stick.

I have an old Kingston Traveller that is included in the Tom's Hardware list and it scores only a tiny fraction of what my expensive drive scores, yet its performance is adequate with Linux Mint on it.

There must be something more to this than the quality of the USB stick.

For the price of the USB stick I could have bought an external USB HDD and I will probably go ahead and do so as it would serve my purpose well enough.  I would still like to know out of interest if there is anything specific one could do to improve the performance on the USB stick though.


----------



## wblock@ (Mar 25, 2013)

Use a memory-based version of FreeBSD, like mfsBSD.  Small transfers on USB are slow.  Large serial transfers, like copying the system to RAM, are faster.


----------



## taz (Mar 25, 2013)

NanoBSD could also be used.


----------



## AngelescuO (Mar 30, 2013)

Hi,

To improve loading from USB stick you need to build yours USB. There you need to make a bootable USB stick with a kernel which loads from loader.conf an mfsroot to mount a compressed filesystem and after mounting to start from compressed filesystem usual FreeBSD init. This will improve FreeBSD boot performance. I have done this in the old days (about 7 years ago) and it worked. Linux uses the same way. They load the kernel, then they load an initrd (our mfsroot), they mount a compressed filesystem (usually SquashFS) and continue launching the regular init.


----------

