在 ubuntu 14.04 上,如何检查 SSD 驱动器的 TRIM 是否已打开?还有其他值得验证的 SSD 驱动器设置吗?
答案1
要查看每周 cron 作业的详细信息,请将目录更改为/etc/cron.weekly
或将其包含在命令中,如下所示:
more /etc/cron.weekly/fstrim
您应该看到类似如下的输出:
#!/bin/sh
# trim all mounted file systems which support it
/sbin/fstrim --all || true
如果存在,则 trim 每周激活/检查并执行一次。此命令的帮助将显示...
fstrim --help
Usage:
fstrim [options] <mount point>
Options:
-a, --all trim all mounted filesystems that are supported
-o, --offset <num> the offset in bytes to start discarding from
-l, --length <num> the number of bytes to discard
-m, --minimum <num> the minimum extent length to discard
-v, --verbose print number of discarded bytes
-h, --help display this help and exit
-V, --version output version information and exit
查看是否支持 trim(如果有多个磁盘则更改 sda):
sudo hdparm -I /dev/sda | grep "TRIM supported"
它应该显示类似这样的内容:
* Data Set Management TRIM supported (limit 8 blocks)