Smartctl Locates Disk Failure Information

smartctl Locates Disk Failure Introduction:

Smartctl (SMART Self-Monitoring, Analysis and Reporting Technology) is a tool for viewing and testing disk hardware information, printing SMART self-test and error logs, enabling and disabling SMRAT auto-detection, and initializing device self-tests. In the server environment, the general disks are mounted through the RAID card. If the pass-through mode is configured, you can directly use smartctl to query the disk information. If it is not in the pass-through mode, you need to call the corresponding interface of the RAID card.

smartctl locates disk failure information


Smartctl (SMART Self-Monitoring, Analysis and Reporting Technology) is a tool for viewing and testing disk hardware information, printing SMART self-test and error logs , enabling and disabling SMRAT auto-detection , and initializing device self-tests. In the server environment, disks are generally mounted through RAID cards . If pass- through mode is configured, you can directly use smartct l to query disk information. If it is not in pass-through mode, you need to call the corresponding interface of the RAID card to query.

smartctl inserts non-passthrough mode disk information
•smartctl --scan lists disk names, types, and interface information.
•smartctl -H -d megaraid,8 /dev/bus/0 According to the --scan query information, the disk information is obtained through the raid card model. Different raid cards have different access methods.
[ root@centos ~]# smartctl --scan
/dev/ sda -d scsi # /dev/ sda , SCSI device
/dev/ sdb -d scsi # /dev/ sdb , SCSI device
/dev/ sdc -d scsi # /dev/ sdc , SCSI device
/dev/sdd -d scsi # /dev/sdd, SCSI device
/dev/sde -d scsi # /dev/sde, SCSI device
/dev/sdf -d scsi # /dev/sdf, SCSI device
/dev/sdg -d scsi # /dev/sdg, SCSI device
/dev/bus/0 -d megaraid,1 # /dev/bus/0 [megaraid_disk_01], SCSI device
/dev/bus/0 -d megaraid,2 # /dev/bus/0 [megaraid_disk_02], SCSI device
/dev/bus/0 -d megaraid,3 # /dev/bus/0 [megaraid_disk_03], SCSI device
/dev/bus/0 -d megaraid,4 # /dev/bus/0 [megaraid_disk_04], SCSI device
/dev/bus/0 -d megaraid,5 # /dev/bus/0 [megaraid_disk_05], SCSI device
/dev/bus/0 -d megaraid,6 # /dev/bus/0 [megaraid_disk_06], SCSI device
/dev/bus/0 -d megaraid,7 # /dev/bus/0 [megaraid_disk_07], SCSI device
/dev/bus/0 -d megaraid,8 # /dev/bus/0 [megaraid_disk_08], SCSI device

# smartctl -H -d megaraid,8 /dev/bus/0
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-3.10.0-1160.36.2.el7.x86_64] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK
smartctl detects disk error messages
•The disk is detected to be faulty. At this time, the disk is available, but there are problems with some tracks, which will lead to IO reduction and serious fluctuations.
[ root@centos ~]# smartctl -H -d -d megaraid,37 /dev/bus/15
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-3.10.0-1127.el7.x86_64] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: FAILED!
Drive failure expected in less than 24 hours. SAVE ALL DATA.
Failed Attributes:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN _FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000b 001 001 016 Pre - fail Always FAILING_NOW 4294967295
2 Throughput_Performance 0 x0005 001 001 054 Pre-fail Offline FAILING_NOW 18967
smartctl closes the disk cache
•SATA disks is enabled by default, and the disk cache of SAS disks is disabled by default. When the disk cache is enabled, if a power failure occurs and the machine is forced to be turned on and off, data loss will occur and the system will fail to boot.
for i in `seq 9 26`;do smartctl -g wcache -d megaraid,${i} /dev/bus/0;done

#关闭raid盘cache
for i in `seq 0 10`; do /opt/MegaRAID/storcli/storcli64 /c0/v${i} set pdcache=Off;done
for i in `seq 0 10`; do /opt/ MegaRAID / storcli /storcli64 /c0/v${ i } set wrcache = WT;done

#Check the raid cache status, the Cache option is raid card cache, WT is off, WB is on, and AWB is always on
/opt/ MegaRAID / storcli /storcli64 /c0 show
-------------------------------------------------- -------------
DG/VD TYPE State Access Consist Cache Cac sCC Size Name
---------------------------------------------------------------
1/0 RAID0 Optl RW Yes RWTD - ON 1.090 TB
2/1 RAID0 Optl RW Yes RWTD - ON 1.090 TB
0/2 RAID1 Optl RW Yes RWTD - ON 446.625 GB
3/3 RAID0 Optl RW Yes RWTD - ON 1.090 TB
4/4 RAID0 Optl RW Yes RWTD - ON 1.090 TB
5/5 RAID0 Optl RW Yes RWTD - ON 1.090 TB
6/6 RAID0 Optl RW Yes RWTD - ON 1.090 TB
7/7 RAID0 Optl RW Yes RWTD - ON 1.090 TB
8/8 RAID0 Optl RW Yes RWTD - ON 1.090 TB
9/9 RAID0 Optl RW Yes RWTD - ON 1.090 TB
10/10 RAID0 Optl RW Yes RWTD - ON 1.090 TB
---------------------------------------------------------------
服务器点灯
•ipmitool chassis identify 30 Turn on the server positioning light, the default is 15s, and it can be set to the desired time of 30s
ipmitool chassis identify 30
Disk lights
#Get raid card device /dev/sg0
[root@centos-211 ~]# lsscsi - gt
[0:0:0:0] enclosu - /dev/sg0
[0:0:3:0] disk /dev/ sda /dev/sg1
[0:0:4:0] disk /dev/ sdb /dev/sg2
[0: 0: 5: 0] disk / dev / sdc / dev / sg3
[0: 0: 6: 0] disk / dev / sdd / dev / sg4
[0: 0: 7: 0] disk / dev / sde / dev / sg5
[0: 0: 8: 0] disk / dev / sdf / dev / sg6
[0: 0: 9: 0] disk / dev / sdg / dev / sg7
[0: 0: 10: 0] disk / dev / sdh / dev / sg8
[0: 0: 11: 0] disk / dev / sdi / dev / sg9
[0:0:12:0] disk /dev/ sdj /dev/sg10
[0:0:13:0] disk /dev/ sdk /dev/sg11
[0:0:14:0] disk /dev/ sdl /dev/sg12
[0:2:0:0] disk /dev/ sdm /dev/sg13

#Get raid card enclosu
sg_ses --index=1 --get ident /dev/sg24

# turn on the disk light
sg_ses --index=1 --set ident /dev/sg24

#View support options
sg_ses - ee

Related Articles

Explore More Special Offers

  1. Short Message Service(SMS) & Mail Service

    50,000 email package starts as low as USD 1.99, 120 short messages start at only USD 1.00