What's new

How to clear specific NVRAM entries?

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

therealjoeblow

New Around Here
I have a RT-AC68U running Merlin 386.10.

When checking the NVRAM consumption with
Code:
nvram show | awk '{print length(), $0 | "sort -n -r"}' | cut -d"=" -f 1 | head -n 20

I get the following output:

Code:
ASUSWRT-Merlin RT-AC68U 386.10_0 Fri Mar 10 21:21:50 UTC 2023
size: 52294 bytes (13242 left)
1584 custom_clientlist
931 nc_setting_conf
864 client_info_tmp
628 dhcp_staticlist
573 rc_support
264 fb_comment
183 It was not like this when I got it about 2 years ago, and worked fine without ever pegging the processor to 100% until a few months ago with one of the more recent firmware upgrades.
164 subnet_rulelist
158 I have to reboot the router at that time and it will go through the normal for a few days cycle until it pegs processor 1 at 100% again and I have to repeat.
155 oauth_google_access_token
147 At that point the router becomes more and more sluggish and connections to the internet become unreliable, and eventually WiFi will stop working.
131 wl1_chansps
129 wps_env_buf
128 fb_browserInfo
120 qos_rulelist
112 vlan_rulelist
110 qos_bw_rulelist
95 Please fix this so the processor doesn't get pinned to 100% after a few days operation anymore.
92 1:pa5ga2
92 1:pa5ga1

Now I recall some time in the past in an older firmware there was a tool to report issues through the router web interface itself, and I recall I tried that but it never worked for me. But it seems that in lines 183, 158, 147, and 95 it left behind the text strings of my attempted problem report.

I'm hoping to clear these out because my NVRAM is 100% full. I managed to temporarly free up some space by running:

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

...however that only works until the next reboot, when the NVRAM is 100% full again.

Can someone ELI5 it to me how I can clear these text strings and regain some of the NVRAM from them? Please take it easy on me, I'm no unix expert and it took me all week just to figure out how to get into the router using Putty to get that report!

Many thanks!
TRJB
 
Last edited:
I have a RT-AC68U running Merlin 386.10.

When checking the NVRAM consumption with
Code:
nvram show | awk '{print length(), $0 | "sort -n -r"}' | cut -d"=" -f 1 | head -n 20

I get the following output:

Code:
ASUSWRT-Merlin RT-AC68U 386.10_0 Fri Mar 10 21:21:50 UTC 2023
size: 52294 bytes (13242 left)
1584 custom_clientlist
931 nc_setting_conf
864 client_info_tmp
628 dhcp_staticlist
573 rc_support
264 fb_comment
183 It was not like this when I got it about 2 years ago, and worked fine without ever pegging the processor to 100% until a few months ago with one of the more recent firmware upgrades.
164 subnet_rulelist
158 I have to reboot the router at that time and it will go through the normal for a few days cycle until it pegs processor 1 at 100% again and I have to repeat.
155 oauth_google_access_token
147 At that point the router becomes more and more sluggish and connections to the internet become unreliable, and eventually WiFi will stop working.
131 wl1_chansps
129 wps_env_buf
128 fb_browserInfo
120 qos_rulelist
112 vlan_rulelist
110 qos_bw_rulelist
95 Please fix this so the processor doesn't get pinned to 100% after a few days operation anymore.
92 1:pa5ga2
92 1:pa5ga1

Now I recall some time in the past in an older firmware there was a tool to report issues through the router web interface itself, and I recall I tried that but it never worked for me. But it seems that in lines 183, 158, 147, and 95 it left behind the text strings of my attempted problem report.

I'm hoping to clear these out because my NVRAM is 100% full. I managed to temporarly free up some space by running:

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

...however that only works until the next reboot, when the NVRAM is 100% full again.

Can someone ELI5 it to me how I can clear these text strings and regain some of the NVRAM from them? Please take it easy on me, I'm no unix expert and it took me all week just to figure out how to get into the router using Putty to get that report!

Many thanks!
TRJB

This router has known issues with NVRAM usage on 386.9 and 386.10. Your custom client list is pretty big, likely overloading it.

You can try running your cleanup command in a script, may have to toy with which script to run it in, but I'd downgrade to 386.7_2 and wait for the potential "lite" version Merlin is working on.

Did you do a full factory reset after upgrading to 386.10? That can help but with your custom client list size it may not be enough.
 
I have a RT-AC68U running Merlin 386.10.

<snip>

I'm hoping to clear these out because my NVRAM is 100% full.
If one uses the forum search feature they'll find a number of discussions about NVRAM and the RT-AC68U, particularly in the Asus-Merlin subforum since the problem of low NVRAM is generally confined to the later Asus-Merlin firmware on the RT-AC68U and it's 64K NVRAM storage.

The first step, if low NVRAM is an issue, is to perform a hard factory reset then manually configure the router. Do not import a saved router CFG file, manually reconfigure instead. That typically fixes the "low NVRAM" warning some are receiving after updating to the latest Asus-Merlin RT-AC68U firmware. One can then move any manual DHCP IP reservations either using YazDHCP (YazDHCP Github.com) or move them to a separate file (dnsmasq.conf.add) to free up a little bit of NVRAM space. From there one can try the various script and code executions to attempt to lower the NVRAM value a little bit more. Standard warning! Some of the scripts/code suggestions that follow may affect router operation or cause unexpected router performance. You use the various suggestions indicated in the following links at your own risk!!! See following links:
https://www.snbforums.com/threads/asus-rt-ac68u-386-2_6-low-on-free-nvram.73158/#post-695283
https://www.snbforums.com/threads/solved-high-nvram-usage.56848/#post-494736
Example code command from solved high nvram usage link:
for line in `nvram show | grep ^[^=]*=$ `; do var=${line%*=}; nvram unset $var; done; nvram commit
https://www.snbforums.com/threads/3...lable-build-s-for-ac-models.83565/post-824457
https://www.snbforums.com/threads/r...stnames-from-nvram-to-jffs.63886/#post-817090
Another discussion with some links to deal with NVRAM issues in this thread:
https://www.snbforums.com/threads/d...om-rt-ac68u-to-reduce-high-nvram-usage.84015/

As you discovered some of the other methods (scripting and code execution) of trying to free up some NVRAM space typically do not survive reboot. It's a known issue mentioned in various other discussions on NVRAM and the RT-AC68U. Simply put, if you reboot, take a minute or two to run some of the extra coding if low NVRAM is an issue after reboot.

RMerlin explains the reason/cause of the low NVRAM on the RT-AC68U here, here, here and here. RMerlin has indicated they are reviewing possible changes to their the RT-AC68U firmware to see what can be or should be done, what can be removed from the Asus-Merlin RT-AC68U firmware, to potentially address the low NVRAM issue. One possible change mention is potentially reducing the OpenVPN clients from 5 to 2 in future versions of the Asus-Merlin firmware to free up a little bit of NVRAM.

One can find the NVRAM usage in the Asus-Merlin GUI by selecting the Tools menu link. The NVRAM Storage value is indicated under Internal Storage. Here is an example of the NVRAM value on a RT-AC68U after performing some of the scripts/code mention or linked to in my post.
Example_RT-AC68U_NVRAM_Value.jpg

As a reminder after a reboot the NVRAM usage value is typically higher; in my case usually around 59295 / 65536. So if I want the lower value again, I have to rerun the various scripts/code previously mentioned to get it back down to the 48000 range.
 
Last edited:
Thanks but neither of those replies answered my questions. I have read the dozens of threads on this forum that were referenced in the replies already. I completely understand the NVRAM issues and limitations of the RT-AC68U after reading this forum extensively for a week.

My question was specifically: "How can I clear the text strings in lines 183, 158, 147, and 95".

Thanks again to anyone who can help with this.
TRJB
 
My question was specifically: "How can I clear the text strings in lines 183, 158, 147, and 95".

183, 158, 147, and 95 are not line numbers, they're meant to be the length of the contents of the variable named. Unfortunately this output highlights the failure of the "nvram show" method to accurately report such information. It cannot process variables that contain embedded line feeds. These variables tend to be the worst offenders of nvram usage and are mostly undetected using this method.

To answer your specific question, run the following code to clear out the old feedback information and reboot the router:
Code:
nvram unset fb_attach_syslog
nvram unset fb_attach_cfgfile
nvram unset fb_attach_modemlog
nvram unset fb_attach_wlanlog
nvram unset fb_country
nvram unset fb_email
nvram unset fb_contact_type
nvram unset fb_phone
nvram unset fb_ptype
nvram unset fb_pdesc
nvram unset fb_when_occur
nvram unset fb_which_band
nvram unset fb_unstable_conn
nvram unset fb_serviceno
nvram unset fb_tech_account
nvram unset fb_email_provider
nvram unset fb_comment
nvram unset fb_email_dbg
nvram unset fb_state
nvram unset fb_browserInfo
nvram unset fb_transid
nvram unset fb_feedbackcount
nvram unset fb_total_size
nvram unset fb_split_files
nvram unset fb_req_cnt

nvram unset fb_experience
nvram unset fb_ISP
nvram unset fb_Subscribed_Info
nvram unset fb_attach_iptables
nvram unset fb_availability

nvram commit
reboot
 
Last edited:
183, 158, 147, and 95 are not line numbers, they're meant to be the length of the contents of the variable named. Unfortunately this output highlights the failure the "nvram show" method to accurately report such information. It cannot process variables that contain embedded line feeds. These variables tend to be the worst offenders of nvram usage and are mostly undetected using this method.

To answer your specific question, run the following code to clear out the old feedback information and reboot the router:
Code:
nvram unset fb_attach_syslog
nvram unset fb_attach_cfgfile
nvram unset fb_attach_modemlog
nvram unset fb_attach_wlanlog
nvram unset fb_country
nvram unset fb_email
nvram unset fb_contact_type
nvram unset fb_phone
nvram unset fb_ptype
nvram unset fb_pdesc
nvram unset fb_when_occur
nvram unset fb_which_band
nvram unset fb_unstable_conn
nvram unset fb_serviceno
nvram unset fb_tech_account
nvram unset fb_email_provider
nvram unset fb_comment
nvram unset fb_email_dbg
nvram unset fb_state
nvram unset fb_browserInfo
nvram unset fb_transid
nvram unset fb_feedbackcount
nvram unset fb_total_size
nvram unset fb_split_files
nvram unset fb_req_cnt

nvram unset fb_experience
nvram unset fb_ISP
nvram unset fb_Subscribed_Info
nvram unset fb_attach_iptables
nvram unset fb_availability

nvram commit
reboot
Thank you, I did that, it did not clear the text out though :-(


Code:
size: 60092 bytes (5444 left)
1584 custom_clientlist
931 nc_setting_conf
864 client_info_tmp
628 dhcp_staticlist
573 rc_support
264 fb_comment
183 It was not like this when I got it about 2 years ago, and worked fine without ever pegging the processor to 100% until a few months ago with one of the more recent firmware upgrades.
164 subnet_rulelist
158 I have to reboot the router at that time and it will go through the normal for a few days cycle until it pegs processor 1 at 100% again and I have to repeat.
155 oauth_google_access_token
147 At that point the router becomes more and more sluggish and connections to the internet become unreliable, and eventually WiFi will stop working.
131 wl1_chansps
129 wps_env_buf
120 qos_rulelist
112 vlan_rulelist
110 qos_bw_rulelist
95 Please fix this so the processor doesn't get pinned to 100% after a few days operation anymore.
92 1:pa5ga2
92 1:pa5ga1
92 1:pa5ga0

I entered each line individually at the Putty command prompt, one by one. Was that not the right way to do that?

Thanks
TRJB
 
Thanks but neither of those replies answered my questions. I have read the dozens of threads on this forum that were referenced in the replies already. I completely understand the NVRAM issues and limitations of the RT-AC68U after reading this forum extensively for a week.
Have you tried a hard factory reset or not? If you haven't, try it and see if it clears the NVRAM issue you are asking about after you do the initial manual configuration post hard factory reset. Sometimes a hard factory reset is the best (and fastest) way to deal with weird issues these routers sometimes experience. Particularly if one is having trouble manually removing or clearing specific entries in NVRAM.

Edit to add: Another option is to dump the NVRAM to a text file then review the text file to see if that text you are asking about is tied to a specific NVRAM entry. If so one may then may be able to see about clearing the specific NVRAM value containing that erroneous text. One can copy the txt file from the router to their local PC for easier review. Programs like WinSCP help making copying files from the router a drag and drop affair.
https://www.snbforums.com/threads/approved-ways-to-free-up-nvram-space.27591/#post-210961
Code:
nvram show > /tmp/nvram.txt
more /tmp/nvram.txt
 
Last edited:
Thanks everyone, ColinTaylor helped me clear those odd entries.

The solution was to use the GUI option (Administration - Restore/Save/Upload Setting) to "Save setting". Then click on the option to Factory default - Restore (do not check the "initialize" box). After the router rebooted and back at the quick setup screen... Enter the minimum amount of information (user, password SSID) to get back into the router's main GUI. Once there go back to Administration - Restore/Save/Upload Setting and reload the old saved settings.

After that I was able to successfully run the sequence of "nvram unset" commands that he posted above which cleared out those orphaned feedback text strings and freed up a bunch of ram to get my router running stabily again.

Cheers
TRJB
 
Thanks everyone, ColinTaylor helped me clear those odd entries.

The solution was to use the GUI option (Administration - Restore/Save/Upload Setting) to "Save setting". Then click on the option to Factory default - Restore (do not check the "initialize" box). After the router rebooted and back at the quick setup screen... Enter the minimum amount of information (user, password SSID) to get back into the router's main GUI. Once there go back to Administration - Restore/Save/Upload Setting and reload the old saved settings.

After that I was able to successfully run the sequence of "nvram unset" commands that he posted above which cleared out those orphaned feedback text strings and freed up a bunch of ram to get my router running stabily again.

Cheers
TRJB

Those old entries would have been cleaned up by a reset too. Who knows what other things are lurking in there. When was the last time you did a full WPS factory reset and reconfigured by hand? Pretty much a requirement when you try to put 386.9 or .10 on the 68U, and before that anytime you upgraded to a new code base (like 384 to 386).

The solution was posted in the first 2 replies but you ignored and said they didn't answer your question.....
 

Latest threads

Sign Up For SNBForums Daily Digest

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