What's new

NVRAM [Release] NVRAM Save/Restore Utility

  • 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!

Status
Not open for further replies.
I want to try to install unbound again. I'm thinking that my previous problems with the router config going south was due to heat, so I installed a couple of fans to the back of my ac86c. That has lowered my cpu temp by 20C. As of now, my router has been working great without unbound for the past 2 weeks even before I added the fans. So before doing the unbound installation, I was thinking I'd do an nsrum run to save my current stable working config. Before I do that, I will power-cycle the router, wait 15 min, do nsrum, save the files safely away, then do the unbound install. But if something happens and I still have problems, can I use the nsrum files to get me completely back to where I was before I did that installation, including all the addon scripts, their settings, their cron settings, etc? Or would I still need to do a nuclear reset and start yet again using the nsrum files but doing a reinstall of all scripts? I guess I'm asking if doing nsrum is the same as doing an image save of the router configuration (minus the password and a few other details)?

BTW, nsrum works great for restoring nvram after I do a nuclear reset, so thanks for that.
 
I want to try to install unbound again. I'm thinking that my previous problems with the router config going south was due to heat, so I installed a couple of fans to the back of my ac86c. That has lowered my cpu temp by 20C. As of now, my router has been working great without unbound for the past 2 weeks even before I added the fans. So before doing the unbound installation, I was thinking I'd do an nsrum run to save my current stable working config. Before I do that, I will power-cycle the router, wait 15 min, do nsrum, save the files safely away, then do the unbound install. But if something happens and I still have problems, can I use the nsrum files to get me completely back to where I was before I did that installation, including all the addon scripts, their settings, their cron settings, etc? Or would I still need to do a nuclear reset and start yet again using the nsrum files but doing a reinstall of all scripts? I guess I'm asking if doing nsrum is the same as doing an image save of the router configuration (minus the password and a few other details)?

BTW, nsrum works great for restoring nvram after I do a nuclear reset, so thanks for that.
Unbound has an uninstall option that is available as well.

For the AC86U and the newer routers with HND CPUs, you will have to restore using both the nvram-restore.sh and jffs-restore.sh scripts to fully recover. This is because some nvram vars are stored in the /jffs/nvram folder on these models.

If you want to test for yourself before making the unbound change, and give yourself some degree of comfort, I recommend you use the utilities in the firmware System Administration utility to take a backup of jffs and config. Then, do the same using the NVRAM Save/Restore Utility. For the next step, perform a factory reset. Then, restore using the nvram-restore.sh and jffs-restore.sh scripts. If you are happy with the results, then you can proceed with the unbound install.

I used the original version of NVRAM Save/Restore Utility to perform numerous restores of settings after a firmware update. I've also done the same in testing the new version. Using the config backup feature in the firwmare is not recommended though when migrating from one firmware version to another. So far, I've experienced no issues. However, Murphy can always show up. I have screen prints saved for key settings though.
 
Hello,

using the tool recently (on an Asus AC68U), I noticed it does apparently not save the custom vpn client settings.
Those are stored in five nvram variables:

vpn_client1_custom
vpn_client2_custom
..
vpn_client5_custom

Is there any good reason why they are not included in the variables at all?

Many thanks
Andi
 
Hello,

using the tool recently (on an Asus AC68U), I noticed it does apparently not save the custom vpn client settings.
Those are stored in five nvram variables:

vpn_client1_custom
vpn_client2_custom
..
vpn_client5_custom

Is there any good reason why they are not included in the variables at all?

Many thanks
Andi
I'm looking into it now. I've seen those references before. But they don't appear when I do the "nvram show | grep _custom" command. I am currently on 384.19 on a AC88U. What firmware version are you on?

UPDATE
I checked the the code that defines the nvram parms and don't see them listed. So, I think they got removed at some point. Until I can confirm, you can edit the file nvram-merlin.ini and add them. There is a section for each vpn client:

Code:
[VPN Client 1]
vpn_client1_addr
vpn_client1_adns
<snip>

The nvram-merlin.ini file was meant to be customized.
 
Last edited:
I am using latest John's Fork Firmware:374.43_44EAj9527 on my AC68U.

And I definitely have these variables when I do an "nvram show", and they have the content which I put in on the Open VPN Client configuration page at the very bottom (custom) - see screenshot.
Maybe the variables only show up when something is filled into that section, dont know.

Adding them helps, so they may be AC68U specific in some way, but think it would be good to add them to the repo for a next version.

Andi

custom_config.JPG custom_config_2.JPG
 
I am using latest John's Fork Firmware:374.43_44EAj9527 on my AC68U.

And I definitely have these variables when I do an "nvram show", and they have the content which I put in on the Open VPN Client configuration page at the very bottom (custom) - see screenshot.
Maybe the variables only show up when something is filled into that section, dont know.

Adding them helps, so they may be AC68U specific in some way, but think it would be good to add them to the repo for a next version.

Andi

View attachment 27294 View attachment 27295
Thanks for the update. That makes sense now. I'll review the nvram vars in John's Fork and add any that are missing to the nvram-merlin.ini file.
 
Last edited:
Has anyone else reported that sometimes the script does not complete? I have a cron job that runs this script daily at 3:01am. When it works, it takes about 52 secs to complete but occasionally it stops at about 2 secs. I previously reported this issue but it is still happening. How can I determine what router process is causing this script to terminate early?

Here is an example of it completing correctly:

Oct 30 03:01:00 RT-AC86U-1BD0 backupRouterConfig: Started
Oct 30 03:01:02 RT-AC86U-1BD0 nvram-save.sh: NVRAM User Save Utility - Version 30.3 POSIX Code Updates
Oct 30 03:01:02 RT-AC86U-1BD0 nvram-save.sh: NVRAM User Save Utility - Version 30.1 Martineau Hacked for v384.xx+!!
Oct 30 03:01:02 RT-AC86U-1BD0 nvram-save.sh: Saving RT-AC86U settings from firmware 384.19_0
Oct 30 03:01:02 RT-AC86U-1BD0 nvram-save.sh: Runtime options: -b
Oct 30 03:01:02 RT-AC86U-1BD0 nvram-save.sh: Using standard NVRAM variable file: nvram-merlin.ini Version=30.3.0
Oct 30 03:01:02 RT-AC86U-1BD0 nvram-save.sh: Running in Backup Mode
Oct 30 03:01:43 RT-AC86U-1BD0 nvram-save.sh: Complete: User NVRAM saved to /tmp/mnt/data/nsru/backup/nvram-restore-202010300301_RT-AC86U-1BD0.sh
Oct 30 03:01:44 RT-AC86U-1BD0 nvram-save.sh: Complete: JFFS directory saved to /tmp/mnt/data/nsru/backup/jffs-202010300301_RT-AC86U-1BD0
Oct 30 03:01:49 RT-AC86U-1BD0 backupRouterConfig: Finished 202010300301
Oct 30 03:01:52 RT-AC86U-1BD0 backupRouterConfig: Deleting /tmp/mnt/data/nsru/archive/backup.RT-AC86U-1BD0.202010220301
Oct 30 04:00:00 RT-AC86U-1BD0 rc_service: service 1802:notify_rc restart_httpd

Here is an example of it ending early:

Oct 31 03:01:00 RT-AC86U-1BD0 backupRouterConfig: NTP Test Completed - Loop Value= 0
Oct 31 03:01:00 RT-AC86U-1BD0 backupRouterConfig: Started
Oct 31 03:01:02 RT-AC86U-1BD0 nvram-save.sh: NVRAM User Save Utility - Version 30.3 POSIX Code Updates
Oct 31 03:01:02 RT-AC86U-1BD0 nvram-save.sh: NVRAM User Save Utility - Version 30.1 Martineau Hacked for v384.xx+!!
Oct 31 03:01:02 RT-AC86U-1BD0 nvram-save.sh: Saving RT-AC86U settings from firmware 384.19_0
Oct 31 03:01:02 RT-AC86U-1BD0 nvram-save.sh: Runtime options: -b
Oct 31 03:01:02 RT-AC86U-1BD0 nvram-save.sh: Using standard NVRAM variable file: nvram-merlin.ini Version=30.3.0
Oct 31 03:01:02 RT-AC86U-1BD0 nvram-save.sh: Running in Backup Mode
Oct 31 03:54:45 RT-AC86U-1BD0 kernel: br0: port 4(eth4) neighbor 8000.4c:82:cf:de:79:7e lost
 
Has anyone else reported that sometimes the script does not complete? I have a cron job that runs this script daily at 3:01am. When it works, it takes about 52 secs to complete but occasionally it stops at about 2 secs. I previously reported this issue but it is still happening. How can I determine what router process is causing this script to terminate early?

Here is an example of it completing correctly:

Oct 30 03:01:00 RT-AC86U-1BD0 backupRouterConfig: Started
Oct 30 03:01:02 RT-AC86U-1BD0 nvram-save.sh: NVRAM User Save Utility - Version 30.3 POSIX Code Updates
Oct 30 03:01:02 RT-AC86U-1BD0 nvram-save.sh: NVRAM User Save Utility - Version 30.1 Martineau Hacked for v384.xx+!!
Oct 30 03:01:02 RT-AC86U-1BD0 nvram-save.sh: Saving RT-AC86U settings from firmware 384.19_0
Oct 30 03:01:02 RT-AC86U-1BD0 nvram-save.sh: Runtime options: -b
Oct 30 03:01:02 RT-AC86U-1BD0 nvram-save.sh: Using standard NVRAM variable file: nvram-merlin.ini Version=30.3.0
Oct 30 03:01:02 RT-AC86U-1BD0 nvram-save.sh: Running in Backup Mode
Oct 30 03:01:43 RT-AC86U-1BD0 nvram-save.sh: Complete: User NVRAM saved to /tmp/mnt/data/nsru/backup/nvram-restore-202010300301_RT-AC86U-1BD0.sh
Oct 30 03:01:44 RT-AC86U-1BD0 nvram-save.sh: Complete: JFFS directory saved to /tmp/mnt/data/nsru/backup/jffs-202010300301_RT-AC86U-1BD0
Oct 30 03:01:49 RT-AC86U-1BD0 backupRouterConfig: Finished 202010300301
Oct 30 03:01:52 RT-AC86U-1BD0 backupRouterConfig: Deleting /tmp/mnt/data/nsru/archive/backup.RT-AC86U-1BD0.202010220301
Oct 30 04:00:00 RT-AC86U-1BD0 rc_service: service 1802:notify_rc restart_httpd

Here is an example of it ending early:

Oct 31 03:01:00 RT-AC86U-1BD0 backupRouterConfig: NTP Test Completed - Loop Value= 0
Oct 31 03:01:00 RT-AC86U-1BD0 backupRouterConfig: Started
Oct 31 03:01:02 RT-AC86U-1BD0 nvram-save.sh: NVRAM User Save Utility - Version 30.3 POSIX Code Updates
Oct 31 03:01:02 RT-AC86U-1BD0 nvram-save.sh: NVRAM User Save Utility - Version 30.1 Martineau Hacked for v384.xx+!!
Oct 31 03:01:02 RT-AC86U-1BD0 nvram-save.sh: Saving RT-AC86U settings from firmware 384.19_0
Oct 31 03:01:02 RT-AC86U-1BD0 nvram-save.sh: Runtime options: -b
Oct 31 03:01:02 RT-AC86U-1BD0 nvram-save.sh: Using standard NVRAM variable file: nvram-merlin.ini Version=30.3.0
Oct 31 03:01:02 RT-AC86U-1BD0 nvram-save.sh: Running in Backup Mode
Oct 31 03:54:45 RT-AC86U-1BD0 kernel: br0: port 4(eth4) neighbor 8000.4c:82:cf:de:79:7e lost
There is nothing I can do from a programming perspective that I am aware of. I suspect is has to do with the USB such as a write speed issue. I had a USB go bad recently. Before it went bad, similar symptoms would appear. From the system log, the disk was taking too long to mount as the chkdsk utility had issues. For a month or so, I was able to fix the issue by disabling chkdsk and moving it to USB 3.0 port. Then, one day it died.
 
For me, this is a new flash drive.
 
I suspect is has to do with the USB such as a write speed issue. I had a USB go bad recently. Before it went bad, similar symptoms would appear.

Possibly, but maybe there is something else going on?
I only ever run my NVRAM backups manually using your utility and I’ve seen it fail maybe 3-4 times over a year or so of doing them roughly weekly. My drive is a 250GB Samsung EVO860 SSD inside a UGreen SATA-to-USB 3.0 2.5” case, which has been utterly reliable for everything else in terms of scripts and Entware, which is all it gets used for.
So I’m not ruling out it COULD be causing your script to fail occasionally but all the evidence points to the contrary? So for me it’s a minor annoyance, but I just run it again :)

BTW thanks for your script(s) and all your work here, it is much appreciated!
 
@TonyK132 a new flash drive does not mean it is a 'good' flash drive. ;)
 
I noticed in amtm some script updates. Only updating this script did not produce an updated version. It was on 30.3.0
Selecting the no 2 option to update it says with some files: No new version to update - latest is 30.4.0
For some other files it says MD5 hash of <filename> matches - skipping download <same filename>
At the end is says: update completed.
But in amtm is still says that the nvram-save-restore-utility is in version 30.3.0
And starting the nvram-save-restore-utility it also says it's in version 30.3.0.
So: what happened? Is it still in version 30.3.0 ? Or is the new version not recognized.
I do not know.
 
Speaking of nsrum, I decided to do a factory reset-restore of my AX88U after installing 386 Alpha 2.
Before the reset (and running Alpha 2) I used nsrum to backup my nvram variables and (most important) /jffs partition.

Did the WPS hold, power cycle, let the system run for a few minutes. Did some basic setup and enabled SSH, format jffs at next boot and enabled jffs scripts.
Did the reboot. Wait a few minutes.
SSH'd in and ran the nsrum restore scripts.

Held breath and did a power cycle....

All my scripts came to life and jffs was restored 100%

Thanks @Xentrk . Going to the Add-on Developers Donation thread ;-)

I no longer fear the Factory Device Reset~
 
I noticed in amtm some script updates. Only updating this script did not produce an updated version. It was on 30.3.0
Selecting the no 2 option to update it says with some files: No new version to update - latest is 30.4.0
For some other files it says MD5 hash of <filename> matches - skipping download <same filename>
At the end is says: update completed.
But in amtm is still says that the nvram-save-restore-utility is in version 30.3.0
And starting the nvram-save-restore-utility it also says it's in version 30.3.0.
So: what happened? Is it still in version 30.3.0 ? Or is the new version not recognized.
I do not know.
You missed a step, look closely. This from another thread. :)
 
I have an Asus DSL AC 68 U and I get a bad report that the NVRAM is almost saturated. I followed the tutorial for this addons, installed it on usb etc, but then I don't know how to use it to solve the problem
 
I have an Asus DSL AC 68 U and I get a bad report that the NVRAM is almost saturated. I followed the tutorial for this addons, installed it on usb etc, but then I don't know how to use it to solve the problem
The backup utility can't help with reducing NVRAM storage. What is taking up nvram space? DHCP reservations? There is a solution for that one.

Otherwise, I recommend you post in the Asus official or Asuswrt-Merlin thread where others with more knowledge about the issue can help.
 
The backup utility can't help with reducing NVRAM storage. What is taking up nvram space? DHCP reservations? There is a solution for that one.

Otherwise, I recommend you post in the Asus official or Asuswrt-Merlin thread where others with more knowledge about the issue can help.
I have 7 devices connected to the router and 5 geographic locations of openVPN. I'm afraid that going from the official firmware to merlin, some openvpn certificates are left. I didn't do a master reset because I would have too much stuff to configure. I don't know how to fix.
 
For the NVRAM I solved using this scrypt:


for line in `nvram show | grep = $ `; do var = $ {line% * =}; nvram unset $ var; done; nvram commit


Now the alert is gone. However I didn't understand how to use this addon. I'll use the 'search' option of the forum
 
Status
Not open for further replies.

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