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

Nik*_*nov 15 ssd trim

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

Rin*_*ind 21

一切都已经安装好了。

激活修剪 1 次的命令:

sudo fstrim -v /
Run Code Online (Sandbox Code Playgroud)

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

sudo fstrim -v /
[sudo] password for rinzwind: 
/: 93184647168 bytes were trimmed
Run Code Online (Sandbox Code Playgroud)

默认情况下,它被设置为每周为支持的设备运行一次:

$ locate fstrim
/etc/cron.weekly/fstrim
/sbin/fstrim
Run Code Online (Sandbox Code Playgroud)

如果您检查 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 (e. g.  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
Run Code Online (Sandbox Code Playgroud)

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


文件中的链接很有趣。它还有一种方法可以检查您的光盘是否被窃听。许多便宜的 SSD 都有故障,可能会破坏数据。


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


还有另一种方法可以添加discard到 fstab 以进行永久修剪。基准(德语)支持 fstrim 而不是discard