@pedromfa Since you can’t just use the OS shell to edit the timer like this
# systemctl edit fstrim.timer
Failed to create parent directories for '/etc/systemd/system/fstrim.timer.d/override.conf': Read-only file system
you have to find other ways but every method is hacky.
One way is to do it from the PVE side via this
qm guest exec VMIDHERE -- fstrim -av | jq -r '.["out-data"]'
It looks like this
# qm guest exec 103 -- fstrim -av | jq -r '.["out-data"]'
/tmp: 0 B (0 bytes) trimmed on /dev/zram2
/mnt/data: 166.3 MiB (174424064 bytes) trimmed on /dev/sda8
/mnt/overlay: 0 B (0 bytes) trimmed on /dev/sda7
/mnt/boot: 31.2 MiB (32706560 bytes) trimmed on /dev/sda1
Just put it in a crontab.
Another way is to do it via the Advanced SSH Addon but you need to find a way to shedule that
# docker run --rm --privileged --pid=host -it alpine:latest nsenter -t 1 -m -u -n -i sh -c "fstrim -av"
/tmp: 11 MiB (11538432 bytes) trimmed on /dev/zram2
/mnt/data: 204.4 MiB (214376448 bytes) trimmed on /dev/sda8
/mnt/overlay: 0 B (0 bytes) trimmed on /dev/sda7
/mnt/boot: 31.2 MiB (32706560 bytes) trimmed on /dev/sda1
The best way is to ask the devs to support altering this but for now these would be the workarounds I can think of. I’m not aware of a official/supported way to change this.