They say SD Cards can wear out quickly if your write too much too quickly too it. (I think at least.) I was just wondering if there is anyway to monitor how much my SD Card is being written to and how much wear it has in Luci. I mainly want this because I'm looking to install AdGuard Home and currently by default it is in /var. I'm pretty sure this basically means RAM. I also think this means I'll lose my config on reboot. I would move it but I don't really want to destroy my SD card. So I wanna move it and monitor what's happening to the card so I can tweak Adguard's settings (e.g. logging) to minimise the damage.
Yup, Raspberry Pi 4 exactly. The SD Card has 32GB of space which OpenWRT barely uses. I wouldn't be so cautious about storing stuff on it given the space but apparently SD Cards can't handle much writes.
There are cards designed for writes, but the cheapest probably aren't.
Openwrt minimizes writing to the storage, so you should be safe, unless you start to log a lot of stuff, or use the card for additional functionality, doing lots of writing.
You don't know if it's high quality, until it fails
AdGuard is additional functionality, but it's also designed for running on routers, so the software should be aware of the limited flash life span (when written to), of those devices.
What I meant by additional functionality, would for instance be a file server, using the SD as storage.
I have a RPi 1B, used for monitoring the boiler in our house, it's been using the same SD card since day one, probably 7-8 years by now.
I read it but not sure if I understood. Is the /var directory permanent? Can it be made permanent? If so is that a good idea (reading that post made it seem like a bad idea). Is there any other directory that would be better suited?
Sorry not sure if this is suited for this topic but any help would be greatly appreciated.
if you tweak AGH yaml files you can have it write to ram instead of disk. or even just mount a usb drive and install/run it off that. By default if you install manually AGH installs to the /opt/AdGuardHome directory so you can easily remap that.
OpenWrt now has an installable package for AGH but if you want to manually install just follow my thread.
SD cards are designed for significantly higher write cycle use than the flash memory typically found in embedded devices -- when you consider that they are used as media for digital cameras and other devices, it is important that they are relatively robust. But yes, eventually they will wear out and fail.
With that in mind, though... SD cards are also easily replaced, cheap, and plentiful. While you obviously don't want to intentionally burn through these things and waste money/environment, it is trivial to replace an SD card, provided you have a backup. This is in contrast to an embedded device which has storage that is not robust and not easily replaceable.
You can actually just use the standard system backup which will save all of your config files and anything else you specify in the /etc/sysupgrade.conf file. This doesn't produce a clone, but will save the files that are most critical.
The card replacement process would be fairly simple:
write an OpenWrt image to the card*
install any user installed packages
restore the backup
*You can actually create custom images that include any extra packages you've installed. Beyond that, your custom images can even include your configuration files so that it is completely ready to go.