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

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

Strange problem with jffs

Discussion in 'Asuswrt-Merlin' started by Goobi, Nov 8, 2019.

  1. Goobi

    Goobi Regular Contributor

    Joined:
    Dec 3, 2015
    Messages:
    139
    Hello community! I got a strange one I am looking for some guidance on. Below is my jffs space and allocations:

    Code:
    df -h /jffs/
    Filesystem                Size      Used Available Use% Mounted on
    /dev/mtdblock8           48.0M     44.0M      4.0M  92% /jffs
    
    du -h /jffs/
    1.1M    /jffs/scripts/ntpmerlin.d
    15.0K   /jffs/scripts/uiScribe.d
    55.5K   /jffs/scripts/uiDivStats.d
    1.3M    /jffs/scripts/connmon.d
    235.0K  /jffs/scripts/shared-jy
    6.0K    /jffs/scripts/.d
    3.5M    /jffs/scripts
    0       /jffs/syslog.log
    0       /jffs/syslog.log-1
    1.5K    /jffs/etc
    965.5K  /jffs/signature
    10.5K   /jffs/configs
    375.5K  /jffs/usericon
    15.0K   /jffs/nvram
    182.0K  /jffs/.sys/AiProtectionMonitor
    30.5K   /jffs/.sys/cfg_mnt
    2.7M    /jffs/.sys/WebHistory
    22.2M   /jffs/.sys/TrafficAnalyzer
    19.7M   /jffs/.sys/nc
    44.8M   /jffs/.sys
    6.0K    /jffs/.cert
    21.0K   /jffs/openvpn
    49.8M   /jffs/
    
    If I try and overwrite the TrafficAnalyzer.db I get the error below:

    Code:
    cat /dev/null > /jffs/.sys/TrafficAnalyzer/TrafficAnalyzer.db
    -sh: can't create /jffs/.sys/TrafficAnalyzer/TrafficAnalyzer.db: No space left on device
    
    Also writing a dummy file to /jffs fails:
    Code:
    touch /jffs/test
    touch: /jffs/test: No space left on device
    
    lsof does not show any files that may have been deleted from /jffs. I also rebooted.

    Short of rebuilding, any suggestions as to how I can make /jffs realize it does have a bit of space to work with?

    Thanks in advance!
     
  2. cmkelley

    cmkelley Very Senior Member

    Joined:
    Aug 11, 2015
    Messages:
    954
    Location:
    Greater Los Angeles Area, California, USizicstania
    Just had this exact problem myself, unfortunately. It's a pain but not irretrievable, you just need to have a USB drive attached and mounted.

    1. back up everything in the /jffs directory to a directory on your flash drive, lets say your drive is named usbdrive and the directory to backup to is jffsback
    Code:
    cp -pur /jffs/* /mnt/usbdrive/jffsback
    cp -pur /jffs/.cert /mnt/usbdirive/jffsback
    cp -pur /jffs/.le /mnt/usbdirive/jffsback
    cp -pur /jffs/.sys /mnt/usbdirive/jffsback
    
    2. delete the TrafficAnalyzer.db file from the backup
    Code:
    rm -f /mnt/usbdrive/jffsback/.sys/TrafficAnalyzer/TrafficAnalyzer.db
    
    3. log into the webui and tell it to Format JFFS partition at next boot and reboot
    4. after reboot ssh into your router (make sure the jffs was actually wiped, it seemed to require 2 tries when I did it, or I screwed up something the first time)
    5. copy everything back
    Code:
    cp -pur /mnt/usbdrive/jffsback/* /jffs
    cp -pur /mnt/usbdrive/jffsback/.cert /jffs
    cp -pur /mnt/usbdrive/jffsback/.le /jffs
    cp -pur /mnt/usbdrive/jffsback/.sys /jffs
    
    6. reboot
     
    Butterfly Bones likes this.
  3. Goobi

    Goobi Regular Contributor

    Joined:
    Dec 3, 2015
    Messages:
    139
    Thank you sir! Worked like a champ!
     
    gattaca, cmkelley and Butterfly Bones like this.