Minimizing writes to SD card - reducing wear


I’m wondering if anyone has experience w/ maintaining Ubuntu Core based devices that use an SD card for storage.

Are there any mechanisms in UC to help limit filesystem writes (i.e. noatime, keeping logs in memory based overlay, etc…) that are part of the system or can otherwise be configured?

Thanks a bunch,

noatime is a default mount option in Ubuntu Core and logs are by default in ram (journald only logs to disk if you manually create /var/log/journal)

i have a bunch of Pi’s around that use the same SD card since the initial core 15.04 and have been re-flashed regulary without showing any wear levelling issues yet … if your application snaps dont do any excessive writing you should be fine for several years with Ubuntu core 18 i a default setup.

Thanks, that’s the confirmation I was looking for.

Hi, this post came up recently, and I’m not sure it is accurate.

I couldn’t find any references to any of the Ubuntu Core components setting any mount options related to timestamp update settings (noatime, atime, relatime, or similar) on reference pc-kernel based images on amd64 architecture on UC16, UC18, UC20, UC22. Thus my understanding is that built-in kernel default is used which is relatime by default.

Custom kernels may change that in the kernel code, or inside initrd, but i am unable to find that. So I believe Ubuntu Core product, like classic, has been using relatime since it was changed in the Linux upstream kernel in 2.6.30 so circa 2009 or so.

W.r.t. reducing wear => do not that most of the system is readonly snaps on Ubuntu Core, meaning majority of files used at runtime are immutable and not update timestamps compared to a classic system. Thus the amount of files that get timestamp updates is fairly small during normal operation.