1

My /etc/cron.daily/fstrim looks like this:

#!/bin/sh
# call fstrim-all to trim all mounted file systems which support it
set -e

# This only runs on Intel and Samsung SSDs by default, as some SSDs with faulty
# firmware may encounter data loss problems when running fstrim under high I/O
# load (e. g.  https://launchpad.net/bugs/1259829). You can append the
# --no-model-check option here to disable the vendor check and run fstrim on
# all SSD drives.
exec fstrim-all --no-model-check

And yet trimming does not occur daily. I tested this by trimming, then writing ~30GB and deleting it, waiting for 24+ hours (~48 hrs in fact and barely used the computer) and trimming again with fstrim -v /. 45GB was trimmed on the 64GB disk.

What is wrong? Manual trimming seems to work, only the cronjob doesn't. The drive is Samsung 830.

1
  • check that the cron job is being run. /etc/cron.daily/fstrim must have no write access to other than the owner root, and must be executable (unlike in /etc/cron.d/). Look for messages in the logfiles.
    – meuh
    Dec 27, 2015 at 17:09

1 Answer 1

1

fstrim might trim all free space regardless whether it was already trimmed. This is the decision of the filesystem. So unless you are very sure about your filesystem's characteristics, as long as the value reported by fstrim does not exceed free space, is not an indication of an error.

As for testing whether something was trimmed, you could try: https://unix.stackexchange.com/a/85880/30851

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .