首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在实践中使用智能How?

如何在实践中使用智能How?
EN

Unix & Linux用户
提问于 2018-09-03 08:59:55
回答 2查看 5.5K关注 0票数 2

我只是随便用smartctl来窥视我的磁盘,而不是真正地潜入其中。在阅读了黑客新闻述评之后,我决定安排每日、短时和每周的长时间测试。

如何更好地利用它们?

当我查看smartctl -a /dev/sda的结果时,我看到了许多不太明显的信息:

代码语言:javascript
复制
# smartctl -a /dev/sda
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-32-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Crucial/Micron MX100/MX200/M5x0/M600 Client SSDs
Device Model:     Crucial_CT500MX200SSD4
Serial Number:    160311862C1C
LU WWN Device Id: 5 00a075 111862c1c
Firmware Version: MU03
User Capacity:    500,107,862,016 bytes [500 GB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    Solid State Device
Form Factor:      < 1.8 inches
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ACS-3 T13/2161-D revision 4
SATA Version is:  SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Mon Sep  3 10:49:49 2018 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x80) Offline data collection activity
                                        was never started.
                                        Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever
                                        been run.
Total time to complete Offline
data collection:                ( 1271) seconds.
Offline data collection
capabilities:                    (0x7b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine
recommended polling time:        (   2) minutes.
Extended self-test routine
recommended polling time:        (   7) minutes.
Conveyance self-test routine
recommended polling time:        (   3) minutes.
SCT capabilities:              (0x0035) SCT Status supported.
                                        SCT Feature Control supported.
                                        SCT Data Table supported.

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   100   100   000    Pre-fail  Always       -       0
  5 Reallocate_NAND_Blk_Cnt 0x0032   100   100   010    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       16446
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       44
171 Program_Fail_Count      0x0032   100   100   000    Old_age   Always       -       0
172 Erase_Fail_Count        0x0032   100   100   000    Old_age   Always       -       0
173 Ave_Block-Erase_Count   0x0032   094   094   000    Old_age   Always       -       139
174 Unexpect_Power_Loss_Ct  0x0032   100   100   000    Old_age   Always       -       29
180 Unused_Reserve_NAND_Blk 0x0033   000   000   000    Pre-fail  Always       -       5548
183 SATA_Interfac_Downshift 0x0032   100   100   000    Old_age   Always       -       0
184 Error_Correction_Count  0x0032   100   100   000    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
194 Temperature_Celsius     0x0022   058   049   000    Old_age   Always       -       42 (Min/Max 23/51)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   100   100   000    Old_age   Always       -       0
202 Percent_Lifetime_Used   0x0030   094   094   001    Old_age   Offline      -       6
206 Write_Error_Rate        0x000e   100   100   000    Old_age   Always       -       0
210 Success_RAIN_Recov_Cnt  0x0032   100   100   000    Old_age   Always       -       0
246 Total_Host_Sector_Write 0x0032   100   100   000    Old_age   Always       -       15420692355
247 Host_Program_Page_Count 0x0032   100   100   000    Old_age   Always       -       481912759
248 Bckgnd_Program_Page_Cnt 0x0032   100   100   000    Old_age   Always       -       1753257160

SMART Error Log Version: 1
No Errors Logged

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%     16446         -
# 2  Short offline       Completed without error       00%     10532         -
# 3  Short offline       Completed without error       00%      8040         -
# 4  Vendor (0xff)       Completed without error       00%      3608         -
# 5  Vendor (0xff)       Completed without error       00%       597         -
# 6  Vendor (0xff)       Completed without error       00%       585         -
# 7  Vendor (0xff)       Completed without error       00%       520         -
# 8  Vendor (0xff)       Completed without error       00%       161         -
# 9  Vendor (0xff)       Completed without error       00%        98         -
#10  Vendor (0xff)       Completed without error       00%        65         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Completed [00% left] (57881389-57946924)
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

具体来说,没有明确的迹象表明

  • 错误
  • 测试史

除了不时运行smartctl -a /dev/sdX并希望发现任何不寻常的事件之外,是否有最佳的分析实践?

EN

回答 2

Unix & Linux用户

发布于 2018-09-03 09:10:37

如果您已经配置了智能工具,以便它可以发送电子邮件,那么如果它发现了问题,就会收到电子邮件。

除此之外,在smartctl的S输出中可以看到错误和日志。我倾向于首先查看“Offline_Uncorrectable”字段,因为非零意味着驱动器无法处理的介质中存在缺陷(在您的例子中,使用SSD,通常意味着驱动器已经耗尽了对已经死亡的细胞的替换闪光灯)。其他属性表示读或写错误,但它们的重要性取决于错误的原因。

驱动器错误也记录在错误日志中:

代码语言:javascript
复制
SMART Error Log Version: 1
No Errors Logged

和测试日志中的测试结果:

代码语言:javascript
复制
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%     16446         -
# 2  Short offline       Completed without error       00%     10532         -
# 3  Short offline       Completed without error       00%      8040         -
# 4  Vendor (0xff)       Completed without error       00%      3608         -
# 5  Vendor (0xff)       Completed without error       00%       597         -
# 6  Vendor (0xff)       Completed without error       00%       585         -
# 7  Vendor (0xff)       Completed without error       00%       520         -
# 8  Vendor (0xff)       Completed without error       00%       161         -
# 9  Vendor (0xff)       Completed without error       00%        98         -
#10  Vendor (0xff)       Completed without error       00%        65         -

在这里,您需要标记为“已完成无错误”的测试,其中包含一个与驱动器当前生存期不太远的生存期字段(取决于测试计划)。在你的情况下,驱动器的寿命是16446小时,你有一个刚刚完成的测试。您还希望定期看到扩展的脱机测试,因为这是某些属性被更新的时候(例如,脱机不可纠正)。

我倾向于使用smartctl -x而不是smartctl -a,它显示了更多的信息。

票数 4
EN

Unix & Linux用户

发布于 2018-09-03 11:47:56

这种智能技术大约在十几年前就开始于磁盘上,内部记录表面的潜在问题。您正在使用SSD磁盘,这是基于完全不同的技术(被称为电子可擦可编程ROM)。数据写在磁盘上称为扇区的块中,而在SSD上,数据是用更大的块写的,在写块之前(实际上是编程的)它必须被擦除。擦除块使块元素受到很小的损坏,因此固件试图将写入(=erasings=damages)均匀地传播到所有块上,因为对同一块的线材数量有限(SLC约为100000倍,MLC约为5000倍,TLC约为300倍)。

那么,smartctl报告的错误对于这两种基本的技术都有其他的意义。在磁盘上,您需要检查Current_Pending_Sector --指示不良写入(不可读)数据(ID 197)和指示不良磁面的Reallocated_sector_count (ID 5),以及ID 194 Temperature_Celsius。在SSD中,ID 5被重命名为Reallocate_NAND_Blk_Cnt,它显示了生命时间之外的块数。

在这两种情况下,简单地存在几个坏块(扇区)并不一定意味着磁盘已经退出。问题可能是当许多有问题的区块突然出现时,或者它们的数量在日益增加。

延长磁盘的生存期,可以谨慎地选择合适的品牌和类型(服务器24x7、桌面、录像机),并尽可能地以良好的条件支持它(风扇用于降低温度、足够的功率、严格的水平或垂直位置)。

SSD磁盘的生存期可以通过选择SLC来扩展(慢速但更好)--今天您只可以购买MLC,但即使是那些可以比TLC更长的寿命。并对不必要的写作做任何可能的限制。因此,您必须将交换(pagefile.sys)作为用户目录(homes)和日志文件移到磁盘上。在linux中,您可以额外添加noatime、nodiratime挂载选项。经常做备份!定期检查智能系统可能很有帮助,但不能将丢失的数据还给您。

票数 1
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/466526

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档