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.
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.