{"id":687,"date":"2011-09-02T11:14:37","date_gmt":"2011-09-02T11:14:37","guid":{"rendered":"http:\/\/blog.designed79.co.uk\/?p=687"},"modified":"2011-09-27T10:05:00","modified_gmt":"2011-09-27T10:05:00","slug":"trim-enabler-for-lion","status":"publish","type":"post","link":"https:\/\/blog.designed79.co.uk\/?p=687","title":{"rendered":"TRIM Enabler for Lion"},"content":{"rendered":"<h3>TRIM Enabler for Lion<\/h3>\n<p><strong>Also works for 10.7.1. Note that there is no need to re-patch when applying 10.7.1 as the extension is not replaced during the update.<\/strong><\/p>\n<p>OK. Now that Lion\u2019s out, people want their SSD TRIM support back. I have one thing to say:<\/p>\n<p>DO NOT USE TRIM ENABLER (VERSION 1.1 OR 1.2) TO ENABLE TRIM ON LION.<\/p>\n<p>After a little inspection of this application, I found that instead of patching the file, it replaces an entire kernel extension. This means that when you use TRIM Enabler with Lion, it replaces a critical kernel extension, with lots of dependencies, with an older one (from Snow Leopard 10.6.8). This is bad. Very bad. While TRIM\u00a0<em>does<\/em>\u00a0become enabled, the kernel extension you now have has the potential to cause a ton of problems. That means anything from kernel panics, to disk I\/O delays\u2026and the dreaded spinning beach ball.<\/p>\n<p>After confronting the developer,\u00a0Oskar Groth (who I refuse to link to), via his blog\u2019s commenting system, I was told that I was simply trolling and spreading fear (even though I offered the alternative I share here). Apparently, the next version of TRIM Enabler will correctly patch the file, instead of replacing it, but that hasn\u2019t happened yet.<\/p>\n<p>So, here\u2019s the proper way to enable TRIM support. Run these commands in Terminal:<\/p>\n<p><strong>1. Backup the file we\u2019re patching<\/strong><\/p>\n<pre>sudo cp \/System\/Library\/Extensions\/IOAHCIFamily.kext\/Contents\/PlugIns\/IOAHCIBlockStorage.kext\/Contents\/MacOS\/IOAHCIBlockStorage \/System\/Library\/Extensions\/IOAHCIFamily.kext\/Contents\/PlugIns\/IOAHCIBlockStorage.kext\/Contents\/MacOS\/IOAHCIBlockStorage.original<\/pre>\n<p><strong>2. Patch the file to enable TRIM support<\/strong><\/p>\n<pre>sudo perl -pi -e 's|(\\x52\\x6F\\x74\\x61\\x74\\x69\\x6F\\x6E\\x61\\x6C\\x00).{9}(\\x00\\x51)|$1\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00$2|sg' \/System\/Library\/Extensions\/IOAHCIFamily.kext\/Contents\/PlugIns\/IOAHCIBlockStorage.kext\/Contents\/MacOS\/IOAHCIBlockStorage<\/pre>\n<p><strong>3. Clear the system kernel extension cache<\/strong><\/p>\n<pre>sudo kextcache -system-prelinked-kernel\r\n\r\nsudo kextcache -system-caches<\/pre>\n<p><strong>4. Now Reboot!<\/strong><\/p>\n<p><strong>a) If in the future you want to disable TRIM support<\/strong><\/p>\n<pre>sudo perl -pi -e 's|(\\x52\\x6F\\x74\\x61\\x74\\x69\\x6F\\x6E\\x61\\x6C\\x00).{9}(\\x00\\x51)|$1\\x41\\x50\\x50\\x4C\\x45\\x20\\x53\\x53\\x44$2|sg' \/System\/Library\/Extensions\/IOAHCIFamily.kext\/Contents\/PlugIns\/IOAHCIBlockStorage.kext\/Contents\/MacOS\/IOAHCIBlockStorage\r\n\r\nsudo kextcache -system-prelinked-kernel\r\n\r\nsudo kextcache -system-caches<\/pre>\n<p><strong>b) If something goes horribly wrong, restore the backup<\/strong><\/p>\n<pre>sudo cp \/System\/Library\/Extensions\/IOAHCIFamily.kext\/Contents\/PlugIns\/IOAHCIBlockStorage.kext\/Contents\/MacOS\/IOAHCIBlockStorage.original \/System\/Library\/Extensions\/IOAHCIFamily.kext\/Contents\/PlugIns\/IOAHCIBlockStorage.kext\/Contents\/MacOS\/IOAHCIBlockStorage<\/pre>\n<p>All this patch does is simply replace the string \u201cAPPLE SSD\u201d in the file IOAHCIBlockStorage with zeros. This happens to bypass the restriction of only allowing Apple branded SSDs. The backup of the original file is saved in the same directory as the original file.<\/p>\n<p>To check if it worked, open up About This Mac, click the \u201cMore Info\u2026\u201d button then the \u201cSystem Report\u201d button. In the list on the left, choose \u201cSerial-ATA\u201d. Click on your SSD Drive and in the lower half of the screen you should now see \u201cTRIM Support: Yes\u201d instead of \u201cNo\u201d.<\/p>\n<p>Remember, if you have an older generation SSD, the hardware itself may not support TRIM \u2026and therefore this patch won\u2019t help you. This patch bypasses the restriction put in place by Apple to restrict TRIM support to Apple branded SSD drives.<\/p>\n<p>You WILL need to re-apply this patch after each major update of OS X. That means for 10.7.1, 10.7.2, etc.<\/p>\n<p>Credit where credits due, unlike the\u00a0<em>other\u00a0<\/em>TRIM Enabler, I originally found this on the<a href=\"http:\/\/www.insanelymac.com\/forum\/index.php?s=&amp;showtopic=256493&amp;view=findpost&amp;p=1680183\">InsanelyMac forums by digital_dreamer<\/a><\/p>\n<p>As a note, the MD5 checksums for the original and patched file on 10.7.0 are as follows:<\/p>\n<p>Original: 155b426c856c854e54936339fbc88d72<br \/>\nModified: 945944136009c9228fffb513ab5bf734<\/p>\n<p>If you have already used the other TRIM Enabler, you can do the following:<br \/>\na) Attempt to copy and replace the extension from another Mac running the same version.<br \/>\nb) Attempt to copy and replace the extension from the Recovery partition (Open up Disk Utility and Mount Recovery HD)<br \/>\nc) Reinstall Lion<br \/>\nd) Wait it out till 10.7.1 and hope that the extension is replaced in the update (but it may not be), then re-patch the file<\/p>\n","protected":false},"excerpt":{"rendered":"<p>TRIM Enabler for Lion Also works for 10.7.1. Note that there is no need to re-patch when applying 10.7.1 as the extension [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[8,9,7,18],"class_list":["post-687","post","type-post","status-publish","format-standard","hentry","category-info-on-tech","tag-10-7","tag-lion","tag-osx","tag-trim"],"_links":{"self":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=687"}],"version-history":[{"count":0,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/687\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}