What it is
In the tomato context, JFFS refers to a part of the internal flash memory in the router that can be used as additional storage space. It is the same internal flash where the Tomato firmware is installed.
The exact amount of available space in the internal flash depends on the flash overall size (varies on each router model) and on the installed build. Fully-featured builds in fact are fatter, use more flash and thus leave less space for JFFS. Lite builds, instead, have less features and are lighter, thus allowing for more space.
The data on the JFFS filesystem is not compressed. One entire flash block - usually 64kb - is reserved for overhead, plus an additional 1%-2% overhead per file.
When activated, JFFS is automatically mounted at startup on /jffs. This is done very early in the startup, before any other services (wan, lan, USB drives, cifs, etc.) are activated.
Problems with firmware upgrades
JFFS is very handy because it lets you install additional data within the router without having to rely on an external support. Alas, the main disadvantage of JFFS is that it prevents the router from being upgraded. In fact, the upgrade procedure must rewrite the whole flash, and the data in JFFS would be destroyed. TomatoUSB GUI helps you by not allowing an upgrade until JFFS is disabled. This means that you will have to backup the data you put in JFFS before doing an upgrade.
Amount of free space
JFFS is allocated within free blocks of flash memory. Each block is 64Kbyte, of which about 62Kbyte can be used for data. The following table shows the amount of free space available in JFFS for each flash size and each different build.
|Std||Ext||Lite||No CIFS||VPN||No USB|
|JFFS space on 4Mb flash||300Kb||120Kb||600Kb||420Kb||0Kb||900Kb|
So, if you have a router with 8Mb flash, you can check this table and add about 4Mbyte to those figures.
How to enable JFFS
- Enable Administration » JFFS » Enable
- Click on the Format / Erase button, and confirm the messagebox by clicking Yes.
Possible usages of JFFS
- Store any kind of persistent data. If you write something to the standard filesystem (eg: /root), the changes will not persist after a router reboot. Data written under /jffs will instead be permanent.
- Install optware, so to install useful packages.
- Scripts to be executed when JFFS is mounted, via the same method as when a USB drive partition is mounted. All executable *.autorun files in /jffs (the top-level directory of the jffs filesystem) are executed.