R7000 Admin Tab -> Save & Apply -> Wipes JFFS2

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2  Next
Author Message
efficient_horror
DD-WRT Novice


Joined: 16 Aug 2025
Posts: 8

PostPosted: Sat Aug 16, 2025 7:37    Post subject: R7000 Admin Tab -> Save & Apply -> Wipes JFFS2 Reply with quote
This is an issue that I've been experiencing for a while now. I was hoping it would be fixed by now. When I hit the Save & Apply button on the Administration tab, it wipes my JFFS2 partition. I lost a bunch of scripts and haven't had the time to rewrite them. What other surprises are there? Where can I find the script source code that's run when I hit this button?

TIA

Netgear R7000
Firmware VersionDD-WRT v3.0-r62036 std (08/08/25)
Kernel VersionLinux 4.4.302-rt232-st63 #14124 SMP Fri Aug 8 05:26:57 +07 2025 armv7l
CPU ModelBroadcom BCM4709
CPU Cores2
CPU Features
EDSP FASTMULT HALF TLS
CPU Clock1000 MHz
Dhrystones6775.62 DMIPS

Factory Reset after upgrades.

Code:
Aug 16 01:20:46.466 r7000 user.err : [flash] : Could not unlock MTD device: ddwrt
Aug 16 01:20:46.639 r7000 user.err : [flash] : Could not unlock MTD device: ddwrt
Aug 16 01:20:46.639 r7000 user.info : [flash] : Flash is NAND
Aug 16 01:20:46.639 r7000 user.info : [flash] : erase[0]
Aug 16 01:20:46.639 r7000 user.info : [flash] : erase[131072]
Aug 16 01:20:46.640 r7000 user.info : [flash] : erase[262144]
Aug 16 01:20:46.640 r7000 user.info : [flash] : erase[393216]
Aug 16 01:20:46.641 r7000 user.info : [flash] : erase[524288]
...
Aug 16 01:20:46.986 r7000 user.info : [flash] : erase[98041856]
Aug 16 01:20:46.986 r7000 user.info : [flash] : erase[98172928]
Aug 16 01:20:46.987 r7000 user.info : [flash] : erase[98304000]
Aug 16 01:20:47.432 r7000 kern.notice kernel: klogd: exiting
Aug 16 01:20:47.443 r7000 user.info : [klogd] : kernel log daemon successfully stopped
Aug 16 01:20:47.452 r7000 syslog.info syslogd exiting
Aug 16 01:20:47.469 r7000 syslog.info syslogd started: BusyBox v1.37.0
Aug 16 01:20:47.469 r7000 user.info : [syslogd] : successfully started
Aug 16 01:20:47.475 r7000 kern.notice kernel: klogd started: BusyBox v1.37.0 (2025-08-08 07:19:11 +07)
Aug 16 01:20:47.475 r7000 user.info : [klogd] : successfully started
Aug 16 01:20:47.486 r7000 user.info : [resetbutton] : successfully started
Sponsor
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 7069
Location: UK, London, just across the river..

PostPosted: Sat Aug 16, 2025 9:53    Post subject: Reply with quote
hmmm i haven't seen this yet...but at the first place why do you need juffs2 enabled ...?
if you want to save/use some stiff at jffs, you dont need to enable jffs2...just name your usb partition jffs and automount enabled...than use it...

i usually use /opt rather than /jffs...

Flash is NAND
Aug 16 01:20:46.639 r7000 user.info : [flash] : erase[0]
Aug 16 01:20:46.639 r7000 user.info : [flash] : erase[131072]
Aug 16 01:20:46.640 r7000 user.info : [flash] : erase[262144]
Aug 16 01:20:46.640 r7000 user.info : [flash] : erase[393216]
Aug 16 01:20:46.641 r7000 user.info : [flash] : erase[524288]
...
Aug 16 01:20:46.986 r7000 user.info : [flash] : erase[98041856]
Aug 16 01:20:46.986 r7000 user.info : [flash] : erase[98172928]
Aug 16 01:20:46.987 r7000 user.info : [flash] : erase[98304000

not sure if those are USB related....at all..jffs2 is usually in the ram so, yes those seems like erased...on save/apply..

_________________
Atheros
TP-Link WR1043NDv2 -DD-WRT 62606 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 -DD-WRT 63257 GTW/SmDNS/DoT,AD-Blk,Forced DNS,AP&Net Isolation,x2VLAN,Vanilla
Netgear R7800 --DD-WRT 62606 Gateway/DNSCryptv2,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla,VPN cli
Netgear R9000 --DD-WRT 62606 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Dynalink DL-WRX36-DDWRT 62606
Broadcom
Netgear R7000 --DD-WRT 63257 GTW/DNScrypt-proxy2/AD-Block,IPset Firewall,Forced DNS,x4VLAN,VPN cli
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
efficient_horror
DD-WRT Novice


Joined: 16 Aug 2025
Posts: 8

PostPosted: Sat Aug 16, 2025 11:07    Post subject: Reply with quote
I preferred the self-contained solution where nothing was poking out.
Quote:
MTD device: ddwrt
that is the jffs2 partition. /dev/mtdblock/5 or /dev/mtdblock5. What is /opt? I was installing Entware and mounting /jffs/.opt to /opt... /opt on r7000 is empty otherwise.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 13880
Location: Netherlands

PostPosted: Sat Aug 16, 2025 12:17    Post subject: Reply with quote
Just did a quick check with my R7000 and can confirm your findings, although for me jffs is wiped after a a Save an Apply and then a reboot.
Problem is in services/services/jffs.c , maybe in line 195, but I have no time to look into it

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087


Last edited by egc on Sat Aug 16, 2025 16:15; edited 1 time in total
efficient_horror
DD-WRT Novice


Joined: 16 Aug 2025
Posts: 8

PostPosted: Sat Aug 16, 2025 12:25    Post subject: Reply with quote
Thanks! It's been there for a while though! I'm glad you found it, because I was going to spend time looking at the source code and also explore disabling jffs2 in the gui, while enabling it with console commands. Very hacky.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 16711
Location: Texas, USA

PostPosted: Sat Aug 16, 2025 16:09    Post subject: Reply with quote
Normally when you enable internal JFFS, you have to do a process that requires a reboot just to be sure because it cleans (erases) that partition. Normal behavior of Save & Apply or a bug...

https://wiki.dd-wrt.com/wiki/index.php/Journalling_Flash_File_System

... I'd venture to say caveat of Save & Apply on that page because if the partition isn't mounted, it's going to set it to erase the partition and carry that out as expected.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
RSS feed for DD-WRT releases (2025)
RSS feed for DD-WRT releases (2024)
RSS feed for DD-WRT releases (2023)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
efficient_horror
DD-WRT Novice


Joined: 16 Aug 2025
Posts: 8

PostPosted: Sat Aug 16, 2025 20:44    Post subject: Reply with quote
Yeah... I've tried everything and it does still does it. This bug is over a few months old on at least the R7000. Disabling jffs2 support in the gui and using a startup script works for me. I don't like this solution, but I have peace of mind for now.

Here are the lines if anyone else want them until they patch it.
Code:
modprobe jffs2 2> /tmp/errortrace.txt
mount -t jffs2 /dev/mtdblock5 /jffs 2>> /tmp/errortrace.txt
mount /jffs/.entware /opt 2>> /tmp/errortrace.txt
efficient_horror
DD-WRT Novice


Joined: 16 Aug 2025
Posts: 8

PostPosted: Sat Aug 16, 2025 20:53    Post subject: Reply with quote
egc wrote:
Just did a quick check with my R7000 and can confirm your findings, although for me jffs is wiped after a a Save an Apply and then a reboot.
Problem is in services/services/jffs.c , maybe in line 195, but I have no time to look into it
It's actually all gone before the reboot. You can confirm by unmounting and remounting the partition. I tried reading a file to stdout and it complained about handles.
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 7069
Location: UK, London, just across the river..

PostPosted: Sun Aug 17, 2025 6:14    Post subject: Reply with quote
what if you modify the nvram variables regarding cleaning jffs, do they stay or revert on the next reboot ...or survive save/apply ?

nvram show | grep jffs2

then....

Code:
nvram set clean_jffs2=0
nvram set sys_clean_jffs2=0
nvram commit
reboot


still not sure why you need to use wearable system Ram, then USB /jffs partition and ect.
in general jffs2 partition is not favorable to use as it can produce awkward results....

_________________
Atheros
TP-Link WR1043NDv2 -DD-WRT 62606 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 -DD-WRT 63257 GTW/SmDNS/DoT,AD-Blk,Forced DNS,AP&Net Isolation,x2VLAN,Vanilla
Netgear R7800 --DD-WRT 62606 Gateway/DNSCryptv2,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla,VPN cli
Netgear R9000 --DD-WRT 62606 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Dynalink DL-WRX36-DDWRT 62606
Broadcom
Netgear R7000 --DD-WRT 63257 GTW/DNScrypt-proxy2/AD-Block,IPset Firewall,Forced DNS,x4VLAN,VPN cli
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
efficient_horror
DD-WRT Novice


Joined: 16 Aug 2025
Posts: 8

PostPosted: Sun Aug 17, 2025 13:42    Post subject: Reply with quote
I appreciate everyone who's replied so far. To clarify:

I prefer using the router's integrated storage regardless of whether it's "best practice" or "popular," which is why I asked about this issue. The bug first showed up a few months ago. I've tested multiple angles but haven’t seen anything unusual.

    * The HTML form always posts clean_jffs2=0 to apply.cgi.
    * The nvram variable for clean stays 0. If I remove it, it reappears with a 0.
    * Enabling storage in settings may trigger an initial format after hitting Save & Apply.
    * After that, pressing Save & Apply reformats the partition again.
    * Rebooting and pressing Save & Apply at any point wipes the storage again.
    * I've factory reset the router each time I upgraded thinking an old variable was triggering it.

This may be specific to the Netgear R7000 model. I was mainly asking because I want to keep using the 256MB of free integrated storage and wanted to know if others are seeing the same behavior. At least one person has confirmed it. I will keep the storage disabled in the settings, and enable by startup commands until someone updates us on a patch.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 13880
Location: Netherlands

PostPosted: Sun Aug 17, 2025 14:44    Post subject: Reply with quote
I am also not a big fan of using flash storage, writing to it wears it out quickly, but if you read from it no problem.
I can confirm the problem it is specific for Broadcom routers and perhaps some others.

I think the problem is in line 195 of services/services/jffs.c that does not evaluate to 0 but to -1 meaning it cannot determine if it is mounted (maybe because it is "in use"?)

jffs.c:line 192
Code:
#else
         eval("mtd", "unlock", rwpart);
         sprintf(dev, "/dev/mtdblock/%d", getMTD(rwpart));
         didntwork = mount(dev, "/jffs", "jffs2", MS_MGC_VAL | MS_NOATIME, NULL);


Oh and total flash is 256 around 95 Mb is usable for jffs2, still not bad Smile

I am currently busy with other projects so no time to look further into it but will see if I can get Sebastians attention Wink

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 16711
Location: Texas, USA

PostPosted: Sun Aug 17, 2025 18:38    Post subject: Reply with quote
If it's -1, the partition is jffs2, if it's 0, it's ddwrt, unless I'm reading the entire start_jffs2 function wrong, which is ALWAYS possible. Again, I think it's expected behavior when you click Save & Apply.

https://github.com/mirror/dd-wrt/blob/master/src/router/services/services/jffs.c

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
RSS feed for DD-WRT releases (2025)
RSS feed for DD-WRT releases (2024)
RSS feed for DD-WRT releases (2023)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 13880
Location: Netherlands

PostPosted: Wed Aug 20, 2025 15:31    Post subject: Reply with quote
@efficient_horror can you test the attached build if this solve the JFFS2 problem?
As always make a backup and know how to unbrick your router but these Netgear routers are almost unbreakable and easily recoverable with NMRP flash Smile

But this build is tested on my own R7000 and also on my EA6900

Unzip and upload to the router Smile

P.S. other users with an R7000 are also welcome to test



R7000-62055-13-jffs-4-northstar-firmware-squashfs.zip
 Description:

Download
 Filename:  R7000-62055-13-jffs-4-northstar-firmware-squashfs.zip
 Filesize:  19.59 MB
 Downloaded:  150 Time(s)


_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
efficient_horror
DD-WRT Novice


Joined: 16 Aug 2025
Posts: 8

PostPosted: Wed Aug 20, 2025 16:21    Post subject: Reply with quote
Thanks egc, I'll give it a try tonight after work and let you know.

Also, maybe you can point me in the right direction if you know this off the top of your head: how can I compile the full version of wl?
efficient_horror
DD-WRT Novice


Joined: 16 Aug 2025
Posts: 8

PostPosted: Thu Aug 21, 2025 4:35    Post subject: Reply with quote
Sorry about the late reply. I monkey tested for a while, and the issue appears to be fixed. Hopefully the change can be merged. Thank you for looking into it.
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum