Trim (computing)

A trim command (known as TRIM in the ATA command set, and UNMAP in the SCSI command set) allows an operating system to inform a solid-state drive (SSD) which blocks of data are no longer considered to be "in use" and therefore can be erased internally.[1]

Trim was introduced soon after SSDs were introduced. Because low-level operation of SSDs differs significantly from hard drives, the conventional manner in which operating systems handle storage operations—such as deletions and formatting—resulted in unanticipated progressive performance degradation of write operations on SSDs.[2] Trimming enables the SSD to more efficiently handle garbage collection, which would otherwise slow future write operations to the involved blocks.[3]

Although tools to "reset" some drives to a fresh state were already available before the introduction of trimming, they also delete all data on the drive, which makes them impractical to use for ongoing optimization.[4] As of 2024, many SSDs had internal garbage collection mechanisms for certain filesystem(s) (such as FAT32, NTFS, APFS) that worked independently of trimming. Although this successfully maintained their lifetime and performance even under operating systems that did not support trim, it had the associated drawbacks of increased write amplification and wear of the flash cells.[5]

TRIM is also used on some shingled magnetic recording (SMR) hard drives.[6]

  1. ^ "Intel High Performance Solid State Drive – Advantages of TRIM". Intel.com. Intel. 14 September 2010. Retrieved 21 February 2012.
  2. ^ Shimpi, Anand Lal (18 March 2009). "The SSD Anthology: Understanding SSDs and New Drives from OCZ". AnandTech.com. p. 4. Retrieved 19 June 2010.
  3. ^ Shimpi, Anand Lal. (18 March 2009). p. 10. TRIM is an ATA command (Advanced Technology Attachment Command) that allows an OS to inform SSD about the blocks of data no longer in use. The SSD then deletes such blocks of data to make a way for newer blocks of data. TRIM is basically used for enhancing the performance and life span of the SSD. Unfortunately, the boon of TRIM becomes a bane for data recovery from SSD. Therefore, it is strongly recommended to regularly make a backup copy of your data using a reliable tool (for example Disk Drill for Windows), especially if your OS is warning about SSD failing.
  4. ^ Shimpi, Anand Lal. (18 March 2009). p. 11.
  5. ^ "Kingston SSDNow V Plus 100 Review". AnandTech.com. Anand Lal Shimpi. 11 November 2010. Retrieved 10 December 2010.
  6. ^ "Trim Command - General Benefits for Hard disk Drives" (PDF). Documents.westerndigital.com. Retrieved 7 November 2021.