如果我有非英特尔/三星,我是否需要启用TRIM

我在其中一篇webupd8文章中读到,在Ubuntu 14.04中引入的TRIM支持,默认只适用于Intel和Samsung SSD。 其他呢? 我使用的是戴尔XPS 13 Dev Edition笔记本电脑,SSD来自不同的制造商,默认情况下TRIM也可以工作,或者我必须手动制作一个cron作业文件?

一切都已经安装好了。

激活修剪1次的命令:

sudo fstrim -v / 

这需要一段时间,然后显示结果。 例:

 sudo fstrim -v / [sudo] password for rinzwind: /: 93184647168 bytes were trimmed 

并且默认设置为每周运行一次 – 支持的设备 – :

 $ locate fstrim /etc/cron.weekly/fstrim /sbin/fstrim 

如果您检查cron作业,则会解释:

 $ more /etc/cron.weekly/fstrim #!/bin/sh # call fstrim-all to trim all mounted file systems which support it set -e # This only runs on Intel and Samsung SSDs by default, as some SSDs with faulty # firmware may encounter data loss problems when running fstrim under high I/O # load (eg https://launchpad.net/bugs/1259829). You can append the # --no-model-check option here to disable the vendor check and run fstrim on # all SSD drives. exec fstrim-all 

如果手动方法有效,则可以在末尾的命令( exec fstrim-all )中添加--no-model-check以激活它。


文件中的链接是一个有趣的读物。 它还有一种方法来检查您的光盘是否被窃听 。 许多便宜的SSD都有问题,可能会破坏数据。


最重要的是 : 这是包含SSD 的兼容硬件 (PDF下载) 列表 。


还有另一种方法可以在fstab中添加discard以进行永久性修剪。 基准 (德国)倾向于fstrim而不是丢弃 。

您还可以强制TRIM(在ext4 / xfs等文件系统上)将discard添加到/ etc / fstab条目的选项中。 例如我的是:

 /dev/sda3 / ext4 errors=remount-ro,discard 0 1 

如果使用cryptsetup(对于dmcrypt),您还可以在/ etc / crypttab中添加discard以强制TRIM。 就像是:

 sda3_crypt UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx none luks,discard