MAC OS X 10.9.X下用命令行开启SSD trim的方法汇总
人气:0网上搜的好多都是以前的老方法,并不支持10.9系统。我前两天升级了10.9.2,今天突然发现trim状态已经被重置为 否 了,上次从10.9到10.9.1是没有重置的。刚刚我在百度搜“trim 命令行”,出来第一个是一篇人人的文章,试了,没用。后来辗转多地,才找到以下方法,亲测可用:
一、10.9 10.9.1 10.9.2 10.9.3开启SSD trim的方法
打开终端,输入以下命令:
1. 为了安全,此步为备份驱动(按照提示输入密码)
sudo cp -r /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/ /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.BACKUP
2. 开启trim
sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x54)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage
3.清理缓存
sudo kextcache -system-prelinked-kernel
sudo kextcache -system-caches
sudo kextcache -system-caches
5. 重启系统。
重启之后,进入 左上角小苹果=》关于本机=》更多信息=》系统报告=》SATA/SATA Express 在右侧选择你的SSD,查看下面的“TRIM支持”项的值即可。
看,你的TRIM已经被打开了!
二、10.9.4、10.9.5开启SSD trim的方法
1. 备份
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
/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
2. 修改文件
sudo perl -p0777i -e <a href="mailto:'s@((?:Rotational|WakeKey\x0a)\x00{1,20})APPLE">'s@((?:Rotational|WakeKey\x0a)\x00{1,20})APPLE</a> SSD(\x00{1,20}[QMT])@$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2@' \
/System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage
/System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage
3. 创建系统内核拓展文件夹
sudo touch /System/Library/Extensions/
4. 重启
加载全部内容