Hi,
I am new to openwrt and i like to play around configurations. I read that "flash wear" thing so im worried about it.
Is it so fragile to change configs frequently ?
Thanks
Hi,
I am new to openwrt and i like to play around configurations. I read that "flash wear" thing so im worried about it.
Is it so fragile to change configs frequently ?
Thanks
The TL;DR of the link that @LilRedDog posted is that flash wear is a real thing, but you don't need to worry about it if the writes are done at human timescales.
There is a big difference in the scenario where you are sending the standard logs to the flash storage (because it will be writing essentially all the time) vs when you are actively making changes and saving them back to the flash storage. Yes, even human scale writes does cause wear, but it is really unusual to do enough that you actually start causing failures (it can happen, but is the exception, not the rule).
So, play around with your configs as much as you want... in general, you'll be hard pressed to wear it out before the device itself is old enough to be obsolete and worthy of replacement anyway.
This topic has been popular lately; I wonder if AI is having mortality issues.
Isn't there a way to send all system reads and writes to USB?
Logs are persistent now so they must be writing them.
Yes, mount a drive and send the logs there. A flash based USB drive will also wear over time, but those devices will tend to have at least an order of magnitude more write cycles (if not 2-3 orders of magnitude) because of its intended use.
??
Logs haven't changed... they're written to RAM, with the oldest entries being dropped when the allocated space fills up and new entries arrive.
They persist through not only a reboot but a power off.
I just rebooted and rebooted and pulled the plug; I have logs going back to the 13th.
Thu Feb 13 11:16:02 2025 kern.info kernel: [ 0.000000] Machine model: GL.iNet GL-MT3000
I don't think so...
That is probably a function of the system time at initial boot time, before the NTP sync happens.
Try adding your own logger message and see if it perists:
logger "This is my own message on Feb 16"
reboot
After rebooting, can you find your logger message?
No, it is gone.
And so are all the reboots.
What's happening?
I have the same entry at the start of the log. Why didn't that roll off?
Because the logs are stored in RAM... a reboot or power cycle clears them all.
The entry at the beginning of the log, as I said previously, is the system time before NTP sync happens. This time represents the time/date of the most recently written file in the file system. It is wrong obviously wrong (it's in the past), but it's going to be closer to current than any other time/date stored on the device since the vast majority of OpenWrt devices (i.e. routers) do not have a battery-backed real time clock to keep continuous time. Once NTP sync occurs, the system will jump to the actual correct time.
It is written.
I mean this log goes back to me upgrading. Multiple saves and reboots.
Thu Feb 13 11:16:16 2025 daemon.notice hostapd: phy0-ap0: ACS-COMPLETED freq=2462 channel=11
Sun Feb 16 20:46:31 2025 daemon.notice netifd: Network device 'phy0-ap0' link is up
That is the end of the first boot and the start of the most recent; nothing between.
I noticed and was surprised with this when I updated.
Maybe I have a config issue...
No... the log entry is fresh each boot. It just has the time of the last write.
do the following:
touch /etc/banner
reboot
Now, look at the earliest log entry.
Sorry that took so long; I get it now.
Also @psherman
It works something like this: Unless there is a real time clock onboard (and most do not), at boot time, the system clock is set to the youngest config file time/date. Then as the network comes up, NTP requests get answered and the time/date gets set to real time.
The only log entries I get anymore, after the boot, are DHCP renewals and the occasional Plex 'possible re-bind attack'; so to my eyes, my logs since 24.10, always looked the same and I presumed too much.
I still think AI is having an existential crisis over flash wear, sophons are stifling our physics model and Elon will regret having all that hair ripped out of the back of his head in about 15 years...
Thanks for your valuable response!
Yeah... I did say that earlier, but maybe not as well as you've stated it -- your verbiage clearly indicates that the RTC is used when present, but that absent the RTC, the most recent file's timestamp is used.
You're welcome.
If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.
Thanks!
There’s a way to get a feel for extent of wear by reading from certain variables. I forget which.
Sorry, yes I know you did. But sometimes it helps people to understand when they can read the same information in a completely different format.
Edit: By the way, is it the youngest file in /etc/config, or just /etc ? I'm not sure without testing...
Looks like it is /etc