与 SMART 日志一样:
设备日志仅包含最近的五个错误
是否有可能查看启用 SMART 的磁盘的所有记录错误?
smartctl -xall
或者
smartctl -all
上面的两个命令只显示最后五个,我需要检索有问题的 LBA 以向其中写入零并再次检查 SMART。
答案1
如果您已经安装smartmontools
并启用,smartd
则所有日志条目均可在以下位置获得/var/log/syslog
:
grep "smartd" /var/log/syslog*
为了/dev/sda
grep "smartd.*/dev/sda" /var/log/syslog*
另一个例子:
$ grep "smartd.*/dev.*failure" /var/log/syslog*
/var/log/syslog:May 14 10:46:58 sturm smartd[608]: Device: /dev/sda [SAT], SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 120 to 104
/var/log/syslog:May 14 10:46:58 sturm smartd[608]: Device: /dev/sdb [SAT], SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 117 to 119
/var/log/syslog.1:May 13 05:30:33 sturm smartd[631]: Device: /dev/sdb [SAT], SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 110 to 113
/var/log/syslog.1:May 13 11:19:26 sturm smartd[651]: Device: /dev/sdb [SAT], SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 113 to 115
/var/log/syslog.1:May 13 11:49:26 sturm smartd[651]: Device: /dev/sda [SAT], SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 120 to 100
/var/log/syslog.1:May 13 11:49:26 sturm smartd[651]: Device: /dev/sdb [SAT], SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 115 to 117
/var/log/syslog.1:May 13 15:49:27 sturm smartd[651]: Device: /dev/sda [SAT], SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 100 to 102
/var/log/syslog.1:May 13 19:49:26 sturm smartd[651]: Device: /dev/sda [SAT], SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 102 to 104
/var/log/syslog.1:May 14 10:16:58 sturm smartd[608]: Device: /dev/sda [SAT], SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 104 to 120
答案2
我相信驱动器本身的日志仅包含最后 5 个错误。如果您想查看 LBA,可以从终端窗口运行 badblocks。
sudo badblocks -sv /dev/sdX
这将对您的驱动器运行完整的表面检查并显示任何坏块的位置。