What's new

JFFS contents deleted at every reboot?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

kurish

New Around Here
[Resolved] JFFS contents deleted at every reboot?

Could use some help, please. My init-start script file works when run manually, but everything in /jffs/scripts disappears at reboot.

Hardware: RT-N66R
Firmware: 3.0.0.4.270.26 (Merlin build)
My OS: Win8

Goal: Daily scheduled reboot at specified time

JFFS is formatted and writable. The configs and scripts directories are present.

The following script is saved locally from Notepad++ (Unix/OSX formatting, UTF-8 w/o BOM), then copied to /jffs/scripts using WinSCP:
Code:
#!/bin/sh
cru a ScheduledReboot "0 4 * * * /sbin/reboot"

I've tried naming the file init-start, init-start.sh, and init-start.startup.

Once copied over, I run the following from the scripts directory, using SSH via PuTTY:
Code:
chmod a+rx init-start (or init-start.sh, or init-start.startup)

Running cru l at that point provides a null response, which I think is as expected. (A reboot should be needed to auto-initialize the script, right?)

If I manually run the script, I get the expected response from cru l:
0 4 * * * /sbin/reboot #ScheduledReboot#
And the router reboots at the specified time.

But after rebooting (at any step), /scripts is always empty.

Could JFFS be getting reformatted every time, despite not being set to do so? I've searched extensively and perhaps I'm making a noob oversight, but I can't imagine what else could be causing this.

Any help would be appreciated. Thanks in advance.
 
Last edited:
Tartarus and RMerlin discussed a similar issue in the 3.0.0.4.246.20 thread:

Tartarus said:
I enabled jffs and set it to be formatted at the next reboot. After rebooting I copied some files to the jffs partition, but upon next reboot the partition was empty (except for the scripts and configs dirs). I made sure that it wasn't still set to format the partition (which it wasn't anymore) and tried rebooting again. Same result. I have now tried a few times, but every time I reboot the jffs partition is cleared.

RMerlin said:
No idea. Try disabling it, rebooting, re-enabling and setting it for formatting, and rebooting twice. After that create a test file, and reboot another time. If your test file is still missing, then something else must be going on with your router.

Tartarus said:
unfortunately it didn't work. Never had that problem with the previous version. When I get the chance I'll try to downgrade and see if the problem still persists.

Disable JFFS/reboot/enable+format JFFS/reboot/reboot also fails for me. Time to try a downgrade and a PM to Tartarus...
 
Issue appears to be resolved following a downgrade to 3.0.0.4.246.19b, then upgrading to 246.20, then upgrading again to the latest firmware, 270.26.
 
Issue appears to be resolved following a downgrade to 3.0.0.4.246.19b, then upgrading to 246.20, then upgrading again to the latest firmware, 270.26.

This happen to me today with RT-AC66U, I checked "Format JFFS partition at next boot" and after every reboot jffs partition was empty, the only way was to downgrade to 3.0.0.4.246.19 and flash latest version again.
 
This happen to me today with RT-AC66U, I checked "Format JFFS partition at next boot" and after every reboot jffs partition was empty, the only way was to downgrade to 3.0.0.4.246.19 and flash latest version again.

It might be a bug similar to what affected the Per IP database - the format flag gets cleared in memory, but isn't written back to flash. Once you have booted, issue an "nvram commit" and see if it still gets reformatted at next reboot.
 
I don't want to play anymore with jffs, I lost a lot of time allready, maybe another day... :)
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top