读取不同磁盘类型(SATA 和 SAS)的输出时出现问题

读取不同磁盘类型(SATA 和 SAS)的输出时出现问题

其输出smartctl --scan如下。

/dev/sda -d scsi # /dev/sda, SCSI device
/dev/sdb -d scsi # /dev/sdb, SCSI device
/dev/bus/2 -d megaraid,0 # /dev/bus/2 [megaraid_disk_00], SCSI device
/dev/bus/2 -d megaraid,1 # /dev/bus/2 [megaraid_disk_01], SCSI device
/dev/bus/2 -d megaraid,2 # /dev/bus/2 [megaraid_disk_02], SCSI device
/dev/bus/2 -d megaraid,3 # /dev/bus/2 [megaraid_disk_03], SCSI device
/dev/bus/2 -d megaraid,4 # /dev/bus/2 [megaraid_disk_04], SCSI device

这是与五张磁盘。我不知道我是否可以从操作系统检查涉及的 RAID 配置,我想我不能,无论如何,目前我无法处理 BIOS。我假设前两个磁盘处于 RAID 1 配置(它们被视为 /dev/sda),其他三个磁盘处于 RAID 5 配置(它们被视为 /dev/sdb)。

问题是我通常会从类似的命令中获得不同的输出,具体取决于它们是将磁盘引用到第一个 RAID 配置还是第二个 RAID 配置

例如使用该命令 smartctl --smart=on --offlineauto=on --saveauto=on /dev/bus/2 -d megaraid,0我得到以下输出。

smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-155-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF ENABLE/DISABLE COMMANDS SECTION ===
SMART Enabled.
SMART Attribute Autosave Enabled.
SMART Automatic Offline Testing Enabled every four hours.

相反,使用该命令smartctl --smart=on --offlineauto=on --saveauto=on /dev/bus/2 -d megaraid,2我得到了以下输出。

smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-155-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF ENABLE/DISABLE COMMANDS SECTION ===
Informational Exceptions (SMART) enabled
Temperature warning enabled
Autosave enabled (GLTSD bit cleared).

实际上我不明白上面提到的“自动离线测试”的频率。

当我尝试查看短扫描或长扫描后的结果时,也遇到了类似的问题。

smartctl -l error /dev/bus/2 -d megaraid,0...

smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-155-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Error Log Version: 1
No Errors Logged

用 来smartctl -l error /dev/bus/2 -d megaraid,2代替...

smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-155-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
Error counter log:
           Errors Corrected by           Total   Correction     Gigabytes    Total
               ECC          rereads/    errors   algorithm      processed    uncorrected
           fast | delayed   rewrites  corrected  invocations   [10^9 bytes]  errors
read:   3595257651        0         0  3595257651          0       1843.590           0
write:         0        0         0         0          0       3076.669           0
verify: 3551761787        0         0  3551761787          0      15017.264           0

Non-medium error count:      372

而在这里我真的感觉有点迷失……

同样地,对于smartctl -l selftest /dev/bus/2 -d megaraid,0...

smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-155-generic] (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  Short offline       Completed without error       00%     59961         -
# 2  Short offline       Completed without error       00%     59937         -
# 3  Short offline       Completed without error       00%     59913         -
# 4  Extended offline    Completed without error       00%     59897         -
# 5  Extended offline    Aborted by host               70%     59895         -
# 6  Short offline       Completed without error       00%     59889         -
# 7  Short offline       Completed without error       00%     59837         -
# 8  Short offline       Completed without error       00%     59339         -
# 9  Short offline       Completed without error       00%     59336         -
#10  Short offline       Completed without error       00%     37147         -
#11  Short offline       Completed without error       00%     37147         -
#12  Short offline       Completed without error       00%     37147         -
#13  Short offline       Completed without error       00%     37146         -
#14  Short offline       Completed without error       00%     37146         -
#15  Short offline       Completed without error       00%     37146         -

smartctl -l selftest /dev/bus/2 -d megaraid,2...

Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Self-test log
Num  Test              Status                 segment  LifeTime  LBA_first_err [SK ASC ASQ]
     Description                              number   (hours)
# 1  Background short  Completed                   -   60525                 - [-   -    -]
# 2  Background short  Completed                   -   60501                 - [-   -    -]
# 3  Background long   Completed                   -   60482                 - [-   -    -]
# 4  Background short  Completed                   -   60477                 - [-   -    -]
# 5  Background short  Completed                   -   60468                 - [-   -    -]
# 6  Background short  Aborted (by user command)   -   60468                 - [-   -    -]
# 7  Background long   Aborted (by user command)   -   60458                 - [-   -    -]
# 8  Background long   Aborted (by user command)   -   60458                 - [-   -    -]
# 9  Background short  Completed                   -   60453                 - [-   -    -]
#10  Background short  Completed                   -   59897                 - [-   -    -]
#11  Background short  Completed                   -   37513                 - [-   -    -]
#12  Background short  Completed                   -   37513                 - [-   -    -]
#13  Background short  Completed                   -   37513                 - [-   -    -]
#14  Background short  Completed                   -   37513                 - [-   -    -]
#15  Background short  Completed                   -   37513                 - [-   -    -]
#16  Background short  Completed                   -   37513                 - [-   -    -]

Long (extended) Self-test duration: 65535 seconds [1092.2 minutes]

实际上在第二种情况下,我无法判断完成的测试结果是否正常...

此外,我还发现了几个我觉得不该负责的“简短测试”(我不记得我启动了这么多smartctl -t short)。在 smartmontools 包附带的 smartd 的默认配置中,我发现了以下行。

DEVICESCAN -d removable -n standby -m root -M exec /usr/share/smartmontools/smartd-runner

这条线路怎么能负责我找到的所有简短测试呢?我没有看到那里有扫描请求。我错了吗?

我被告知,无论如何都会定期进行基本测试,因为它们是在硬件中编程的,但它们不包括任何坏块检查。正如您在上面看到的,我在获取假定的 RAID 5 配置中的磁盘的这些测试频率时遇到了麻烦。

很抱歉留言这么长,不幸的是,与我在互联网上找到的文档中的典型示例相比,我的情况似乎更加复杂……

您能否帮助我理解如何解读我所掌握的与我的情况相关的信息?

提前致谢!

安德里亚

- - 更新 - - 正如下面的评论所建议的,这不是 RAID 配置的问题,而是不同磁盘的问题。其中两个是 SATA,另外三个是 SAS。

smartctl -i /dev/bus/2 -d megaraid,0我用...检查第一个

smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-155-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Caviar Green
Device Model:     WDC WD5000AADS-00S9B0
Serial Number:    WD-WCAV9V055931
LU WWN Device Id: 5 0014ee 159e577d2
Firmware Version: 01.00A01
User Capacity:    500.107.862.016 bytes [500 GB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS (minor revision not indicated)
SATA Version is:  SATA 2.6, 3.0 Gb/s
Local Time is:    Tue Feb 27 18:27:38 2024 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

smartctl -i /dev/bus/2 -d megaraid,2我用...检查第一个

smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-155-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               SEAGATE
Product:              ST1000NM0045
Revision:             N002
Compliance:           SPC-4
User Capacity:        1.000.204.886.016 bytes [1,00 TB]
Logical block size:   512 bytes
LU is fully provisioned
Rotation Rate:        7200 rpm
Form Factor:          3.5 inches
Logical Unit id:      0x5000c500856f8ae7
Serial number:        ZBS00JGK0000R639QNRU
Device type:          disk
Transport protocol:   SAS (SPL-3)
Local Time is:        Tue Feb 27 18:30:35 2024 CET
SMART support is:     Available - device has SMART capability.
SMART support is:     Enabled
Temperature Warning:  Enabled

问题仍然存在:在 SAS 磁盘的情况下,如何读取输出数据?

相关内容