What's new

Solved High nvram usage

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

Out of my control.

Hi RMerlin. First of all, thanks so much for your efforts. Your firmware is amazing!

Anyway, about your answer ... I suspected it! :) (Maybe can you suggest this thing to the developers of original Asus firmware? ;))

But do you know if it's possible to manage custom config files added in jffs (both additions and replacements) with the web GUI? If not natively, maybe adding custom web pages?

Thanks again.
 
For security reason I cannot allow webpages to arbitrarily read/write files from the JFFS partition.
 
I have huge parameters on
wl_maclist, wl_maclist_x, wl0_maclist, wl0_maclist_x, wl1_maclist, wl1_maclist_x
Is there possible also to offload these parameters from nvram like dhcp-host ?
If possible, how to?
 
I have huge parameters on
wl_maclist, wl_maclist_x, wl0_maclist, wl0_maclist_x, wl1_maclist, wl1_maclist_x
Is there possible also to offload these parameters from nvram like dhcp-host ?
If possible, how to?

Not possible.
 
You might try this command - not destructive as far as I know - just clears nvram var lines with = "blank" entries ...
Code:
for line in `nvram show | grep =$ `; do var=${line%*=}; nvram unset $var; done; nvram commit

Has worked for me without issues on AC-5300 and DSL-AC86U
Found this post after searching far/wide ... thank you so much. It worked for me. :)
 
Found this post after searching far/wide ... thank you so much. It worked for me. :)
Welcome to the forum @Twiga10 - glad that helped. NB - I got the line from another coder - so was just passing on the benefit of being a member of these forums ;). Another member added a refinement to the code which is in this post above.
 
Genuine ASUS RT-AC68U (NOT the T-Mobile one) running Merline 396.3.2
Running AMTM with Diversion, Skynet, Scribe, Unbound Manager, NSRUM, scMerlin, uiDivStats, uiScribe, Entware packages, Disk Check Script, Reboot Scheduler

I currently have 39 DHCP reservations:

3 Switches
2 Wired APs
7 MOCA Devices
3 Printers
8 Cameras
1 VOIP Phone
10 VM Host, NAS, two Pi-Holes, Web Server and other VMs
4 My personal devices like Desktop, Laptop, Tablet, Cell Phone also have reservations because access to my Router, VM Host, NAS are restricted to those specific IPs.

The TVs were starting to buffer at night (no other traffic but them).
Check my router but it was becoming very unresponsive in the web interface and SMB does not work from the router (only allows router admin access despite users being set up and me even manually editing my smb.conf file)

So, I did a 30-30-30 reset my router and configured everything from scratch.
(Note: I did not include my OpenVPN stuff *yet* until this testing was complete.)
After all this, I checked and I was still running very low on NVRAM.

So, I backup up my NVRAM, router config and jffs. Then I tried this script and it worked:

#!/bin/sh
logger -t "started - /jffs/scripts/$0"
sleep 1m
for line in `nvram show | grep ^[^=]*=$ `; do var=${line%*=}; nvram unset $var; done; nvram commit

Below is what I am showing now:

size: 54681 bytes (10855 left)
2813 custom_clientlist
1327 dhcp_staticlist
1134 dhcp_hostnames
931 nc_setting_conf
549 rc_support
347 dnsfilter_rulelist
295 vts_rulelist
251 asus_device_list
175 acc_list
164 subnet_rulelist
142 cfg_device_list
131 wl1_chansps
120 qos_rulelist
112 vlan_rulelist
109 restrict_rulelist
92 1:pa5ga2
92 1:pa5ga1
92 1:pa5ga0
89 vpn_server2_ncp_ciphers
89 vpn_server1_ncp_ciphers

Can I just put the above script commands in my post-mount script or do I need to move it to another startup script? If so, then what.

BTW, the Pi-Holes were recently put up and the router definitely seems more responsive..

Hope this gives you enough information.
Should I move all my DHCP to dnsmasq.conf.add ?
Is the RT-AC68U just NVRAM Starved and near EOL ?

I cannot remove any of the equipment mentioned above but am working on getting rid of three NAS's.
Of course, any suggestions would be helpful.
 
Anyone know the purpose of the rc_support variable? I suppose it can't be trimmed?
 
mine nvram usage below :
size: 63716 bytes (1820 left)
931 nc_setting_conf
582 rc_support
500 MULTIFILTER_MACFILTER_DAYTIME_V2
369 webdav_smb_pc
355 vts_rulelist
352 wrs_rulelist
236 custom_clientlist
180 wrs_app_rulelist
179 url_rulelist
164 subnet_rulelist
155 qos_rulelist
135 fb_email_dbg
131 wl1_chansps
129 vpn_client_cust2
112 vlan_rulelist
92 1:pa5ga2
92 1:pa5ga1
92 1:pa5ga0
87 MULTIFILTER_MAC
83 asus_device_list

anybody knows what for is MULTIFILTER_MACFILTER_DAYTIME_V2
I'm thinking to clear this if not useful
 
You might try this command - not destructive as far as I know - just clears nvram var lines with = "blank" entries ...
Code:
for line in `nvram show | grep =$ `; do var=${line%*=}; nvram unset $var; done; nvram commit

Has worked for me without issues on AC-5300 and DSL-AC68U
THX for that! it works perfect! At last until reboot....
Maybe because I have AC1900 modified to AC68U?

[Link to illegal firmware removed by forum moderator. Do not restore.]

[edit]: Sorry for that link, the code below could couse that?

cat /dev/mtd5 > /jffs/mtd5_backup.bin
mkdir /tmp/asus_jffs
mount -t jffs2 /dev/mtdblock5 /tmp/asus_jffs
rm -rf /tmp/asus_jffs/*
sync && umount /tmp/asus_jffs
rm -rf /jffs/.sys/RT-AC68U
nvram unset fw_check && nvram commit && reboot
 
Last edited:
Thanks for this thread.
I continue to have problems with 2x RT-AC68U routers in AiMesh on 386.5_2. I have to reboot them everyday now or they go out of memory with errors like:

Mar 14 12:50:16 dnsmasq[970]: read /etc/hosts - 18 addresses
Mar 14 12:50:16 kernel: dhcpc_lease/7831: potentially unexpected fatal signal 11.
Mar 14 12:50:16 kernel: Pid: 7831, comm: dhcpc_lease
Mar 14 12:50:16 kernel: CPU: 1 Tainted: P (2.6.36.4brcmarm #1)
Mar 14 12:50:16 kernel: PC is at 0x40621b00
Mar 14 12:50:16 kernel: LR is at 0x6e694c3a
Mar 14 12:50:16 kernel: pc : [<40621b00>] lr : [<6e694c3a>] psr: 20000010
Mar 14 12:50:16 kernel: sp : bea3daa4 ip : 322e312e fp : 00000000
Mar 14 12:50:16 kernel: r10: 00195940 r9 : 00000002 r8 : 001951cc
Mar 14 12:50:16 kernel: r7 : 00195f58 r6 : 404f1780 r5 : 0000002d r4 : 382d6463
Mar 14 12:50:16 kernel: r3 : 70636864 r2 : 0000000d r1 : 00195f68 r0 : 00000000
Mar 14 12:50:16 kernel: Flags: nzCv IRQs on FIQs on Mode USER_32 ISA ARM Segment user
Mar 14 12:50:16 kernel: Control: 10c53c7d Table: 074ac04a DAC: 00000015
Mar 14 12:50:16 dnsmasq[970]: script process killed by signal 11

Results of commands:

admin@RT-AC68U-MAIN:/tmp/home/root# for line in `nvram show | grep ^[^=]*=$ `; do var=${line%*=}; nvram unset $var; done; nvram commit
size: 57099 bytes (8437 left)

admin@RT-AC68U-MAIN:/tmp/home/root# nvram show | awk '{print length(), $0 | "sort -n -r"}' | cut -d"=" -f 1 | head -n 20
size: 46974 bytes (18562 left)
931 nc_setting_conf
573 rc_support
571 dhcp_staticlist
164 subnet_rulelist
153 asus_device_list
131 wl1_chansps
129 wps_env_buf
128 vpn_serverx_clientlist
120 qos_rulelist
112 vlan_rulelist
98 cfg_device_list
92 1:pa5ga2
92 1:pa5ga1
92 1:pa5ga0
89 vpn_server2_ncp_ciphers
89 vpn_server1_ncp_ciphers
89 vpn_client5_ncp_ciphers
89 vpn_client4_ncp_ciphers
89 vpn_client3_ncp_ciphers
89 vpn_client2_ncp_ciphers

I noticed in this thread there's a recommendation on killing out old ciphers, so I ran that and clicked "Default" on each, although I've never used OpenVPN clients..

admin@RT-AC68U-MAIN:/tmp/home/root# ./clear_unused_certs.sh
Removing unused cert/key from nvram...
done.
admin@RT-AC68U-MAIN:/tmp/home/root#

admin@RT-AC68U-MAIN:/tmp/home/root# nvram show | awk '{print length(), $0 | "sort -n -r"}' | cut -d"=" -f 1 | head -n 20
size: 47827 bytes (17709 left)
931 nc_setting_conf
573 rc_support
571 dhcp_staticlist
164 subnet_rulelist
153 asus_device_list
131 wl1_chansps
129 wps_env_buf
128 vpn_serverx_clientlist
120 qos_rulelist
112 vlan_rulelist
98 cfg_device_list
92 1:pa5ga2
92 1:pa5ga1
92 1:pa5ga0
89 vpn_server2_ncp_ciphers
89 vpn_server1_ncp_ciphers
89 vpn_client5_ncp_ciphers
89 vpn_client4_ncp_ciphers
89 vpn_client3_ncp_ciphers
89 vpn_client2_ncp_ciphers

Somehow it went up lol.. I do have about 10 static DHCP IPs, so maybe related. I will run the commands again when it gets messed up to see what is taking the space..
 
Oh I found the very nice script in here which did help. There was 5 VPN clients in there, which it removed.

admin@RT-AC68U-MAIN:/tmp/home/root# ./CleanupNVRAMvars.sh
NVRAM size: 45373 bytes (20163 left)
==================================================
NVRAM variables [vpn_crt_client.*] NOT FOUND.
NVRAM variables [vpn_crt_server.*] NOT FOUND.
NVRAM variables [sshd_.*.key=.*] NOT FOUND.
NVRAM variables [vpn_client5_.*] NOT FOUND.
NVRAM variables [vpn_client4_.*] NOT FOUND.
NVRAM variables [vpn_client3_.*] NOT FOUND.
==================================================
NVRAM size: 45373 bytes (20163 left)
NOTHING to commit.
admin@RT-AC68U-MAIN:/tmp/home/root# nvram show | awk '{print length(), $0 | "sort -n -r"}' | cut -d"=" -f 1 | head -n 20
size: 45373 bytes (20163 left)
931 nc_setting_conf
573 rc_support
571 dhcp_staticlist
164 subnet_rulelist
153 asus_device_list
131 wl1_chansps
129 wps_env_buf
128 vpn_serverx_clientlist
120 qos_rulelist
112 vlan_rulelist
98 cfg_device_list
92 1:pa5ga2
92 1:pa5ga1
92 1:pa5ga0
89 vpn_server2_ncp_ciphers
89 vpn_server1_ncp_ciphers
89 vpn_client2_ncp_ciphers
89 vpn_client1_ncp_ciphers
88 vpn_server_ncp_ciphers
88 vpn_client_ncp_ciphers

But probably the DHCP is taking it up.
 
@automaton This thread is discussing nvram issues. When you posted about your problem over a year ago here and here you said it was a memory problem. nvram and memory are two different things.
 
@automaton This thread is discussing nvram issues. When you posted about your problem over a year ago here and here you said it was a memory problem. nvram and memory are two different things.

Yes you're right, thank you.

However this case is a little different, and the error is coming from inability for DHCP to allocate and NVRAM is full (when I check). At least, in the case that's been happening more frequently the last couple of months.
 
However this case is a little different, and the error is coming from inability for DHCP to allocate and NVRAM is full (when I check). At least, in the case that's been happening more frequently the last couple of months.
DHCP doesn't use NVRAM, it uses memory.
 

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