Trim support (for SSD drives) on legacy OS

Hi experts.

At the moment, only win7 and modern Linux releases support trim. I wonder if I can benefit from trim on vista and server 2003/2008R1. As far as I can see, Intel for example offers a "Solid-State Drive Optimizer" for legacy OS, too.

1) 350 pts. What about other brands? Kingston, Samsung, ... maybe someone can link tools of a few of those. Best would be to have a tool that does not care what make or model.

2) 150 pts. (if available) Can anyone link a site that offers a table with various SSD models and answers the question "does it support trim and if yes, from what firmware revision on?" - thing is, some manufacturers don't offer information on their own drives (try to find info on MMCRE32G5MSP from Samsung for example).
LVL 58
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

BigSchmuhConnect With a Mentor Commented:
If your SSD has the same controller than another SSD which HAS a TRIM support, you may have found your TRIM utility.

For example, I think almost all Indillinx based SSD may try the "Wiper" utility.
Wiper scans for all NTFS deleted sectors and consolidated them in a single file, then, it sends a TRIM commands to all sectors and delete the NTFS file.

NB : (Since may 2010) The only driver which sends correctly TRIM commands to Sandforce based SSD are the Intel RST one...other platform has to wait for MS to fix the Windows 7 drivers...I don't think this has been fixed by MS...
This really isn't correct on so many levels.  First not all SSDs even require   Secondly, manufacturer's usually have utility programs to take care of this, and they port the programs to certain operating systems (mostly all windows).

Finally, one does not need any specific O/S to even perform this function.  I know, I've written code to send it for SSDs behind a certain RAID controller for a NAS appliance manufacturer. (Yes, there are programs that one can write/run to query whether or not this is required at any point in time).

TRIM refers to a low-level command that a program sends to a SSD, in the same way one would send any command, like to verify data on a range of blocks.  
So what you are really asking, I think, is what SSDs REQUIRE TRIM?   If you are running windows in non-hardware RAID environment,  I assure you, your SSD vendor has a utility for free, so don't worry about it.

If you are running SSDs behind a RAID controller, then you have a problem, but your problem is bigger than just whether you can issue the command, your problem is that a fair number of RAID controllers will have problems with SSDs in the first place.

So summary, if using non- (hardware-based) RAID & windows, this is a non-issue.

DavidConnect With a Mentor PresidentCommented:
P.s. forgot the link,
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

TRIM is not a mandatory just helps the SSD controller garbage collector to work.

Please have a look at this "must read" from Anandtech about that Understanding the SSD Performance Degradation Problem where we learned that:
  • NAND Flash memory can not be re-written as is, it requires an erase process (as DVD-RW)
  • Each page of a SSD can not be erased on a one by one basis, they are erased in very large bunch
  • SSD controllers maintain a "free page list" and "to recycle page list"; those tasks are what the "garbage collector" naming are in charge of
TRIMming a page allows to mark this page for recycling at the exact time that this page is deleted from the file system. It offers the garbage collector more time to re-order the recycle process for this page....but that does only make a difference when using the DELETE command in your OS.
If you are UPDATING a file, the TRIM command is useless as the replaced pages are immediately marked as "to be recycled" in the SSD...

Good SSD manufacturers are aware of that and they use reserved free space to eliminate any contention due to a too small "free page list" (Ex: 100GB "Enterprise class" and 120GB "Desktop class" are build using 128GB...we expect more sustainable writes from an "Enterprise" usage)

Regarding a list of SSD, my advice is to look at Anandtech SSD benchmarks.
McKnifeAuthor Commented:
Thanks for the thoughts and lists.
I would like to come back to the software for legacy OS'. dlethe, you say "I assure you, your SSD vendor has a utility for free" - ok, we only bought SSDs from Kingston and Samsung so far. Both did not offer a software on the CDs accompanying their product. There was no software downloadable at their websites, neither.

So far, I have seen Intel offers a utility ("Solid-State Drive Optimizer") and gskill (wiper.exe) does. What about the others? If my OS does not natively support trim, am I really limited to only a few manufacturers so far?

By the way: no raid configurations here, simply single drives.
Excellent topic for exchange, really interesting expertise so far, kudos all.
Here is some related reading particularly as it applies to using them on XP:
Article on SSD and its reliability 
Issues using it with Windows

PassMark has drive benchmarking and compiles myriads of tests results for comparisons, SSDs included.
the Samsung MMC28 and 64 are found, but not the 32 (needs at least two to appear)
To benchmark yourself
Davis McCarnOwnerCommented:
Ah, learning something new, every day.
But; to add my two cents, the most critical factor for SSD's and older O/S's is to create partitions which are aligned to the block structure of the SSD.  Traditional partitions are created with 63 hidden sectors and, since most SSD's have a 4KB block, the NTFS structure will be one 512 byte sector off from aligning with the SSD.  This results in every disk I/O operation needing to be a Read-Modify-Write operation in order to preserve the 1/8th (or 7/8th) of the SSD's native block in order to modify the NTFS block and the result is a massive performance hit plus a serious lifespan reduction  (SSD's fail after x writes)
The simplest answer is to create the SSD's partitions from Vista, 2008, or 7 as they create aligned partitions automatically.  You can then plop them into an XP (2000, ME, or 98) system and, as long as you don't delete the partition, the alignment will be preserved.
Read this:
One observation is that every one of these comments have been made under the assumption you are using NTFS file system, and non-RAID config.  Is that the case?  

Other things
 TRIM is being misused.   When an O/S says it supports "TRIM", this is a very fuzzy thing.  It can refer to things like the O/S detecting it is a SSD, so it disables defrag.  Win7 sends out the command to do garbage collection (so to speak) when a file is deleted.  The purpose of doing this increases write performance.  (Which varies depending on make/model).   There are also things one can do to improve SSD write life and performance that have nothing at all to do with "TRIM", they just turn features off like prefetch which makes sense for a mechanical disk, but not a solid-state disk.

When the TRIM command is embedded within the O/S, it does this garbage collecting (erasing) as necessary when files are erased.  

The true TRIM command that does garbage collection does NOT need to be done at any particular time, you just have to do it whenever is convenient, and want to recover that performance bump on writes.  Manufacturers use vendor/product specific info for developers to see whether or not it is necessary.  When a developer (such as I) sends a TRIM to do the entire SSD for operating systems that don't do this as necessary, or for a SSD behind a RAID controller, then it just takes longer, because it has to do the entire disk.

The wiper and other utilities are all pretty front ends to a low-level command.   Now some SSDs do have vendor-specific commands that do other "things", but due to non-disclosures, I can't get into their secret sauce, but that is why you have manufacturer utilities.  Also, older SSDs have a vendor-specific TRIM and may or may not have a firmware update that uses the standard TRIM command.  The ANSI spec has also defined a few bits & bytes so they (we) can write code to query a SSD and see whether or not the feature is compliant and get some parameters.

As for DavisMcCarm - The block sizing is actually much more complicated, and appropriate rules vary depending on the device & OS.  OCZ and LINUX if you have the correct kernel that TRIMs erased blocks as you delete files ... for 512KB alignment.  IN general windows NTFS is best with 64KB.   Put anything behind a RAID controller, and then you have to do some math and testing.

McKnifeAuthor Commented:
dlethe, I repeat, no raid (and ntfs of course since at least vista and 2008 cannot be installed on fat32).

Let me for a last time try to come back to the essential question: are there tools that will allow legacy OS' to use the trim command? If you know tools that can handle all SSDs, no matter what make or model, please name those (I don't think there are any).
If you know tools by other companies than Intel and GSkill which I supplied, please name those, too.
To follow BigSchmuh's thought with different drives sharing the same controllers (and therefore being able to use the same tools), I would like to see more of those tools.

Let's try to avoid sliding into a general discussion about technical ssd issues and performance.
Please find my conclusions about this TRIM for legacy OS topic:
1/ No SSD can be TRIMed if its firmware is not "TRIM capable"
Samsung controller based SSD may look at some Corsair firmware...but I doubt it will work "as is"
==> Some happy few may think of modifying the firmware...a very common case on the cellular scene

2/ Finding an OS that allows to send TRIM commands AND allows to read the legacy OS filesystem
  • Legacy OS storage drivers may not support to send any TRIM command to the drives...but most IDE drivers looks like being able to send those TRIM commands
  • It looks like most non-IDE storage drivers are filtering out TRIM commands...checks from the storage controller manufacturer (Intel ICH, AMD, NVidia nForce, LSI, Adaptec, Areca, ...)
==> A TRIM utility (Indilinx controller based SSD, Intel's) can be launched using a bootable USB / CD / Diskette...but it HAS to be very well aware of the OS filesystem otherwise it can't detect the sectors to be TRIMed

3/ Alternativesa) Low level formats
The SATA commands involved may lead the SSD firmware to erase all the SSD pages...allowing it to start with "as new" performance

b) DIY solution
Some nice work has already been achieved:
==> Whose reader who has time to mix those codes will do it ?
BigSchmuh - #2 is not correct, or we are talking about different things.  TRIM refers to an ATA-8 low-level command.   This can be sent to a target device in any operating system if one writes a program to do so, for a range of blocks.   So what you probably mean is that some operating systems automatically send the TRIM command for blocks that are deleted as they are deleted.  

The reason that non-IDE storage drivers filter out TRIM commands, like in case of the RAID drivers you mention, is that when the target "device" is a logical RAID volume, then the host O/S has no idea  how it is mapped, so it can not send it out.   This is exactly how it is supposed to be.  When you have a RAID5 volume, and get a drive failure, the logical disk is still online, it just runs slower.  

TRIM is NOT implemented in the RAID controllers, because the RAID controllers themselves, are not generally aware of file systems. They just worry about blocks of data.  Making a RAID controller aware of what file system you are using is a big, complicated problem, and has a big performance penalty.  Also since RAID controllers can happily rebuild a drive failure and export more than one logical volume, and support systems that may have Windows, LINUX, and Solaris logical drives all at the same time, then you just have a complicated problem.  

A TRIM utility does NOT have to have any knowledge of the operating system. I know this for a fact, because I have written such utilities.  YOu can tell the SSD programmatically to TRIM the SSD starting and ending at certain block numbers.  You can also do this to SSDs behind RAID controllers. Again, I know this can be done, because I have done so with LSI controllers.

"A TRIM utility does NOT have to have any knowledge of the operating system.<...>TRIM the SSD starting and ending at certain block numbers."
The only way to know whose block numbers are to be to be aware of the OS filesystem.
==> Don't forget that only deleted sectors are to be TRIMed

Regarding RAID, the author replied this is out of scope...otherwise, I would have insist that this is NOT possible...even on Raid 0 or 1 because you would have to make the raid stripe size equals to the OS io size.

By non-IDE storage drivers, I was more referring to AHCI drivers where, up to my knowledge, Intel RST is the only one supporting to pass TRIM commands through the drive. May be you are correct here and some other AHCI storage drivers allows to pass those TRIM commands (not automatically from Windows 7 for sure) from a dedicated utility.
Davis McCarnConnect With a Mentor OwnerCommented:
It isn't free and is also brand new; but, you might check this out:
And, for other aspects of SSD's, try this:
Don't forget that only deleted sectors are to be TRIMed
- True, but one can simply send the command and the SSD will go through the garbage cleanup regardless.  it already *knows* what sectors need to be cleaned up, and does not need to worry about the file system.  Think about it, what if the SSD is partitioned into NTFS, and ufs file system?  Does a SSD even know what operating system(s) are using it?  heck no.  

Probably don't want to get much deeper into RAID TRIM, and the specifics of it, just suffice to say, I've coded an app myself for an appliance vendor to do this, which supports all operating systems, but the program runs from Solaris just because that was what they paid me to do, but i can pretty much port it to any operating system.  This was NOT using an ACHI-based fake-raid controller.  My project was for LSI-based controller(s).
@dlethe: Any TRIM utility has to know the OS filesystem to send to the SSD which sectors can be erased. So I think you can agree that my #2 was correct....(please re-read it before posting)
@BigSchmuh, understood, you would *think* you need to know what sectors contain live data, so you do not destroy it during garbage collection ... But, darn, trying not to give away secret sauce, just ask yourself how one can possibly TRIM a range of blocks without knowing anything about a file system, and then you will know how I did it.
-Stop all applications
-Purge/Archive unneeded files
-Empty the trashbin
-Read the available drive space
-Create an enormous uninitialized ("delete on close" flag) file to catch all this space
-Sending a TRIM command to all of the range of sectors of this file requires Windows functions that are very well aware of the OS filesystem...
-Close the file

Well, I can't imagine another solution...that explains why dlethe is a EE genius ;-)
McKnifeAuthor Commented:
My conclusion:

There are forum (not here) entries which say trim is important, there are others (amongst those wikipedia) that say trim is no longer important due to firmware impovements of the garbage collection function. The opinions differ a lot.

To be sure, we will buy drives with indilinx controllers to be able to use wiper.exe if performance does indeed degrade. Dividing points won't be easy here.

Part 1) What I was looking for where tools like wiper - BigSchmuh taught me, wiper will work on many indilinx', Davis McCarn has linked a tool that claims to be able to suit different brands - I requested a trial.

Part 2) dlethe hit it best.

Thanks to all of you.
McKnifeAuthor Commented:
Part 1) What I was looking for where tools like wiper - BigSchmuh taught me, wiper will work on many indilinx', Davis McCarn has linked a tool that claims to be able to suit different brands - I requested a trial.

Part 2) dlethe hit it best.

Thanks to all of you.
All Courses

From novice to tech pro — start learning today.