1 (edited by aether 2018-09-28 09:47:54)

Topic: [Fixed] fstrim service for SSD ?

Fixed. cronie is working fine now.

Hello,

On Parabola (& systemd), I had the following service enabled :

fstrim.timer

Is there an equivalent for OpenRC ? Or has it to be written ?

Or what is the best way to run fstrim generally ?

My layout is as follow :

/dev/sda1 #boot
/dev/sda2 #swap
/dev/sda3 #root
/dev/sda4 #home

Right now, I have this script in /etc/cron.daily (with cronie service enabled) :

#!/bin/sh
LOG=/var/log/trim.log
echo "*** $(date -R) ***" >> $LOG
fstrim -v / >> $LOG
fstrim -v /home >> $LOG

But the cron task is not executed. (My machine is on 15 hours / day) If the script is executed manually, it works though.

I also have an other machine with full disk encryption (LVM on LUKS), in this case, what would be the best way to run fstrim ?

Thanks for your help

2 (edited by aether 2018-07-22 20:21:09)

Re: [Fixed] fstrim service for SSD ?

Quick update :

The above script is now working with cronie service enabled.

EDIT : Script also works with full disk encryption, since I'm using one LVM container, only trim on / is needed. PS : Don't forget to chmod+x the script