smartctl查看错误日志失败
1. 问题
Error Counter logging not supported
Device does not support Self Test logging
# smartctl -l error -l selftest /dev/sdb smartctl 7.3 2022-02-28 r5338 [x86_64-linux-6.0.7-301.fc37.x86_64] (local build) Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org === START OF READ SMART DATA SECTION === Error Counter logging not supported Device does not support Self Test logging
2. 原因分析
测试时,为了便于操作,使用了raid0
# cat raid0_storcli storcli /call/eall/sall show|grep -A100 'EID:' |grep -B100 'EID='|grep -v 'EID'|grep ':'|awk '{print $1}'>/tmp/storcli.eid:sid; while read disk;do storcli /c0 add VD r0 drives=${disk}; done</tmp/storcli.eid\:sid; rm -rf /tmp/storcli.eid\:sid;
3. 解决
使用jbod直通模式测试(使用lsi sas 9361-8i的raid卡)
# cat del_raid_storcli storcli /call/vall show |grep -A100 'DG/VD'|grep -B100 'EID'|grep RAID|awk '{print $1}'|awk -F/ '{print $2}' > /tmp/storcli.vd; while read vd;do storcli /c0 /v${vd} delete force; done </tmp/storcli.vd; rm -rf /tmp/storcli.vd; # cat jbod_storcli storcli /c0 set jbod=on #### storcli /c0 set jbod=off
4. 结果
测试成功
=== START OF READ SMART DATA SECTION === SMART Error Log Version: 1 No Errors Logged
5. 网上查到的相关解决办法(待验证)
下面使用smartctl透过Raid卡获取磁盘更详细的信息: # smartctl manual 摘录.. Under Linux , to look at SCSI/SAS disks behind LSI MegaRAID controllers, use syntax such as: smartctl -a -d megaraid,2 /dev/sda smartctl -a -d megaraid,0 /dev/sdb where in the argument megaraid,N, the integer N is the physical disk number within the MegaRAID controller. This interface will also work for Dell PERC controllers. The following /dev/XXX entry must exist: # 经测试只要存在即可,对应关系搞错确也仍可正常显示 For PERC2/3/4 controllers: /dev/megadev0 For PERC5/6 controllers: /dev/megaraid_sas_ioctl_node