AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 851441
Accepted
MSF004
MSF004
Asked: 2017-05-22 14:56:38 +0800 CST2017-05-22 14:56:38 +0800 CST 2017-05-22 14:56:38 +0800 CST

设备:/dev/sda [SAT],1 当前不可读(待处理)扇区

  • 772

我在 RHEL 上有一个软件 RAID 1 阵列。每天早上我都会收到此错误电子邮件:设备:​​/dev/sda [SAT],1 当前不可读(待处理)扇区

当我在 sda(或 sdb)上运行测试时,一切似乎都通过了。我错过了什么吗?


mdstat 显示 RAID 阵列很好:

# cat /proc/mdstat 
Personalities : [raid1] 
md5 : active raid1 sdb5[1] sda5[0]
      108026816 blocks [2/2] [UU]

md1 : active raid1 sdb1[1] sda1[0]
      511936 blocks [2/2] [UU]

md2 : active raid1 sda2[0] sdb2[1]
      805306304 blocks [2/2] [UU]

md3 : active raid1 sda3[0] sdb3[1]
      62914496 blocks [2/2] [UU]

unused devices: <none>

下面是输出:# smartctl -q noserial -a /dev/sda

我也试过运行:# smartctl -t long /dev/sda


smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-279.9.1.el6.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family:     Hitachi Ultrastar A7K1000
Device Model:     Hitachi HUA721010KLA330
Firmware Version: GKAOAB0A
User Capacity:    1,000,204,886,016 bytes [1.00 TB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   7
ATA Standard is:  ATA/ATAPI-7 T13 1532D revision 1
Local Time is:    Sun May 21 17:51:42 2017 CDT
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:  (0x84) Offline data collection activity
                    was suspended by an interrupting command from host.
                    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:        (15354) seconds.
Offline data collection
capabilities:            (0x5b) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    Offline surface scan supported.
                    Self-test supported.
                    No 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:    (   1) minutes.
Extended self-test routine
recommended polling time:    ( 255) minutes.
SCT capabilities:          (0x003f) SCT Status supported.
                    SCT Error Recovery Control 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     0x000b   098   098   016    Pre-fail  Always       -       4
  2 Throughput_Performance  0x0005   100   100   054    Pre-fail  Offline      -       0
  3 Spin_Up_Time            0x0007   122   122   024    Pre-fail  Always       -       550 (Average 591)
  4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       68
  5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000b   100   100   067    Pre-fail  Always       -       0
  8 Seek_Time_Performance   0x0005   100   100   020    Pre-fail  Offline      -       0
  9 Power_On_Hours          0x0012   094   094   000    Old_age   Always       -       43202
 10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       68
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       751
193 Load_Cycle_Count        0x0012   100   100   000    Old_age   Always       -       751
194 Temperature_Celsius     0x0002   090   090   000    Old_age   Always       -       66 (Min/Max 17/72)
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       1
198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x000a   200   200   000    Old_age   Always       -       0

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%     43186         -
# 2  Extended offline    Completed without error       00%     43170         -
# 3  Short offline       Completed without error       00%     43162         -
# 4  Short offline       Completed without error       00%     43138         -
# 5  Short offline       Completed without error       00%     43114         -
# 6  Short offline       Completed without error       00%     43090         -
# 7  Short offline       Completed without error       00%     43066         -
# 8  Short offline       Completed without error       00%     43042         -
# 9  Extended offline    Completed without error       00%     43031         -
#10  Short offline       Completed without error       00%     43024         -
#11  Short offline       Completed without error       00%     43018         -
#12  Extended offline    Completed without error       00%     43002         -
#13  Short offline       Completed without error       00%     42994         -
#14  Short offline       Completed without error       00%     42970         -
#15  Short offline       Completed without error       00%     42946         -
#16  Short offline       Completed without error       00%     42922         -
#17  Short offline       Completed without error       00%     42898         -
#18  Short offline       Completed without error       00%     42874         -
#19  Short offline       Completed without error       00%     42850         -
#20  Extended offline    Completed without error       00%     42833         -
#21  Short offline       Completed without error       00%     42826         -

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  Not_testing
    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.
raid
  • 5 5 个回答
  • 29106 Views

5 个回答

  • Voted
  1. Best Answer
    AlexD
    2017-05-22T23:57:23+08:002017-05-22T23:57:23+08:00

    您的 SMART Current Pending Sector 的值为 1。这意味着磁盘上有一个坏扇区,驱动器固件无法重新分配它,但重新分配的扇区数仍然为零,因此即使您的驱动器已经运行了一段时间,它也可能可以恢复在不太健康的环境中使用 5 年 - 温度高达 72 C°。

    您可以尝试找到这个坏扇区,dd if=/dev/sda of=/dev/null然后您需要通过覆盖它来重新映射该扇区。

    • 11
  2. Donovan Baarda
    2020-07-24T22:10:20+08:002020-07-24T22:10:20+08:00

    我相信“197 Current_Pending_Sector”计数是读取失败的扇区计数。这确实意味着驱动器开始出现故障,但这并不一定意味着驱动器坏了。如果这些扇区被重新写入,驱动器固件可以将它们重新映射,驱动器就可以了。

    四处搜索还发现一些讨论表明某些型号的 SSD 驱动器会定期将其切换为 1 并返回,这可能是 SMART 报告中的一个几乎无害的固件错误。

    所以你可以忽略它,并且如果你的文件系统可以处理偶尔的坏块读取(即,在引擎盖下进行某种强大的RAID/冗余),它可能会随着文件系统覆盖这些块而慢慢清除自己。如果您的文件系统无法处理坏块读取,则每次尝试读取该块中的任何内容时,您都可能会遇到 IO 错误。您可能仍然可以通过查找并删除该文件来恢复,并且文件系统最终将重写该扇区。

    您还可以通过显式覆盖这些扇区来清除 Current_Pending_Sector 计数。这将破坏磁盘上的数据!这可能会破坏文件系统,从而丢失磁盘上的所有数据,而不仅仅是坏扇区中丢失的数据。因此,只有在您有能力释放磁盘上的所有数据时才这样做。

    您可以通过运行智能长测试找到坏扇区;

    # smartctl -t long /dev/sda
    

    然后您可以检查长测试的状态,看看它是否完成,以及它遇到的第一个错误的 LBA;

    # smartctl -l selftest /dev/sda
    smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.7.0-1-amd64] (local build)
    Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
    
    === START OF READ SMART DATA SECTION ===
    SMART Self-test log structure revision number 1
    Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
    # 1  Extended offline    Completed without error       00%     17711         12345
    # 2  Short offline       Completed without error       00%     17709         -
    # 3  Short captive       Interrupted (host reset)      10%       450         -
    # 4  Short captive       Interrupted (host reset)      10%       228         -
    

    然后,您可以使用 dd 覆盖坏扇区;

    # dd if=/dev/zero of=/dev/sda seek=12345 count=1
    

    尽管请注意,默认的 bs=512 块大小可能小于驱动器上的物理扇区大小,因此您可能需要最多写入 count=8 才能完全擦除它。然后,您可以冲洗并重复测试/覆盖循环,直到所有坏扇区都被覆盖。最后,您可以检查计数是否已清零;

    $ sudo smartctl -A /dev/sdc | grep Current_Pending_Sector
    197 Current_Pending_Sector  0x0012   200   200   000    Old_age   Always       -       0
    

    我在一个旧的 WD 200G 硬盘上遇到了这种情况,它可能是由于热插拔连接不良导致 Current_Pending_Sector 计数为 26 造成的。当我运行长时间测试时,它通过了,没有发现任何坏扇区,但是计数仍为 26。我可以通过使用 dd 将整个驱动器归零来将计数器归零;

    dd if=/dev/zero of=/dev/sda bs=1M status=progress
    

    请注意 bs=1M 使它运行得更快,但它不是 512 扇区大小,所以最后会有一个部分块。随后的 smartctl 长短测试都报告驱动器正常。

    • 2
  3. CpnCrunch
    2020-09-03T14:18:47+08:002020-09-03T14:18:47+08:00

    这只是意味着您的 RAID 阵列中的一个驱动器上有一个坏扇区。目前没有什么可担心的,除非您开始在该磁盘上获得更多坏扇区。您不应该尝试手动修复错误...这将在每个月的第一天由 raid-check 命令自动完成,该命令从 /etc/cron.d/raid-check 运行。您可以检查该命令并手动运行它以立即重新分配磁盘上的坏扇区:

    [root@server]# more /etc/cron.d/raid-check 
    
    0 1 * * Sun root /usr/sbin/raid-check
    
    [root@server]# /usr/sbin/raid-check
    

    这将强制 mdraid 从 RAID 阵列中的其他磁盘复制坏块,并将坏块标记为不可用。

    • 0
  4. Alexis Wilke
    2020-11-14T15:48:32+08:002020-11-14T15:48:32+08:00

    仅供参考,就我而言,我收到了有关 8 个无效扇区的错误,并且确实持续了一段时间。

    然后我在我的系统日志中看到了这条消息:

    11 月 13 日 06:57:35 怪物 smartd [3359]:设备:/dev/sdf [SAT],没有更多当前不可读(待处理)扇区,1 封电子邮件后重置警告条件

    所以我想它应该自己修复,如果不是,驱动器可能应该尽快更换。

    我在系统日志中可以找到的第一条消息发生在 11 月 12 日 06:57:35

    11 月 12 日 06:57:35 怪物 smartd [3359]:设备:/dev/sdf [SAT],8 当前不可读(待处理)扇区

    所以看起来它重复了这条消息,直到 1 天后再次检查驱动器并且不再发现错误。

    我还在想我会得到一个新的硬盘驱动器。我可以获得 12Tb 并在我的 RAID 中有 3 个驱动器。所以如果一个死了,我还有两个……没有备份就更麻烦了。

    我现有的驱动器最高温度。为 48°C。所以比较好。此外,驱动器仅运行了 9599 小时(约 400 天),所以还很年轻。

    • 0
  5. Mikhail Khirgiy
    2017-05-23T06:55:55+08:002017-05-23T06:55:55+08:00

    现在您的硬盘上有当前待处理扇区。sda此磁盘用于软件 RAID。有一个死亡的开始。您需要更换此磁盘。

    此磁盘专为台式电脑设计。它尝试自行恢复(不是通过 RAID)。它每隔几秒钟读取一次坏扇区,直到坏扇区的校验和良好(磁盘的性能会急剧下降),然后磁盘会将读取的数据写入新的保留扇区。但是从救援扇区读取的数据可能经常出错。CRC32 校验和只能指示第一个错误,它不能用于恢复数据(例如 - RAID-5 上的 XOR 可用于恢复数据)。当 RAID 从坏驱动器读取这些数据时,它会给出不同的数据,这些数据将被读取。如果坏块有重要的系统数据,这种情况会在系统上产生内核恐慌。这就是为什么您需要更换坏盘。

    • -1

相关问题

  • Windows 文件服务器性能调优

  • SSD TRIM 的硬件 RAID 控制器支持

  • 了解磁盘队列长度

  • 使用混合磁盘突袭 0?

  • Windows Server 2008 Hyper-V 虚拟化服务器的最佳 RAID 配置?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve