On 01/12/2026 11:27, Chris Green wrote:
> my software comprises one python script. Yes, I know Python
> takes space but not **that** much and since it's just the one script it
> will just be sitting static in memory (or swap) and not moving about.
What kills SD is writing to them especially when nearly full.
Its not your scripts, its things like eystemd and other logs that insist on splatting superfluous data into log files.
1. If you are swapping, turn off swap. If there isn't enough memory rewrite your code in something efficient like 'C' or buy a bigger Pi
2. make sure no atimes are added to partitions. mount noatime in /etc/fstab
3. Stop all logging possible, and what cannot be stopped feed to a ram disk you create. Mine is /var/ramlog. There will be an irreducible residue in /var/log, but that's life
There are utilities that can be installed to monitor and track disk activity.
Your target should be zero writes at all, ever *unless* you want to preserve some moveable data between boots
Hopefully that suppresses uneccesary wear levelling as well.
Treat the SD care as a ROM that can occasionally be tweaked
here is a systemd config edit
## fuck with shitsemd
sed -i "s/#Storage=auto/Storage=volatile/" /etc/systemd/journald.conf
sed -i "s/#RuntimeMaxUse=/RuntimeMaxUse=25M/" /etc/systemd/journald.conf
sed -i "s/#ForwardToConsole=yes/ForwardToConsole=no/" /etc/systemd/journald.conf
sed -i "s/#ForwardToWall=yes/ForwardToWall=no/" //etc/systemd/journald.conf
Remember a Pi Zero is not a full blown linux computer and there is much that can safely be uninstalled or turned off.
Use ps to see what is running and investigate why it is
use find to find any files that are being modified
Write it all down so you have s script to run for a fresh install
--
"Nature does not give up the winter because people dislike the cold."
― Confucius