How to Enable TRIM on Third Party SSDs in Mac OS X with trimforce
For Mac users who utilize third party SSD volumes, the new trimforce command allows OS X to forcibly enable the TRIM function on those drives. trimforce is built directly into newer releases of OS X and is really quite easy to enable (or disable), requiring a quick visit to the command line and a reboot of the Mac to complete.
To be able to enable TRIM on non-Apple SSD volumes with the trimforce command, the Mac will need a third party SSD, and to be running either OS X El Capitan 10.11.x or OS X Yosemite 10.10.4 or later versions, the command does not exist in prior releases of OS X (though earlier versions of OS X can use the third party TRIM Enabler utility).
Be sure to back up before using the TRIM command, whether with Time Machine or your complete backup method of choice, and continue to back up your data on a regular basis, as using trimforce could potentially cause data loss or an issue. Apple specifically states in the command that the tool is not warrantied, and therefore it’s up to the user to risk using the feature or not.
It may go without saying, but do note that TRIM is enabled automatically by default for all Apple SSDs, meaning if your Mac shipped with an SSD drive installed from Apple, this is not a necessary utility. trimforce is aimed specifically at users who are using third party SSD drives with their Macs. Likewise, TRIM does not work on standard spinning hard drives, and thus is not necessary in those situations either. Finally, some SSD products come with their own built-in garbage collection functions, negating the need for TRIM.
How to Enable TRIM on Third Party Drives in OS X with trimforce
Did you complete a backup yet? Don’t attempt to enable TRIM without doing so. When you’ve done that, launch Terminal from /Applications/Utilities/ and enter the following command string:
sudo trimforce enable
Hit return and enter the administrator password, you’ll be presented with the following message reminding you the utility has no warranty and that you should backup your data. Don’t ignore this advice.
“IMPORTANT NOTICE: This tool force-enables TRIM for all relevant attached devices, even though such devices may not have been validated for data integrity while using TRIM. Use of this tool to enable TRIM may result in unintended data loss or data corruption. It should not be used in a commercial operating environment or with important data. Before using this tool, you should back up all of your data and regularly back up data while TRIM is enabled. This tool is provided on an “as is” basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THIS TOOL OR ITS USE ALONE OR IN COMBINATION WITH YOUR DEVICES, SYSTEMS, OR SERVICES. BY USING THIS TOOL TO ENABLE TRIM, YOU AGREE THAT, TO THE EXTENT PERMITTED BY APPLICABLE LAW, USE OF THE TOOL IS AT YOUR SOLE RISK AND THAT THE ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY AND EFFORT IS WITH YOU.
Are you sure you wish to proceed (y/N)?”
Assuming you’re OK with the risk, hit Y to proceed and follow the instructions, hitting Y again to enable TRIM. Enabling TRIM by using the trimforce command requires the Mac to reboot, which will happen automatically once the feature is enabled or disabled. When you see the “Operation succeeded” message, the Mac will soon reboot with TRIM enabled.
Disabling TRIM in Mac OS X with trimforce
If you want to turn off the TRIM feature within OS X on this party volumes, you simply need to change the trimforce command to disable instead:
sudo trimforce disable
Again, the Mac will need to reboot to complete the process of disabling TRIM.
If you want to learn more about TRIM and how it helps SSDs function, you can read a bit more technical details on the Wikipedia page for the TRIM feature.