Feature request: Enable/disable tmpfs on /tmp and /var/log #6
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
An option to disable and enable this would be very useful for most users.
These should be added on /etc/fstab to prevent wear on sd card
The memory usage can be kept low by rotating logs with logrotate
create file
with contents
Change size from 1M to something more appropiate
Haven't you had some problems with logs missing and then Nginx not working properly anymore? I think i red something like that on discord? I really don't want to include functions which can cause further, somehwhat unpredictable problems.
Maybe a better solution would be, to add only klippy.log and moonraker.log to the tmpfs if the user wants? And not the whole tmp-folder? That might work because those files are always created when the services start up, no matter if it already exists or not. And actually it would make sense to me, deleting those files regularly. This klippy.log can get quite bloated.
You can set nginx logs from
or add an
add in fstab
I also added a file in
with
which makes sure logs aren't filled up
I've also ran printers off read only filesystems except a small partition for gcode files to upload to (or used an usb stick for that). Those printers had zero filesystem issues and are workhoses. No corruption or broken files. Upgrading is a bit more comples, you need to ssh in, run a command like "root-rw on", then do upgrade, then "root-rw off" the turn it read-only
Okay so i thought a bit about this feature and i came to the conclusion that i won't implement it.
I don't see a benefit for the majority of users at the moment (might be due to own restricted knowledge in that regard). What is the actual benefit regarding the wear of the sd card? Is it safe to always delete the printer symlink in the tmp folder? Does it get recreated everytime the klipper service starts again (i haven't tested, and i don't want to tbh)? Questions i have no answer to, possible causes for some issues i (or rather kiauh) don't want to be the reason for.
And to be honest i don't want my script to write into any important system files, add lines, change lines or delete lines. Those are things i consider to be made by power-users themself if they want. I want to interact with the core linux os as few as possible.
I might add those tips to my readme though if you want, under a section "further tweaks" or so?
Ok.
The benefit is a longer lifetime for the sd card. On all my PIs that run critical stuff the filesystem is fully read only and they write into tmpfs. I've got a couple running for over 4 years under a great number of random power failures and other issues. Cheap sd cards work well for 2-3 months at most, if you write to them a lot of logs and good ones are from 4 to 12 months, but they usually cost 5-10x the price.