I have enabled TRIM by adding discard option in /etc/fstab but even after removing it the effect is not going. How to disable it?
3 Answers
In 14.04 there is an automativ weekly trim. You can disable it with:
sudo rm /etc/cron.weekly/fstrim
But I wouldn't recommend totally disabling TRIM, this will slow your drive down with time.
To check the status of TRIM timer
sudo systemctl status fstrim.timer
You would get something like this:
● fstrim.timer - Discard unused blocks once a week
Loaded: loaded (/lib/systemd/system/fstrim.timer; enabled; vendor preset: enabled)
Active: active (waiting) since Mon 2022-01-10 06:36:56 CET; 31min left
Trigger: Mon 2022-01-17 00:00:00 CET; 6 days left
Triggers: ● fstrim.service
Docs: man:fstrim
To disable the periodic TRIM (TRIM timer)
sudo systemctl disable fstrim.timer
To manually invoke TRIM (on all mounted FS)
sudo fstrim --all
Further reading:
Disabling trim is very important for legacy servers that pre-date SATA. SSD's can be fitted for power, reliability as well as some speed increase by means of an IDE to SATA bridge or converter. Or a DOM package plugged directly into the MB.
Some of these hang on TRIM. Random writes to the SSD are 3-4 times faster than UDMA so TRIM does not matter, it has time to write twice.
My approach is to comment out /etc/cron.weekly/fstrim (c. Utopic or Trusty LTS)
#!/bin/sh
# trim all mounted file systems which support it
# /sbin/fstrim --all || true
Of course this will also affect SATA SSD's on a PCI expansion card, but that's something else.