1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Limit for jffs2 partition?

Discussion in 'Cisco/Linksys Wireless Routers' started by kmindi, Feb 28, 2008.

  1. kmindi

    kmindi LI Guru Member

    I just wondered about the size of the jffs2 partition.
    Is it limited by a firmware or by the hardware?
    Or where is it limited.

    I just thougt it could be the this size:
    size = flashmemorysize - firmwareusedspace
    is this incorrect?
  2. danix71

    danix71 LI Guru Member

    Your GL has 4 MB flash. Your Tomato has 2,7 MB. The rest could be transformed into a jffs2 partition.

    So, it's a mix between the hardware (how much flash you have) and software (what firmware do you put on that very flash).
  3. kmindi

    kmindi LI Guru Member

    Thanks for the answer.
    But now I have a problem
    "du -sch" gives me a total of 8.2 MB
  4. mstombs

    mstombs Network Guru Member

    8Meg that's nothing!

    # du -sch
    du: unable to open `./proc/7/fd': No such file or directory
    40.3M   .
    40.3M   total
    happens to be the sum of my flash (8MB)+ram(32MB) on my wrt54gsv1.1!

    So that command is no use - it includes the readonly squashed filesystem plus ram disk + jffs no doubt.

    I thought this should work

    # cat /proc/mtd
    dev:    size   erasesize  name
    mtd0: 00040000 00020000 "pmon"
    mtd1: 007a0000 00020000 "linux"
    mtd2: 0021d8d4 00020000 "rootfs"
    mtd3: 004e0000 00020000 "jffs2"
    mtd4: 00020000 00020000 "nvram"
    which correctly gives the size of CFE (256kB), NVRAM (128kB) and JFFS( 4992kB), but not the kernel+filesystem (together about 2.7MB)
  5. kmindi

    kmindi LI Guru Member

    Indeed that is now correct. Thanks for this nice answer.
  6. danix71

    danix71 LI Guru Member

    mstombs, so what's the answer? It's different from what I've said?
  7. mstombs

    mstombs Network Guru Member

    You answer before was basically correct, but you need to allow for the size of the Bootloader CFE and NVRAM.

    In my post above it is clear that my 8192kB flash under Tomato is allocated as

    mtd0 256kB CFE
    mtd4 128kB nvram

    The rest is available to the firmware as

    mtd1 7808kB (I guess subtract 4096kB = 3712kB for 4MB flash devices)

    mtd1 is further divided into

    kernel + filesystem (mtd2) + jffs (mtd3)

    The kernel+filesystem is mostly the firmware you download less a few kB header/trailer?

    The amount of usable space on jffs2 is also not fixed, there is a reserved amount for the flash usage management 256kB? plus the rest is compressed so you can store more compressible html files than tight binary executables...
  8. danix71

    danix71 LI Guru Member

    But basically Tomato itself calculates the remaining flash available for jjfs. Isn't that right?
  9. kmindi

    kmindi LI Guru Member

    Yes, that would be my question too.

Share This Page