:: Re: [DNG] SSD and trim service
Pàgina inicial
Delete this message
Reply to this message
Autor: Marjorie Roome
Data:  
A: dng
Assumpte: Re: [DNG] SSD and trim service
Hi,

On Thu, 2022-11-17 at 19:06 +0100, Rand Pritelrohm via Dng wrote:
> Hello,
>
> I plan to migrate to Devuan, and getting rid of systemd.
> For now most of my configuration is done.
>
> But I still need to tweak the management of my SSD disk, so I need to
> find:
>    i) a 'trimming' service
>    ii) how to configure the 'swappiness'
>
> In the systemd realm those points were achieved with:
>     i)  systemctl enable fstrim.timer
>     ii) /etc/sysctl.d/99-swappiness.conf
>            vm.swappiness=10
>
> What would be the equivalent in Devuan?
>
> I also would be glad if some of you explain how they manage their
> SSDs
> in order to prevent an early wear.
>

I use the following script (fstrim-periodic) to trim my SSDs:

#!/bin/sh
# trims SSDs periodically
#
# Put in one of /etc/cron.daily, /etc/cron.weekly,
# /etc/cron.monthly according to the frequency that
# you want it to be run
#

test -x /sbin/fstrim || exit 0

/sbin/fstrim --all

RC="$?"

case $RC in
0 )
echo "fstrim - succeeded"
;;
32 )
echo "fstrim - all failed"
;;
64 )
echo "fstrim - some failed, some succeeded"
esac

exit $RC

Obviously you also need /sbin/fstrim.

-- 
Marjorie