How to Erase NVRAM

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2  Next
Author Message
awm34x
DD-WRT User


Joined: 13 Jan 2018
Posts: 98
Location: Sarasota

PostPosted: Fri Jan 19, 2018 16:16    Post subject: How to Erase NVRAM Reply with quote
Is it as simple as entering the command in the Administration/Management/Commands Command Shell?
Sponsor
Vaako
DD-WRT User


Joined: 10 Jun 2009
Posts: 313

PostPosted: Fri Jan 19, 2018 16:55    Post subject: Reply with quote
Yes it is that simple.

command = erase nvram

Than send command reboot.

_________________
Regards,
Vaako

1x Netgear R7800 Nighthawk - firmware not decided yet !!!!
1x Netgear R7000 Nighthawk r36410
1x Ubiquiti RouterStation Pro DD-WRT r23204 std (12/24/13)
1x Asus RT-N16 SVN revision 20675 NEWD-2 K2.6
1x Linksys E4200 v3.0 r34777 mega (01/31/18 )
1x Buffalo WZR-HP-G300NH B0 B0 Gargoyle FW
1x Linksys WRT600N v1.1 (Bricked)
1x Linksys WRT54GL v1.1 (DD-WRT 26446)
1x Linksys WRT54GS v2.2 (DD-WRT 26446)
1x Linksys RVS4000 (stock fw)
3x D-Link DWL-7100AP (openWRT)
2x TP-Link TL-WA801ND (Bridge mode) 100mW TX-Power
Asus WL-520GU SVN 16403M NEWD-2 Eko std-nokaid
4x Fonera with Gargoyle FW
labo
DD-WRT Guru


Joined: 30 Jan 2015
Posts: 673
Location: Texas, USA

PostPosted: Fri Jan 19, 2018 16:58    Post subject: Reply with quote
ssh to the router:

nvram erase
nvram commit
reboot

_________________
1 X R7800: Main gateway( r39855M kongat (05/25/19)
1 X RAX120 WAP Bridged
1 X R7800 Mesh
2 X R9000 Mesh
1 X R8000: Repeater bridge
1 X R8500: Client bridge (RB doesn't work on R8500)
barryware
DD-WRT Guru


Joined: 26 Jan 2008
Posts: 13049
Location: Behind The Reset Button

PostPosted: Fri Jan 19, 2018 21:43    Post subject: Reply with quote
labo wrote:
ssh to the router:

nvram erase
nvram commit
reboot

Do NOT issue an nvram commit.

nvram is stored in ram.. When you erase nvram, it clears the flash. Once you do an nvram commit, it writes the nvram that is now in ram (which has not been erased), back to the flash chip.

erase nvram, then reboot.. no commit.

Follow Vaako's instructions.

glad I could help..

_________________
[Moderator Deleted] Shocked
Xeon2k8
DD-WRT Guru


Joined: 11 Feb 2016
Posts: 1324

PostPosted: Sun Jan 21, 2018 12:48    Post subject: Reply with quote
barryware wrote:
labo wrote:
ssh to the router:

nvram erase
nvram commit
reboot

Do NOT issue an nvram commit.

nvram is stored in ram.. When you erase nvram, it clears the flash. Once you do an nvram commit, it writes the nvram that is now in ram (which has not been erased), back to the flash chip.

erase nvram, then reboot.. no commit.

Follow Vaako's instructions.

glad I could help..

I second this.

That's completely wrong. The command is

erase nvram && reboot

It will automatically reboot afterwards.

_________________
R6400v2 (boardID:30) - Kong 36480 running since 03/09/18 - (AP - DNSMasq - AdBlocking - QoS)
R7800 - BS 31924 running since 05/26/17 - (AP - OpenVPN Client - DNSMasq - AdBlocking - QoS)
R7000 - BS 30771 running since 12/16/16 - (AP - NAS - FTP - SMB - OpenVPN Server - Transmission - DDNS - DNSMasq - AdBlocking - QoS)
R6250 - BS 29193 running since 03/20/16 - (AP - NAS - FTP - SMB - DNSMasq - AdBlocking)
barryware
DD-WRT Guru


Joined: 26 Jan 2008
Posts: 13049
Location: Behind The Reset Button

PostPosted: Sun Jan 21, 2018 16:43    Post subject: Reply with quote
Xeon2k8 wrote:
barryware wrote:
ssh to the router:

nvram erase
nvram commit
reboot

Do NOT issue an nvram commit.

nvram is stored in ram.. When you erase nvram, it clears the flash. Once you do an nvram commit, it writes the nvram that is now in ram (which has not been erased), back to the flash chip.

erase nvram, then reboot.. no commit.

Follow Vaako's instructions.

glad I could help..


I re-read my post.. It is not wrong but I can see where it could be misinterpreted.

Nvram is on the flash chip.. It gets read and moved to ram when the router boots.

Just like your PC "shadowing" the bios and cmos. The PC bios is stored on a flash chip but when the PC boots, it is read and moved to ram. Then the PC uses the ram to fetch instructions and settings, not the bios chip.

So.. when you erase nvram in your router, it does just that.. Erases the nvram partition on the flash chip.. However at this point, all your settings are still in ram.

When you "commit", you are writing the settings that are still in ram to the flash chip so except for a few settings that may not be in ram, you are writing everything back to the flash.

Think about the "save" command in the gui, then the "apply" command.

Save writes to the nvram partition, apply reads and initializes the parameter.. Depending on what setting you save, when you hit apply, the router may completely reboot.

You can easily test this..

Traff Data.. If you reboot your router before traff data is written to flash (nvram), todays traff data is gone.

If you do a commit before you reboot, once rebooted todays traff data is present.

Traff Data gets written everyday around midnight so if you reboot lets say at noon without committing, 12 hours of traff data will be missing.

_________________
[Moderator Deleted] Shocked
mauikc3
DD-WRT Novice


Joined: 22 Jan 2019
Posts: 1

PostPosted: Tue Jan 22, 2019 8:25    Post subject: CLI via putty Reply with quote
Hello, I'm extremely novice at this and am wondering when you say "SSH to router", how do you do this? Specifically, I don't know what the Host Name or IP address should be when I open a session in putty.

Please help!
Thank you in advance.. Laughing
Xeon2k8
DD-WRT Guru


Joined: 11 Feb 2016
Posts: 1324

PostPosted: Tue Jan 22, 2019 8:50    Post subject: Reply with quote
That's a different topic. You can find that anywhere on the Internet.
_________________
R6400v2 (boardID:30) - Kong 36480 running since 03/09/18 - (AP - DNSMasq - AdBlocking - QoS)
R7800 - BS 31924 running since 05/26/17 - (AP - OpenVPN Client - DNSMasq - AdBlocking - QoS)
R7000 - BS 30771 running since 12/16/16 - (AP - NAS - FTP - SMB - OpenVPN Server - Transmission - DDNS - DNSMasq - AdBlocking - QoS)
R6250 - BS 29193 running since 03/20/16 - (AP - NAS - FTP - SMB - DNSMasq - AdBlocking)
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 2882
Location: UK, London, just across the river..

PostPosted: Tue Jan 22, 2019 9:55    Post subject: Reply with quote
just to give a notice the new command on the recent builds is reverted to

nvram erase
reboot

_________________
Atheros
TP-Link WR740Nv1 ------DD-WRT 33772 BS WAP/Switch (wired)
TP-Link WR1043NDv2 -----DD-WRT 41074 BS (AP,PPPoE,NAT,AD Blocking,AP Isolation,Firewall,Local DNS,Forced DNS,DoT)
TP-Link WR1043NDv2 -----DD-WRT 41321 BS (AP,NAT,AD Blocking,Firewall,Wi-Fi OFF,Local DNS,Forced DNS,DoT)
TP-Link WR1043NDv2 -----Gargoyle OS 1.11.0 (AP,NAT,QoS,Quotas)
Qualcomm/IPQ8065
Netgear R7800 ---------DD-WRT 40270M 4.9 Kong (AP,NAT,AD-Blocking,AP&Net Isolation,Firewall,Local DNS,DNSCrypt v2 x2)
Broadcom
Netgear R7000 ---------DD-WRT 40270M Kong (AP,NAT,VLAN,AD-Blocking,Firewall,Local DNS,Forced DNS,DoT)
------------------------------------------------------------------------------------------------
Stubby for DNS over TLS I DNSCrypt v2 via Entware by mac913
Xeon2k8
DD-WRT Guru


Joined: 11 Feb 2016
Posts: 1324

PostPosted: Tue Jan 22, 2019 10:31    Post subject: Reply with quote
Alozaros wrote:
just to give a notice the new command on the recent builds is reverted to

nvram erase
reboot

Ah thanks m8, I lost track of when they were going to do the change

_________________
R6400v2 (boardID:30) - Kong 36480 running since 03/09/18 - (AP - DNSMasq - AdBlocking - QoS)
R7800 - BS 31924 running since 05/26/17 - (AP - OpenVPN Client - DNSMasq - AdBlocking - QoS)
R7000 - BS 30771 running since 12/16/16 - (AP - NAS - FTP - SMB - OpenVPN Server - Transmission - DDNS - DNSMasq - AdBlocking - QoS)
R6250 - BS 29193 running since 03/20/16 - (AP - NAS - FTP - SMB - DNSMasq - AdBlocking)
Dr_K
DD-WRT User


Joined: 23 Mar 2018
Posts: 437

PostPosted: Tue Jan 22, 2019 15:56    Post subject: Re: How to Erase NVRAM Reply with quote
awm34x wrote:
Is it as simple as entering the command in the Administration/Management/Commands Command Shell?

Unbelievable

Most of these response's are either out dated...or plain bad advice

But don't take my word for it....take the words from someone we all trust...

https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1151928&highlight=happy+year#1151928

As far as the bad advice to do it through the webif….Administration/Commands/Command Shell....again don't take my word...

https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1149623&highlight=stupid#1149623


Hope this clears things up

_________________
Location 1
R6300V2- DD-WRT v3.0-r39345M kongac (04-03-19) Gateway
WNDR3400v1 DD-WRT.v3.0-r35531_mega-nv64k (03/26/18 ) Access Point
WRT160Nv3 DD-WRT ?v3?.0-r35531 mini (03/26/18 ) Access Point
WRT54GSv5 DD-WRT v24-r33555_micro_generic (10/20/17) Repeater
Location 2
R6300V2- DD-WRT v3.0-r39345M kongac (04/03/19) Gateway
R6300V2- DD-WRT v3.0-r39345M kongac (04/03/19) Access Point
WNDR3700v2 DD-WRT v3.0-r35531 std (03/26/18 ) Access Point
E1200 v2 DD-WRT v3.0-r35531 mega-nv64k (03/26/18 ) Gateway(for trivial reasons)
2 devices: SXT 5 ac (mipsbe) RB 6.45.1 (06/27/19) PTP Bridge (0.8km/0.5mi)tx/rx866.6Mbps-1GbpsLAN

Thank You <Kong> & BrainSlayer for ALL that you do also to everyone here that shares their knowledge
SirDracula
DD-WRT User


Joined: 16 Feb 2007
Posts: 127

PostPosted: Tue Jan 22, 2019 17:15    Post subject: Reply with quote
Or you can follow your router's instructions if you have physical access to the unit, e.g. on a Asus RT-AC68U (and I'm sure other Asus models) you can hold down WPS button while powering the router and it will wipe NVRAM. There are other hardware shortcuts like that, e.g. hold Reset button while powering on and then you can connect to it with a browser to a recovery web server which has a Clear NVRAM link and also lets you upload a firmware file.

But yes, from the command line (ssh or telnet) "nvram erase && reboot" sounds right.
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 2882
Location: UK, London, just across the river..

PostPosted: Thu Jan 24, 2019 0:54    Post subject: Reply with quote
well yep if you want to be entirely sure you can fairly issue: Twisted Evil
erase nvram && nvram erase && reboot

recently somewhere Kong stated that erase nvram still
erases the memory but not the actual nvram and the new command for it is

nvram erase

_________________
Atheros
TP-Link WR740Nv1 ------DD-WRT 33772 BS WAP/Switch (wired)
TP-Link WR1043NDv2 -----DD-WRT 41074 BS (AP,PPPoE,NAT,AD Blocking,AP Isolation,Firewall,Local DNS,Forced DNS,DoT)
TP-Link WR1043NDv2 -----DD-WRT 41321 BS (AP,NAT,AD Blocking,Firewall,Wi-Fi OFF,Local DNS,Forced DNS,DoT)
TP-Link WR1043NDv2 -----Gargoyle OS 1.11.0 (AP,NAT,QoS,Quotas)
Qualcomm/IPQ8065
Netgear R7800 ---------DD-WRT 40270M 4.9 Kong (AP,NAT,AD-Blocking,AP&Net Isolation,Firewall,Local DNS,DNSCrypt v2 x2)
Broadcom
Netgear R7000 ---------DD-WRT 40270M Kong (AP,NAT,VLAN,AD-Blocking,Firewall,Local DNS,Forced DNS,DoT)
------------------------------------------------------------------------------------------------
Stubby for DNS over TLS I DNSCrypt v2 via Entware by mac913
buddee
DD-WRT Guru


Joined: 06 Feb 2010
Posts: 7401
Location: Little Rock

PostPosted: Thu Jan 24, 2019 3:36    Post subject: Reply with quote
Some while back, I would have done an 'erase nvram && reboot'


Nowadays, I do 'nvram clear && reboot' it appears to be more forgiving as some units could possibly give problems with an erasure.
Dr_K
DD-WRT User


Joined: 23 Mar 2018
Posts: 437

PostPosted: Thu Jan 24, 2019 5:15    Post subject: Reply with quote
Alozaros wrote:
well yep if you want to be entirely sure you can fairly issue: Twisted Evil
erase nvram && nvram erase && reboot

recently somewhere Kong stated that erase nvram still
erases the memory but not the actual nvram and the new command for it is

nvram erase

Did you at least look at the first link I just posted??

If you did....read it again....that really is not what he said

It may also be seen as foolish to advice someone to issue multiple commands, that you are uncertain of their resaults or what they are doing¯\_(ツ)_/¯

_________________
Location 1
R6300V2- DD-WRT v3.0-r39345M kongac (04-03-19) Gateway
WNDR3400v1 DD-WRT.v3.0-r35531_mega-nv64k (03/26/18 ) Access Point
WRT160Nv3 DD-WRT ?v3?.0-r35531 mini (03/26/18 ) Access Point
WRT54GSv5 DD-WRT v24-r33555_micro_generic (10/20/17) Repeater
Location 2
R6300V2- DD-WRT v3.0-r39345M kongac (04/03/19) Gateway
R6300V2- DD-WRT v3.0-r39345M kongac (04/03/19) Access Point
WNDR3700v2 DD-WRT v3.0-r35531 std (03/26/18 ) Access Point
E1200 v2 DD-WRT v3.0-r35531 mega-nv64k (03/26/18 ) Gateway(for trivial reasons)
2 devices: SXT 5 ac (mipsbe) RB 6.45.1 (06/27/19) PTP Bridge (0.8km/0.5mi)tx/rx866.6Mbps-1GbpsLAN

Thank You <Kong> & BrainSlayer for ALL that you do also to everyone here that shares their knowledge
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum