TRIM

From Open-E Wiki
Jump to navigation Jump to search

What is TRIM?

TRIM is a feature associated with solid-state drives (SSDs). SSDs use NAND flash memory to store data; over time, as files are deleted or modified, free space within the SSD can become fragmented. This fragmentation can impact the performance and lifespan of the SSD. TRIM allows the operating system to inform the SSD which blocks of data are no longer in use, marking them as available for erasure. By doing so, the SSD can perform internal housekeeping tasks and optimize its performance by consolidating free space. This process helps maintain the SSD's efficiency, prevent write amplification, and extend its lifespan. TRIM support is contingent on the SSD and the operating system. The SSD must have TRIM functionality built into its firmware, and the operating system must support TRIM commands. When both the SSD and the operating system support TRIM, it ensures the optimal functioning and longevity of the SSD in computing systems.


How to use TRIM?

The TRIM function can work in the system permanently (autoTRIM) or can be run manually periodically (TRIM). Un-Kh options can work simultaneously. It means that even if autoTRIM is enabled, it can still be run manually.


How to use autoTRIM?

This functionality is available in the zpool’s settings in the Configuration tab. After enabling the autoTRIM feature, the TRIM will work on all disks in the zpool that support this functionality.


Note! The autoTRIM is not recommended for heavy workload systems - in such a case, using the function manually once every 3-6 months is recommended.

To activate autoTRIM:

  1. Go to the Storage, expand the zpool options to find the Configuration tab.
  2. Enable the autoTRIM toggle.


Note! The autoTRIM function status is not saved in the settings file and won't be restored when the "Restore settings" option is used. In this case, set it again.


Whether or not the "autoTRIM" function is enabled, it is recommended to run a manual "TRIM" periodically to ensure optimal performance. This can be done in the Status tab in the TRIM section by using the Run button.


How to use manual TRIM?

This functionality is available in the zpool’s settings in the Status tab in the TRIM section. Note! It is only active if there are disks that support TRIM.


To run TRIM manually:
  1. Go to the Storage, expand the zpool options to find the Configuration tab with the TRIM section.
  2. Click the Run button.

It is possible to run TRIM on individual disks rather than on the entire zpool. In order to do it, choose the Selected disks option instead of the All disks option. Then click on Settings and tick the disks you want to trim. Now the number of selected disks for TRIM will be displayed in this section (e.g. 5 out 7). You can now start the TRIM process by pressing the Run button.