Back

Lion开启Trim指令支持

|

Mac OSX默认是支持SSD的Trim指令的,但是苹果仅对自家出厂的SSD硬盘开启Trim支持,也就是说系统会检测固态硬盘的详细参数,如果产品信息中有"Apple SSD"字样,Lion才会开启Trim支持。嗯,就是这样子的,苹果一向这么小家子气。
在论坛上流行一种Trim enabler的小工具,但是看到[这里](http://digitaldj.net/2011/07/21/trim-enabler-for-lion/)发现Trim enabler居然用Leopard里面的文件整个替换掉了Lion系统的SSD驱动。该文章给出了一个比较靠谱的方法,打开终端,输入以下口令:
[cc lang="bash"]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 #备份[/cc]
[cc lang="bash"]sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\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 #打补丁[/cc]
[cc lang="bash"]sudo kextcache -system-prelinked-kernel
sudo kextcache -system-caches #清空缓存[/cc]
重启。最后打开About This Mac中找到System Report. 在这个Report里面找到Serial ATA, 看看右侧的详细信息里面的TRIM Support是否为"Yes"。
换上SSD之后,就连XCode都是秒开,感觉很值。固态硬盘没有磁盘碎片的概念,如果你把SSD用在windows系统下,记得一定要关掉那个"在系统空闲时自动进行磁盘碎片整理"功能,不然硬盘会死得很快。

最后,ubuntu 12.04最新的长期支持版Precise Pangolin已经发布了,官方地址:/
目前很多源都没有同步完成,等个一两天就要升级了。我决定从服务器到本地虚拟机整个都升级一次,希望LTS版本之间的升级能够平滑一点。

No comments yet

Leave a comment

About me

I live in Tasmania, an island a little far from the rest of the world and very close to the sea.
Father of two little girls, have two puppies.

Work

Work in IT industry, AI is my working partner.