7

This is a broad question -- I'm not asking about a particular RAID level or OS.

Fantius
  • 225
  • 2
  • 6
  • 1
    As a broad question the only possible answer is one word (yes or no) but still one word since you used the qualifier "any". Only if you allow someone to give a specific example including OS and raid level will you get a proper answer that can be verified. – pplrppl Aug 28 '10 at 18:58
  • 1
    http://serverfault.com/a/229486/67675 – poige Apr 19 '12 at 02:23

4 Answers4

5

Not yet, no, at least as far as I'm aware.

The issue is the disconnect between the filesystem layer and the LVM systems used to handle the software RAID - generally they abstract away the type of device from the filesystem so it doesn't know to use TRIM.

The first people to support it in software will probably with Sun with ZFS, which doesn't have a traditional LVM layer but instead operates as a unified pool. They're already working on TRIM support being added to ZFS, when it happens I think it'll work across all the ZFS functionality including software RAID.

Ewan Leith
  • 1,695
  • 8
  • 7
3

You can use my MDTRIM script ( https://github.com/Cyberax/mdtrim/ ) to TRIM empty space on ext4/3 level-1 RAIDs. We start it periodically from cron and it works great for us.

Adding support for other RAID levels is possible, but I don't have time (or need) for that.

Cyberax
  • 249
  • 1
  • 5
1

SoftRAID 4.3 for OS X, a $129 third-party software RAID, now supports TRIM on striped arrays:

The SoftRAID driver now supports TRIM commands for all brands of SSDs when running under Lion (Mac OS X 10.7). This can dramatically increase the useful life of SSDs. Unlike most other RAID solutions, SoftRAID even supports TRIM on stripe volumes (RAID 0). Support for TRIM commands can be disabled in the SoftRAID preferences.

As far as I can tell (this is notoriously hard to verify), OS X's builtin software RAID doesn't handle TRIM.

Edit: verified with dtrace that builtin SW RAID doesn't call TRIM-related functions.

-1

I'll guess a qualified Yes. As all software raid on the windows side treats the drive as a single drive. Only the volume is treated like RAID.

You would have to be sure to plug the drive into a drive controller that doesn't have BMC or RAID support. Essentially if speedfan, hdtune, and such can see SMART data I would expect the Trim command to make it to the drive.

Windows 7 and Windows Server 2008 R2 support Trim. That would mean software RAID 0, 1, or 5 could support trim if I'm right.

That leaves Server 2008 32bit, Server 2008 64 bit (not R2), Server 2003 (all versions) out on this. Doubly so for Vista and XP which can't create software RAID volumes.

Unfortunately on the Windows side of things RAID 10 is not supported as a fully software based raid level. You would have to do RAID 0 or 1 in hardware and then stripe or mirror as needed on the software side to get the 1+0 or 0+1 array you truly wanted and at that point no TRIM support would apply just as if you did RAID 10 entirely in hardware.

In addition many hardware raid controllers will be slower than software RAID with SSDs. See http://it.anandtech.com/IT/showdoc.aspx?i=3532&p=9 for benchmarks showing this concept.

pplrppl
  • 1,242
  • 2
  • 14
  • 22
  • Why the downvote?!? – Massimo Dec 15 '09 at 20:49
  • I see your point but do you have any documentation to back this up ?TRIM support in a RAID setup requires that the file deletes (which happen at the volume level) are communicated to the individual drives via their drivers. For this to be true the Windows Software RAID layer will have to handle that communication, simply supporting TRIM at the filesystem and drive level isn't enough - I haven't found any evidence that this happens. – Helvick Dec 15 '09 at 22:06
  • Helvick. I don't have documentation. I'm not 100% sure. Since Microsoft doesn't clearly state one way or the other that I know off the only way to tell would be to run bechmarks on a pair of trim supported SSDs using software RAID 0 or 1 that isn't the boot partition on a W7 or Server 2008 R2 box. It's no small amount of work to document this behaviour and prove that it would or would not work as my hypothesis states. I'd be happy if someone would prove me right or wrong with testing and/or documentation. http://www.anandtech.com/storage/showdoc.aspx?i=3667&p=2 mentions a rough test method. – pplrppl Dec 16 '09 at 15:09
  • This can be proved fairly simply. Use this tool to see if the OS can communicate with the SSDs firmware and return affirmative TRIM support: http://crystalmark.info/software/CrystalDiskInfo/index-e.html Then use the manual verification technique described in this answer to see if it _actually_ works: http://serverfault.com/questions/94017/ssd-tweaks-recommended-configuration/127558#127558 – cottsak Mar 30 '10 at 05:37
  • Apparently the latest update to the Intel Matrix RAID system will pass TRIM commands: http://www.hardwarecanucks.com/news/cpu/intel-chipset-driver-brings-trim-support-raid-setups/ – cottsak Mar 30 '10 at 05:50
  • But only to a single SSD, not to the array. – Fantius Oct 05 '10 at 14:38
  • @fantius, each SSD is visible to the OS in software RAID so yes, it could be passed to all drives in the array. That is the point about software RAID, only in "fake raid" or hardware based raid are the drives hidden and presented to the OS as a lump sum. – pplrppl Oct 17 '10 at 17:44
  • @pplrppl, look at the first sentence in the link from jimmygee. – Fantius Jan 24 '11 at 14:10
  • According to [this answer](http://serverfault.com/a/645863/180506), Windows only supports TRIM for RAID-0. – pacoverflow Aug 17 '16 at 05:21