What's new

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

YasharF

Regular Contributor
I am running into issues with NVRAM usage on RT-N16 (currently running John's fork, but I think this is a generic issue), and trying to figure out how we can free up more space. The device has a 32K nvram, and my current nvram usage is 29853 bytes (2915 left). I have two devices at two locations, and during the last year I had to do factory setting resets more than two times because while changing settings the router went belly up, probably because of running over the 32k nvram limit.

I have already, added the ddwrt wiki nvram cleanup hack, by adding
Code:
for line in `nvram show  | grep =$ `; do var=${line%*=}; nvram unset $var; done
to scripts/init-start

Questions:
I know there are features that I never intend to use on these devices such as the IPv6, RADIUS, Dual WAN, or on-router VPN server or clients including PPTP. Can I reduce the nvram usage by removing the related settings from the nvram?

I have seen quite a few settings when checking with
Code:
nvram show | grep ipv6
nvram show | grep radius
nvram show | grep vpn
nvram show | grep pptp

So my thought was to go over the list of variables and then use nvram unset to remove the non-applicable ones, however I noticed that the unsetting does not persist when rebooting. I suspect that just adding unset statements to init-start script may not be sufficient to stop the occasional soft-bricks. What are your thoughts? Do you have any suggestions?
 
By the way,
Code:
for line in `nvram show  | grep =$ `; do var=${line%*=}; nvram unset $var; done
doesn't seem to be working in either init-start, firewall-start, services-start, or even post-mount. Any suggestions on how to run it effectively during startup?
 

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