Marc Lognoul's IT Infrastructure Blog

Cloudy with a Chance of On-Prem

Checklist for Getting the TRIM Command to Work with SSD drive on Windows 7

Windows 7

What is the TRIM Command and why you should care

The TRIM command is a way for the operating system to notify the SSD drive that it should perform a garbage collection (a proactive clean-up) on the disk blocks recently affected by file deletion operations. It helps  improving the write performance over time since it reduces the need for cleaning the the blocks right before they are (over)written upon request from the OS.

It may sometimes be confused with disk defragmentation (ensuring blocks of the same files or of free disk space are contiguous) or Vendors’ SSD optimizers (which usually perform bulk clean-up at scheduled time or when the disk is initialized before use).

Check-list to enable TRIM (I mean “for real” :))

The exact procedure depends upon your system’s configuration but to be comprehensive, here is a check-list with what you should consider when trying to enable the TRIM command:

  • Check that you SSD drive itself supports it and update the firmware as necessary. Even recent drives may require firmware update
  • Check that your storage controllers/Chipset (Kudo’s to Loukiana for the reminder) supports it and update the firmware as necessary. Note: carefully check if you use H/W RAID controller, very few so actually support TRIM
  • Check your computer’s BIOS and upgrade as necessary. Also check the computer’s vendor information about the SATA mode in which you should set your BIOS configuration. Usually AHCI will do fine but of course, it will depend on chipset/controller
  • Finally, verify the current Windows configuration by running the command hereunder from an elevated command-prompt:

    fsutil behavior query disabledeletenotify

    DisableDeleteNotify = 0 means TRIM is ENABLED
    DisableDeleteNotify = 1 means TRIM is DISABLED

  • Once all conditions above are met but DisableDeleteNotify = 1 is reported, Open an elevated command prompt and execute the command hereunder. Note: rebooting should not be needed to apply the change however it will not hurt.

    fsutil behavior set disabledeletenotify 0

Some remarks

  • At setup time, Windows 7 will automatically enable the TRIM command if it detects and SSD drive. But in many cases, due to improper configuration, outdated drivers or firmware’s and so on, it may not detected it properly. Therefore you’ll have to enable it manually as explained above…
  • If your system is equipped with a RAID controller adapter, it is likely that it will not support TRIM. Actually, very few H/W RAID do support TRIM at the moment but of course, with time things tend to evolve, like for Intel for example
  • While I am mentioning Windows 7 in the title of this post, the information here above are also applicable to Windows Server 2008 R2 and subsequently WHS 2011 too!
  • Unlike stated in (too) many blog posts or forums, getting zero as output from the command fsutil behavior query disabledeletenotify does not guarantee that the TRIM command is active, it simply reports that is is enabled at operating system level. Windows will continue to check if the storage support it or not…
  • disabledeletenotify flag may also be used by non-SSD storage in order to optimize their background processing of file deletion operations and on the other hand it might also bring adverse effect on some storage technologies. Be careful if you mix SSD and non SSD on the same computer
  • TRIM works with Windows 7 native software RAID. I have never tested on 3rd party software though
  • After enabling the TRIM command, your chance to recover delete files is close to zero. On the other hand, it helps improving privacy a little…

Useful Resources

Marc

Advertisements

Author: Marc Lognoul

Relentless cloud professional. Restless rider. Happy husband. Proud father. Opinions are my own.

Comments are closed.