How to Disable the Ubuntu ‘Fstrim’ Timer on SSD-Less Servers

The SSD Maintenance Task

Modern Ubuntu installations include a systemd timer called fstrim.timer. Once a week, this timer automatically wakes up and runs the fstrim command on all mounted file systems. This command sends a TRIM signal to the underlying storage hardware, telling the drive which blocks of data are no longer in use and can be safely wiped. For Solid State Drives (SSDs) and NVMe drives, this is a critical maintenance task that prevents performance degradation and extends the lifespan of the flash memory.

However, if you are running an older server that relies entirely on traditional, spinning mechanical Hard Disk Drives (HDDs), or if you are running a specific type of virtual machine where the hypervisor handles all storage optimization transparently, the fstrim command serves absolutely no purpose. Running it wastes CPU cycles and generates unnecessary disk I/O as the system attempts to send unsupported commands to the spinning platters. You should disable the timer on these systems.

How to Disable the fstrim Timer

You can turn off this scheduled maintenance task using standard systemctl commands.

  1. Open your Ubuntu Terminal (or connect via SSH).
  2. First, check the current status of the timer to ensure it is active:
sudo systemctl status fstrim.timer
  1. Stop the timer immediately so it doesn’t trigger during your current session:
sudo systemctl stop fstrim.timer
  1. Disable the timer permanently so it does not load the next time the server reboots:
sudo systemctl disable fstrim.timer

The system will no longer attempt to trim your disks. (Note: Never perform this action if your server uses an SSD, as disabling TRIM will eventually cause severe write-speed degradation).

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.