FSTRIM - Do I need to worry about it?

Have a basically default TW install on a ssd

Is fstrim taken care of? Or should I be making adjustments?

I ran it manually and saw trim results of 20GB on / and 140GB on /home

I typically reboot this laptop daily or close to that

Hi
Never worried about it… I use btrfs and xfs, no weekly cronjob for btrfs-trim.sh just balance these days.

What filesystems are you running?

ext4 in both cases

With ext4 you probably want the trims. BTRFS seems to have things built in

There is no difference. In both cases you need to mount with “discard” option to enable inline trim (at the time of file deletion). Otherwise you need to use fstrim periodically. Whil btrfsmaintenance package does include cron job for it, this cron job is inactive by default.

IFAIU the discard option should be avoided on not-too-old SSDs as it will trim at every IO, impacting performance and lifetime of the drive. I’m currently calling fstrim from /etc/init.d/boot.local:

echo deadline > /sys/block/sda/queue/scheduler
fstrim -v / > /tmp/fstrim-root.log
fstrim -v /home >/tmp/fstrim-home.log

that log to two files in /tmp. As I only reboot about a week or so it seems adequate.

Not really convinced so far that I have a concise answer to this

On Sun 08 May 2016 04:26:01 AM CDT, caf4926 wrote:

Not really convinced so far that I have a concise answer to this

Hi
Have a read here?
https://en.opensuse.org/SDB:SSD_discard_(trim)_support

Old article, perhaps a query on the Factory mailing list would help for
clarification?


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
openSUSE Leap 42.1|GNOME 3.16.2|4.1.20-11-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

Well,

  • trim will likely help and unilkely to hurt.
  • inline discard proved to negatively affect performance. It is true not only for consumer devices, but also for enterprise storage and products. So it is better to run fstrim periodically. I am not aware of such standard job for ext4, so you need to create your own cron job or service.
  • how often you need to run it really depends on file deletion rate and free space. But weekly run looks pretty OK as rule of thumb.

cron job created, thanks