Understanding NVRAM?

Discussion in 'Tomato Firmware' started by schnappi, Jan 12, 2014.

  1. schnappi

    schnappi Networkin' Nut Member


    Can someone help me to understand NVRAM. Is all the "space" on (most Tomato compatible) routers NVRAM or is there a tiny hard drive or something else?

    Going off this is NVRAM formatted into any kind of file system that Tomato (or any other firmware) is installed on?

    Trying to understand this to set setting in Tomato such as "store in NVRAM" or not.

    Thanks in advance for helping me to understand.
  2. shibby20

    shibby20 Network Guru Member

    NVRAM is a part (one of partition) in flash. Tomato has read-only filesystem (ROM). There is no way to modify files in ROM, well tomato has to store somewhere all settings. This place is nvram :) Structure of nvram is very simple:

    Tomato takes all needed values from nvram and generate all settings files in RAM (tmpfs). If we change something in GUI then Tomato has to save new value of variable in nvram, regenerate settings file and then restart a service.

    The same works dd-wrt.

    Openwrt works differient. Openwrt is using pivot function between jffs (writable partition in flash) and ROM.
    All modified files are stored on jffs.

    Best Regards.
  3. schnappi

    schnappi Networkin' Nut Member

    Wow. A reply direct from the famous Shibby Tomato build builder. Cool.

    So when one types df -h command into a server (router in this case) the 2.1 MB that comes up is the ROM space you referenced?
  4. shibby20

    shibby20 Network Guru Member

    yes, if you mean a root "/" partition. /tmp directory is a part of RAM (tmpfs/ramfs).

    NVRAM has only 32 or 60 or 64KB (kilobytes).

    Run command:
    nvram show | more

    (press space to see another page). There are all variables with values stored in nvram. At the end you will see free and used space of nvram.
  5. schnappi

    schnappi Networkin' Nut Member

    I think I mean a root partition. I am just not familiar with Tomato as a Linux build. Basically I see /dev/root using 2.1 MB and being 100% used. Since it is unusual to see a disc being 100% used it makes sense that this would be the read-only file system you referenced.

    Where would a JFFS2 and CIFS drive would pull space from (ROM space)?

    And what is "Total / Free Memory" on the tomato homepage a count of? Is this basically regular RAM?
  6. AlexF

    AlexF Serious Server Member

    JFFS2 would use the remaining space from your Flash-memory, e.g if your router has 8MB of flashstorage and 6MB is used for the firmware, you still have 2 MB left which can be used for a JFFS2 filesystem ( ignoring bootloader and NVRAM ).

    CIFS (Common internet file system) is just a locally mounted filesystem, the actual data is stored on the server which the mountpoint is pointing at.

    Yes, regular RAM.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice