1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Approximately how many times I can erase NVRAM on wrt54GL?

Discussion in 'Tomato Firmware' started by premudriy, Jul 3, 2009.

  1. premudriy

    premudriy LI Guru Member

    Hi, guys!

    I've been into routers and Tomato for about 5 month, so my knowledge is still pretty limited, thus I have some questions.

    I've noticed that a lot of people are asking "should I do NVRAM erase for this relese?" etc. every time. Why are people so vague to do NVRAM erase? How many times can it be done?

    I know that for standard flash memory it's approximately 80,000 times write/erase operations for each cell before it fails. Is it the same for NVRAM? 80 000 seems a lot to me if this is the case. If it's 80000 then router will last at least 10 years or so before it will fail.

    I have WRT54GL v1.1, so how many times approximately can I do "throughout NVRAM erase" before it fails? Also, what about "non-throughout" erase, is it also as bad as "throughout"?

    Thank you!
  2. GhaladReam

    GhaladReam Network Guru Member

    You're right, I'm pretty sure most flash chips are good for over 100,000 write cycles... I highly doubt you will erase your NVRAM (which, is stored in flash) that many times in the life of your router. If you were to clear your NVRAM once a day it would take 273.97 years for the flash chip to be inoperable.

    You don't have to worry about NVRAM clearing wearing out your router :)

    One thing that's bad to do is set your router to log to NVRAM. This can wear out the flash qucikly. I know someone who set his router to write the logs to NVRAM every second. 100,000 seconds = 100,000 writes = 27.7 hours. A little over a day later he noticed his router was acting strangely. That location in Flash was fried.
  3. mstombs

    mstombs Network Guru Member

    Flash works in "erase blocks", every time there's a "nvram commit' the whole 64kB or 128kB block is erased and rewritten, it doesn't matter whether you default all or just change one entry.

    OpenWRT has moved away from using nvram vars, partly for this reason - they now store config in little files on a flash file system. Flash file systems are designed to minimize flash writes and to even out the wear across all the available blocks.

    I have heard of sob stories with students using usb flash drives and library computers - Microsoft word keeps backup/temp files in the directory the main file is loaded from.
  4. premudriy

    premudriy LI Guru Member

    So, then simply changing something, i.e. like un-ticking a port forwarding rule, will also slowly kill NVRAM, right?
  5. Toastman

    Toastman Super Moderator Staff Member Member

    For all practical purposes, you don't have to worry about it. Usually, nobody in their right mind would log every second. (???) And un-ticking a rule is something you do only rarely.

    To answer the other question, clearing NVRAM after an upgrade is recommended to make sure that no unwanted data left in the NVRAM from the older installation can affect the new one, which may not be compatible. It is the biggest cause of problems when updating to a new version. As for why everyone keeps asking the same question, it's a case of people not looking for the answers *before* they post.
  6. premudriy

    premudriy LI Guru Member

    Ok, thanks a lot, guys!
  7. mstombs

    mstombs Network Guru Member

    I really don't think you have an issue with manual config change related nvram writes.

    I'm less sure about automatic writes when the WAN reconnects, for example, - things like DDNS need to store WAN IP and time (to avoid dyndns abuse reports on power cycle etc). What would happen if your modem connection went bad and was dropping every few seconds? I recall dd-wrt does many more nvram writes than Tomato though.

    If you are concerned there is a tick box in the GUI administration->debugging to "Avoid performing an NVRAM commit". nvram commits do appear in the log.
  8. Toastman

    Toastman Super Moderator Staff Member Member

    That's a very good point, never seen it happen but it could !
  9. philtrim

    philtrim Addicted to LI Member

    Log to NVRAM

    Quoted by GhaladReam
    "One thing that's bad to do is set your router to log to NVRAM."

    Is this the same as logging internally?
    Just wanted to make sure that I was not putting my router at risk.

    Thanks, I really appreciate the knowledge I pick up on this forum!

    Attached Files:

  10. Toastman

    Toastman Super Moderator Staff Member Member

    Yes. "Generate marker every hour" also causes a write.
  11. fyellin

    fyellin LI Guru Member

    So as long as we're on the topic of nvram erase. Can someone explain the difference to me between "restore default router settings (normal)" and "erase all data in NVRAM (thorough)".

    Mostly I use the latter. Is there a reason that both exist?
  12. rizsher

    rizsher Network Guru Member

    I think the query is more to do with a desire to not erase all the router configuration, which an "erase nvram" would cause.

    I have a 5 yr + old WRT54GS thats had countless flashes and erases starting from Sveasoft to DD-WRT to Tomato.
  13. mstombs

    mstombs Network Guru Member

    There is no problem with logging internally, this is to the volatile RAM disk /var/log - the busybox syslog is configured to write to a couple of files which rotate, so no problem with flash or memory.
  14. mrap

    mrap Addicted to LI Member

    I was all set to turn off "Log Internally" but I guess I'll leave it on now! :)
  15. apinunt

    apinunt LI Guru Member

    Looking at Tomato's menu, where do I find NVRAM? And what information is contained in NVRAM that I need to know that might require being replaced after clearing it? I've searched here and haven't found a thorough explanation of just what NVRAM contains, I had been under the impression that it is simply where the firmware (Tomato) resides. I'm having problems occasionally with port forwarding and see NVRAM mentioned in several posts, and have never done anything related to NVRAM and am wondering if that might be a source of my problem?

Share This Page