今天同事告诉我,换了 ssd 之后需要做以下配置能使 ssd 寿命更长。原理是配置系统定期清理和回收 ssd 的资源。

  最终效果:

  步骤:

    1、下载 trim enabler: https://gist.github.com/return1/4058659

    2、解压后内容如下:

#
# Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/)
# Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/
#
# Looks for "Apple" string in HD kext, changes it to a wildcard match for anything
#
# Alternative to http://www.groths.org/trim-enabler-3-0-released/
# Method behind this madness described: http://forums.macrumors.com/showthread.php?t=1409151&page=4
# See discussion in comments here: https://www.macupdate.com/app/mac/39654/lion-tweaks
# And here: http://forums.macrumors.com/showthread.php?t=1410459
# And here: http://forums.macrumors.com/showthread.php?t=1480302
#
# Yosemite: for recovering from stop sign on boot screen, please see http://www.cindori.org/update-on-trim-in-yosemite/ # backup patched file
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 # For Yosemite you have to disable driver signature check
sudo nvram boot-args="kext-dev-mode=1" # !for Yosemite only! please reboot after settings the boot-args!
sudo shutdown -r now # for Yosemite, Mavericks 10.9.5 and 10.9.4 (thanks Tobi)
sudo perl -pi -e 's|(^\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 # !for Yosemite only! rebuild kext cache manually (could take a while)
sudo kextcache -m /System/Library/Caches/com.apple.kext.caches/Startup/Extensions.mkext /System/Library/Extensions # for Mavericks and Mountain Lion from 10.8.3 to 10.9.3
#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 # for Mountain Lion from 10.8.1 to 10.8.2 and Lion 10.7.5
#sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x4D)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage # for Mountain Lion 10.8.0 and Lion 10.7.4 BELOW
#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 sudo touch /System/Library/Extensions/ # now reboot!
sudo shutdown -r now

    3、Terminal 输入:

      1) 修改此文件属性 "chmod 777 该 .sh 文件保存路径"

      2) 运行"该 .sh 文件路径",只时候电脑会自动重启。

        3) 重启后,注释掉 .sh 文件的前三行,已经执行了的语句。再运行一次该 .sh 文件,电脑会再执行一次重启操作。

    4、打开磁盘工具优化磁盘的使用:

SSD Trim Support -- 保护 SSD的更多相关文章

  1. 关于SSD Trim功能

    TRIM指令是微软联合各大SSD厂商所开发的一项技术,属于ATA8-ACS规范的技术指令.   TRIM是告诉NAND闪存固态存储设备要擦除哪些数据的SATA接口指令.当相关页面的数据可以被覆盖时,操 ...

  2. Yosemite 升级后第三方SSD TRIM失败不能进入系统处理

    no zuo no die, 这把手欠升级到了Yosemite, 然后发现原来在Mavericks里已经激活的TRIM在这里不行了, 又提示trim enable软件不适于此版本. 然后,悲剧就开始了 ...

  3. SSD trim及4k对齐

    trim可以帮助减小SSD的写放大WA问题,删除文件后不仅仅是将文件标记为删除,而是在SSD空闲的时候统一进行删除. Linux下的trim支持叫discard,修改fstab文件,在挂载参数中加上d ...

  4. SSD TRIM

    SSD 在操作方式上与传统磁性驱动器不同,并且它们需要在软件上另行处理以达到功能优化.-- Don Watkins 编译自: https://opensource.com/article/17/1/s ...

  5. 保护SSD,设置Chrome浏览器临时文件夹到ramdisk分区

    很多用低端/山寨SSD的朋友都用Ramdisk来保护硬盘,一般都把系统temp目录和IE浏览器临时文件夹目录设到Ramdisk分区了.      最近用谷歌的chrome浏览器,发现浏览网页时候硬盘灯 ...

  6. Vmware Vsan 部署中如何将非SSD 硬盘标识为SSD

    通过SSH 登录ESXi主机 # esxcli storage nmp device list #查询ESXI 发现的存储设备 #   esxcli storage nmp satp rule add ...

  7. Linux判断SSD或HDD + 模拟SSD

    判断方法 方法一 判断cat /sys/block/*/queue/rotational的返回值(其中*为你的硬盘设备名称,例如sda等等),如果返回1则表示磁盘可旋转(HDD),返回0,则表示磁盘不 ...

  8. CentOS7 vs centos6

    The CentOS Project has announced general availability of CentOS-7, the first release of the free Lin ...

  9. SSD 固态硬盘,Trim指令 ,查看状态、开启、关闭

    一说到SSD 固态硬盘,经常会看到Trim指令这个名词,那什么是Trim?   Trim是什么? 为了解决硬盘降速的问题,微软联合各大SSD厂商开发了一个新技术——Trim.Trim指令也叫disab ...

随机推荐

  1. [Linux]使用PHP编写Gearman的Worker守护进程

    在我之前的文章中,介绍过Gearman的使用.在我的项目中,我使用了PHP来编写一直运行的Worker.如果按照Gearman官方推荐的例子,只是简单的一个循环来等待任务,会有一些问题,包括:1.当代 ...

  2. Excel 回归分析

    1 分析两个变量和一个因变量的关系 降水,温度与生长的关系曲线 降水是连续的数,温度有三个温室,每个温室一个温度,生长也是连续的数. 作图的方法是将降水放在一列,然后生长根据温度放三列,同一个温度的放 ...

  3. Something about pip in Python

    学习python爬虫框架scrapy的时候,用到pip管理工具来安装scrapy.最直观的感受,pip有点类似于Ubuntu下的apt-get工具,几行代码,自动下载.安装相关的东西.网上查了一些背景 ...

  4. php多进程

    增加 pcntl扩展pcntl扩展可以支持php的多线程操作(仅限linux系统)加载 pcntl 有两种方式一种重新编译安装,在编译时加,configrue提示加上--enable-pcntl./c ...

  5. Power BI for Office 365(一)移动端应用

    此篇来自于微软商业智能网站的官方博客团队发布的Power BI在线资料其中的一部分,完整版地址: http://office.microsoft.com/en-us/office365-sharepo ...

  6. CLR VIA C# 学习笔记

    第19章 可空类型 1)使用Nullable<T>可将int32的值类型设置为Null,CLR会在Null时默认赋值为0; 如:Nullable<T> x=null; //使用 ...

  7. 爱特梅尔ATMEL全系列芯片解密单片机破解

    爱特梅尔ATMEL全系列芯片解密单片机破解 ATMEL芯片介绍: ATMEL公司为全球性的业界领先企业,致力于设计和制造各类微控制器.电容式触摸解决方案.先进逻辑.混合信号.非易失性存储器和射频 (R ...

  8. 浏览器-04 WebKit 渲染2

    渲染主循环(main loop)和requestAnimationFrame requestAnimationFrame 使用requestAnimationFrame而非setTimeout/set ...

  9. 【BZOJ1671】[Usaco2005 Dec]Knights of Ni 骑士 BFS

    [Usaco2005 Dec]Knights of Ni 骑士 Description  贝茜遇到了一件很麻烦的事:她无意中闯入了森林里的一座城堡,如果她想回家,就必须穿过这片由骑士们守护着的森林.为 ...

  10. Leetcode Anagrams

    Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will be ...