我只是尝试在我的硬盘上运行测试,但它不想完成自测。结果如下:
smartctl --attributes --log=selftest /dev/sda
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x002f 200 200 051 Pre-fail Always - 697
3 Spin_Up_Time 0x0027 206 160 021 Pre-fail Always - 691
4 Start_Stop_Count 0x0032 074 074 000 Old_age Always - 26734
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail …Run Code Online (Sandbox Code Playgroud) 我们有一台已经使用了 3 年的 Linux 服务器。我们在其上运行了许多虚拟化服务器,其中一些表现不佳,并且在很长一段时间内超出了服务器的 io 容量,导致 iowait 错误。它有 4 个 500gb 的 Barracuda sata 驱动器连接到 3com raid 控制器。1个驱动有操作系统,其他3个设置raid-5。
现在我们就驱动器的状况以及它们是否正在积极发生故障进行辩论。
这是 4 个磁盘中 1 个的部分输出。他们都有相对相似的统计数据:
SMART 属性数据结构修订号:10 具有阈值的供应商特定 SMART 属性: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x000f 118 099 006 总是预失败 - 169074425 3 Spin_Up_Time 0x0003 095 092 000 总是预失败 - 0 4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 26 5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0 7 Seek_Error_Rate …
我的 Linux 系统开始在系统日志中抛出 SMART 错误。我追踪了它并相信问题出在磁盘上的单个块上。我如何轻松地让磁盘重新分配那个块?我想知道在这个过程中哪个文件被破坏了。(我知道,如果磁盘上的一个块出现故障,其他块可能会出现故障;我有一个很好的持续备份,只想尝试保持该磁盘正常工作。)
在网上搜索会找到坏块 HOWTO,它描述了卸载磁盘上的手动过程。这看起来很复杂而且容易出错。是否有工具可以在 Linux 中自动执行此过程?我唯一的其他选择是制造商的诊断工具,但我认为这会破坏坏块而没有任何关于被破坏的东西的报告。最坏的情况,可能是文件系统元数据。
有问题的磁盘是主系统分区。使用 ext3fs 和 LVM。这是来自 syslog 的错误日志和来自 smartctl 的相关位。
smartd[5226]: Device: /dev/hda, 1 Currently unreadable (pending) sectors
Error 1 occurred at disk power-on lifetime: 17449 hours (727 days + 1 hours)
... Error: UNC at LBA = 0x00d39eee = 13868782
Run Code Online (Sandbox Code Playgroud)
pastebin上有一个完整的 smartctl 转储。
smartctl 工具允许启动长时间的自检 ( smartctl -t long /dev/sda)。但是badblocks,我也可以在驱动器上运行。两者有什么关系?如果 badblocks 检测到坏块,驱动器是否会自动更新其 SMART 值(例如,通过更新其重新定位的扇区数)?坏块可以代替smartctl -t long,反之亦然?
我刚刚按如下方式配置了 Debian 服务器
apt-get install smartmontools
vi /etc/default/smartmontools - 在这里取消注释这两行
# uncomment to start smartd on system startup
start_smartd=yes
# uncomment to pass additional options to smartd on startup
smartd_opts="--interval=1800"
然后我编辑了 /etc/smartd.conf 并只取消了这一行的注释
DEVICESCAN -S on -o on -a -m myemail@mydomain.com -s (S/../.././02|L/../../6/03)
我想知道这是否足以让系统在出现问题时向我发送警报消息和/或是否有办法模拟问题并查看 smartd 是否通过电子邮件向我发送警告。
“SMART 使用属性:194 Temperature_Celsius 从 146 更改为 150”。这是在 CentOS 6.6 上。
这到底是什么意思?驱动器真的很热还是这可能是软件错误?该驱动器是 eSATA 2TB 驱动器,摸起来很凉爽,位于地下室的服务器为 70F。
# smartctl -A /dev/sdb
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-504.16.2.el6.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000b 100 100 016 Pre-fail Always - 0
2 Throughput_Performance 0x0005 134 134 054 …Run Code Online (Sandbox Code Playgroud) 我的 NAS 盒中有 6 个驱动器。其中两个是希捷,他们返回高 RAW_VALUES 错误;见下文。
我的其他驱动器显示的值要低得多。
这是报警的原因吗?或者只是希捷报告的方式?
看看Raw_Read_Error_Rate和Seek_Error_Rate:
# smartctl -a /dev/ada1
=== START OF INFORMATION SECTION ===
Device Model: ST3000DM001-9YN166
Serial Number: W1F09S26
LU WWN Device Id: 5 000c50 0456076fc
Firmware Version: CC4C
User Capacity: 3,000,592,982,016 bytes [3.00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: 8
ATA Standard is: ATA-8-ACS revision 4
Local Time is: Sat Aug …Run Code Online (Sandbox Code Playgroud) SMART 指出我服务器硬盘上的一个待处理扇区。我已经阅读了很多推荐使用 hdparm 来“轻松”强制磁盘重新定位坏扇区的文章,但我找不到正确的使用方法。
我的“smartctl”中的一些信息:
Error 95 occurred at disk power-on lifetime: 20184 hours (841 days + 0 hours)
When the command that caused the error occurred, the device was active or idle.
After command completion occurred, registers were:
ER ST SC SN CL CH DH
-- -- -- -- -- -- --
40 51 00 d7 55 dd 02 Error: UNC at LBA = 0x02dd55d7 = 48059863
Commands leading to the command that caused the error were:
CR FR …Run Code Online (Sandbox Code Playgroud) 我使用 SMART 自检来测试我所有的硬盘驱动器和 SSD。我每天进行一次短期测试,每月进行一次长期测试。
我的一个 SSD 显示出奇怪的行为,因为生命周期时间似乎重置为零。这是正常的吗?为什么要这样做?我以前从未见过这种行为。这是一个令人担忧的原因吗?
我用来启动测试的命令(通过 crontab 启动的脚本)是:
smartctl --test=short $DISK
Run Code Online (Sandbox Code Playgroud)
这是显示奇怪行为的错误日志的副本:
smart self-test log structure revision number 1
num test_description status remaining lifetime(hours) lba_of_first_error
# 1 short offline completed without error 00% 110 -
# 2 short offline completed without error 00% 86 -
# 3 short offline completed without error 00% 62 -
# 4 short offline completed without error 00% 38 -
# 5 short offline completed without error 00% 14 -
# 6 short …Run Code Online (Sandbox Code Playgroud) 我在 Dell R720xd 和 PERC H710P 上的 MegaCli 收到奇怪的 SMART 错误,RAID5 中有五个 4Tb SATA 驱动器
/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL
Run Code Online (Sandbox Code Playgroud)
给我一些“Failure Seq Event Number”
Slot Number: 4
...
Last Predictive Failure Event Seq Number: 7309
...
Inquiry Data: PK2361PAGAZU8WHitachi HUS724040ALE640 MJAOA3B0
...
Drive has flagged a S.M.A.R.T alert : Yes
Run Code Online (Sandbox Code Playgroud)
但是 smartctl 根本没有提供驱动器有什么问题的线索:
# smartctl -a -d sat+megaraid,4 /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.32-279.19.1.el6.x86_64] (local build)
...
Serial Number: PK2361PAGAZU8W # Note same serial, no mistake
...
SMART support is: Available - …Run Code Online (Sandbox Code Playgroud)