检查修剪是否有效的命令?

Mar*_*ius 4 trim

我已经安装了 Ubuntu 14.04 LTS 64 位,并希望确保启用 TRIM(据我所知 - 默认情况下启用)。是否有某种命令可以帮助我确定它是否正常工作?

小智 5

您可以执行sudo fstrim -v /(用其他挂载点替换“/”,如果有的话),检查 fstrim 是否给出任何错误。如果没有,输入cat /etc/cron.weekly/fstrimwhich 应该会给你一个输出,如:

#!/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 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 Like this (remove the hash):
#exec fstrim-all --no-model-check
exec fstrim-all
Run Code Online (Sandbox Code Playgroud)

如果是这样,则意味着您的 Ubuntu 会自动识别出您有一个 SSD,并将每周修剪一次作为 cron 作业。

如果您想针对 SSD 优化系统,请查看这篇文章