Is there a way to force a TRIM in a Windows 2012 Software RAID array?

6,134

Windows software RAID only supports Trim/Unmap pass-through for RAID-0 at this time.

However, Sandforce (and most other SSD chips) will pickup that a block is being zeroed and mark the block for garbage collection instead (what Trim would do). You can force Windows to zero unused disk space with the cypher /w X:\ command. This does not work on encrypted drives.

Share:
6,134

Related videos on Youtube

Eric Grange
Author by

Eric Grange

Updated on September 18, 2022

Comments

  • Eric Grange
    Eric Grange almost 2 years

    I have a Windows 2012 server configured with two SSD under a Software RAID 1 (controlled by Windows), under that configuration the optimization tool is not supported.

    Is the TRIM still scheduled/performed by the OS, just not visibly so, and with no manual controls?

    Is there a way to force it, given it's a simple mirroring RAID, and the OS is capable of TRIM when the SSD are not RAID'ed?

    I found an "option" early on, but it's obviously not suitable for use in production: detach one disk from the raid (thus killing the RAID), perform the TRIM on the single-disk, then rebuild the RAID.

    (the SSDs are 120GB Intel Sandforce in case that matters, they host several databases, are under constant read/write 24/7, and there is a data rotation of several gigabytes per day)

    • JamesRyan
      JamesRyan over 9 years
    • Philip
      Philip over 9 years
      @JamesRyan That refers to hardware RAID1, where the Trim/Unmap commands would almost certainly be dropped by the hardware controller that doesn't support them (though it's certainly possible that the hardware controller does support Trim/Unmap pass-through).
  • Eric Grange
    Eric Grange over 9 years
    What do you mean? This a Software RAID 1, in which the OS itself mirrors the content, the same TRIM commands can be send to both drives. Also SSD GC is no substitue for a proper TRIM.
  • Eric Grange
    Eric Grange over 9 years
    Interesting info! Does this mean that running the old VHD precompactor utility would work as well? (was used to zero all unused sectors on a disk for compaction with the old VHD format)
  • Philip
    Philip over 9 years
    Probably, it would depend on what the precompactor does...
  • JamesRyan
    JamesRyan over 9 years
    @EricGrange on the contrary, modern GC and overprovisioning have dramatically reduced the advantage of using TRIM.
  • Eric Grange
    Eric Grange over 9 years
    Maybe they're not modern enough :/ Reduced SSD performance is what prompted me to investigate the issue again: server has been up for about one month 24/7, never been idle during that time, and apparently GC needs idle times.
  • Eric Grange
    Eric Grange over 9 years
    Finally did it with sdelete to avoid having to manually break when its 1st pass is done. Just after doing it, SSD I/O fell down for a while (probably because of GC), but then shot right back up to "mint" performance.
  • JamesRyan
    JamesRyan over 9 years
    @EricGrange No GC does not need idles times, SSDs are not confined to doing one operation at a time. How much free space are you maintaining on these drives? I've only seen performance impacted on drives that are close to full.