Solved

Trim support (for SSD drives) on legacy OS

Posted on 2010-09-21
19
2,290 Views
Last Modified: 2012-05-10
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).
0
Comment
Question by:McKnife
  • 6
  • 6
  • 4
  • +2
19 Comments
 
LVL 47

Expert Comment

by:dlethe
Comment Utility
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.


0
 
LVL 47

Assisted Solution

by:dlethe
dlethe earned 150 total points
Comment Utility
P.s. forgot the link,  http://www.ssd-reviews.com
0
 
LVL 18

Expert Comment

by:BigSchmuh
Comment Utility
TRIM is not a mandatory feature...it 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.
0
 
LVL 53

Author Comment

by:McKnife
Comment Utility
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.
0
 
LVL 18

Accepted Solution

by:
BigSchmuh earned 175 total points
Comment Utility
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...
0
 
LVL 11

Expert Comment

by:ocanada_techguy
Comment Utility
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 http://www.networkcomputing.com/backup-recovery/ssd-reliability-shouldnt-be-an-issue.php
Issues using it with Windows http://reviews.cnet.com/laptop-hard-drives/intel-x-25m-solid/4505-9997_7-33244343.html
http://reviews.cnet.com/laptop-hard-drives/intel-x-25m-solid/4864-9997_7-33244343-1.html?ord=creationDate+desc&tag=uoBody

PassMark has drive benchmarking and compiles myriads of tests results for comparisons, SSDs included.
http://www.harddrivebenchmark.net/hdd_list.php
the Samsung MMC28 and 64 are found, but not the 32 (needs at least two to appear)
To benchmark yourself http://www.passmark.com/products/pt.htm   http://www.passmark.com/products/pt_advdisk.htm
0
 
LVL 42

Expert Comment

by:Davis McCarn
Comment Utility
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: http://www.wwpi.com/index.php?option=com_content&view=article&id=8840:ssd-storage-demands-proper-partition-alignment&catid=99:cover-story&Itemid=2701018
0
 
LVL 47

Expert Comment

by:dlethe
Comment Utility
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.

0
 
LVL 53

Author Comment

by:McKnife
Comment Utility
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.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 18

Expert Comment

by:BigSchmuh
Comment Utility
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 ?
0
 
LVL 47

Expert Comment

by:dlethe
Comment Utility
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.

0
 
LVL 18

Expert Comment

by:BigSchmuh
Comment Utility
"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 TRIMed...is 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.
0
 
LVL 42

Assisted Solution

by:Davis McCarn
Davis McCarn earned 175 total points
Comment Utility
It isn't free and is also brand new; but, you might check this out: http://www.lc-tech.com/SSD/
And, for other aspects of SSD's, try this: http://ssdtweaker.sourceforge.net/
0
 
LVL 47

Expert Comment

by:dlethe
Comment Utility
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).
0
 
LVL 18

Expert Comment

by:BigSchmuh
Comment Utility
@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)
0
 
LVL 47

Expert Comment

by:dlethe
Comment Utility
@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.
0
 
LVL 18

Expert Comment

by:BigSchmuh
Comment Utility
-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 ;-)
0
 
LVL 53

Author Comment

by:McKnife
Comment Utility
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.
0
 
LVL 53

Author Closing Comment

by:McKnife
Comment Utility
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.
0

Featured Post

Network it in WD Red

There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  

Join & Write a Comment

As hardware bugs go, this is a strange one! I upgraded a laptop in December 2011 with a 512GB Crucial m4 2.5-inch/9.5mm SATA Solid State Drive (SSD), Crucial part number CT512M4SSD2: http://www.crucial.com/store/partspecs.aspx?IMODULE=CT512M4SSD2 …
More or less everybody in the IT market understands the basics of Networking, however when we start talking about Storage Networks, things get a bit dizzier, and this is where I would like to help.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now