日常問題處理:Linux通過設備名稱如何查看硬盤SN


因為ceph集群的服務器硬盤都是直通的,當我們發現有硬盤存儲壞道需要更換硬盤,但是因為盤序可能不是連續的,無法定位服務器上那塊硬盤是故障的,如果冒然測試可能把正常的硬盤拔出,得不償失,簡單記錄一下定位故障硬盤的思路。

1、硬盤定位思路

適用於故障硬盤亞健康但未離線硬盤

1.1 找到故障硬盤


[root@a01r1n06 ~]# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0  3.7T  0 disk
├─sda1   8:1    0    2M  0 part
├─sda2   8:2    0    1G  0 part /boot
├─sda3   8:3    0 62.5G  0 part [SWAP]
└─sda4   8:4    0  3.6T  0 part /
sdb      8:16   0 14.6T  0 disk /public/home/test

1.2 通過smartctl工具找到硬盤的SN號


[root@a01r1n06 ~]# smartctl --all /dev/sdad
smartctl 6.5 2016-05-07 r4318 [x86_64-linux-3.10.0-862.el7.x86_64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

Smartctl open device: /dev/sdad failed: No such device
[root@a01r1n06 ~]# smartctl --all /dev/sdb
smartctl 6.5 2016-05-07 r4318 [x86_64-linux-3.10.0-862.el7.x86_64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     WUH721816ALE6L4
Serial Number:    2CJSSATJ  ##硬盤序列號
LU WWN Device Id: 5 000cca 2a1e6fb30
Add. Product Id:  202116
Firmware Version: PCGAW232
User Capacity:    16,000,900,661,248 bytes [16.0 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    7200 rpm
Form Factor:      3.5 inches
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   Unknown(0x0ffc) (unknown minor revision code: 0x009c)
SATA Version is:  SATA >3.2 (0x1ff), 6.0 Gb/s (current: 3.0 Gb/s)
Local Time is:    Tue Jul  6 14:50:20 2021 CST
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: 		(  101) 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.
.....

1.3 通過陣列卡工具找到對應序列號對應的服務器的槽位號;

Storcli工具安裝

工具安裝移步 -> https://www.xxshell.com/2800.html

通過Storcli找到硬盤solt

篩選硬盤SN找到Slot;


./storcli64 /call /eall /sall show all |grep -5 -i WKD26RCS

1.4 點亮硬盤定位燈更換硬盤

通過./storcli64 /c0/e0/s23 start locate點亮定位燈

2、使用IPMI系統定位硬盤

因為服務器沒有安裝Storcli,其有IPMI系統,通過IPMI系統來定位硬盤

找到對應的硬盤序列號,點擊【定位物理設備】即可

參考原微博:https://www.xxshell.com/2995.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM