Q: Cramfs Vs. Ubifs

Ricard Wanderlof ricard.wanderlof at axis.com
Tue Jun 5 04:33:02 EDT 2012


On Mon, 4 Jun 2012, Ran Shalit wrote:

> I read about cramfs and ubifs, but there is still something I don't
> understand here, I hope you can help me with that...
>
> 1. It seems reasonable that execution from RAM is faster then Nand flash.
>    So If I'm using ubifs, should I copy the executables to RAM before 
> execute ?

Most systems can't execute directly from NAND flash, so that is not really 
an option either way. In fact, since NAND flash cannot be mapped to an 
address space, there is no way to directly execute from NAND flash, 
however, one could imagine a system with some form of memory managment 
scheme which buffers the data so that the flash appears to be directly 
addressable. I don't know if there is such a system though; I've never 
heard of one (but that's not saying much).

The 'copy to RAM' is nothing one normally has to worry about; all the 
binaries are on the flash and loaded into RAM when run. Execute in place 
is a special situation that must be explicitly enabled (and I'm very hazy 
on that subject as I've never worked with it).

> 2. If there is no need for writable filesystem, cramfs seems a good
> choice, but some of the utilities write stuff to /var. How should we
> handle that with cramfs ?

You can create an empty /var directory and then mount a tmpfs on it during 
boot.

> 3. in terms of boot time, both cramfs and ubifs are equal. is it correct 
> ?

I don't know in the general case, but I did run some tests on our systems 
a while ago and the boot times for ubifs and cramfs were essentially 
identical. The main differences where that cramfs takes up less space (15 
vs. 22 MB in our case), but for some reason there was more available 
memory runtime, as it seems the Linux system used a lot of buffers with 
cramfs that were not needed with ubifs - the difference was about 9 MB of 
RAM. Didn't have time to investigate the latter fact further though.

/Ricard
-- 
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30



More information about the linux-mtd mailing list