當linux系統裝有多顆硬碟且使用raid0組合成一顆磁碟,不幸其中一顆毀損時,整個磁碟就找不到了,且資料全部遺失,如果是重要資料的話,那就真的GG了. ?; w# [5 ?! g8 s' u& i3 v
本篇重點是在說明"如何找出哪一顆出問題",那就是找出硬碟的型號及序號:/ |: V O8 d; A
7 K$ @/ |! A* K/ N& q, [
#hdparm -I /dev/sd?|grep -E "Number|/dev"8 s: ?) S' q: ~0 I4 d& c* H
/dev/sda:1 |; x: k7 S( D; w; V- V
Model Number: HDS722516VLSA80
/ f+ i0 x/ L6 f+ a3 r9 d7 d( K Serial Number: VN6D3ECDD7RG1D
% x+ a) J `; l/dev/sdb:
& e8 L8 ~$ K+ ?6 c: D4 C Model Number: WDC WD740GD-00FLA1
* q% _- R! L- M: M# d Serial Number: WD-WMAKE16906764 ^7 n6 k$ c9 {' Z6 E
/dev/sdc:
. r: Q) _: F' Y7 ^ Model Number: HDS722525VLSA80
+ ^2 @$ r1 B: {1 a Serial Number: VN6J3ECFEALJRD: j j; f- N+ t1 \$ n
/dev/sdd:
6 R2 ~( `( A' m( m- u( H; V- [" K Model Number: HDS722525VLSA80 # B; |3 R& f; I) U: U
Serial Number: VN6J3ECFEBSR1D& b# x7 r! M* t1 M9 P. O
1 j1 y& ]7 f; _5 Z. Q) c5 u3 T, @) l
+ Y) B( S$ Q( N5 z. i# w! b註:7 i& q) s6 I* D, P: y# H
hdparm並不一定可以適用所有硬碟,有些廠牌可能不支援此指令,可能會出現如下錯誤:5 ?7 @3 y3 {# s( t4 w
HDIO_DRIVE_CMD(identify) failed: Invalid argument6 {9 F; A" _" {" ^6 S; A
可以使用: 參考 http://70tw.spotlight.net.tw/?p=330% Z9 b! `5 r6 X' d1 ^8 c, ^3 ^
smartctl -i -d ata /dev/sda # ata 是 sata, 假如無 smartctl ===> yum install smartmontools
; Q$ Q) V' E( f8 Gsmartctl -i -d scsi /dev/sdb # scsi 硬碟# c4 E) D$ p9 | E. n" B' z, e; N
[root@server ~]# smartctl -i -d scsi /dev/sdb
# h2 s, Q1 B0 v6 Z* s$ M1 A7 O9 }smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-431.el6.x86_64] (local build)
) ]$ q" J( s: M8 u$ \- ECopyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net5 g3 ^. a4 Z# [$ [9 |6 D3 M* U. t
0 O8 c/ G! H3 U4 v1 R
5 g, N' [1 X: W! O/ |Vendor: AMCC
5 w* |' u8 ]+ H/ jProduct: 9650SE-12M DISK9 I( J9 P. u8 l6 z% J4 u6 }
Revision: 4.10
1 `2 L. L/ E: e2 {User Capacity: 2,999,988,518,912 bytes [2.99 TB]
1 ~* E V0 D/ N T( pLogical block size: 512 bytes
7 ?; l) a f CLogical Unit id: 0x600050e09e18e100d23a0000d6b30000) l; {5 H) Q+ O0 w# j) _
Serial number: 56L4B0GS9E18E100D23A
! s2 L! n: p1 @2 y6 l; V9 lDevice type: disk
4 B9 E2 X; S2 V; }Local Time is: Mon Jan 25 09:05:11 2016 CST3 l8 O6 d" ]( p' [8 F; ?
Device supports SMART and is Disabled+ R/ O8 d6 D( A2 H% D+ U
Temperature Warning Disabled or Not Supported
. H! m; m% r- s$ A( v: m[測試硬碟健康狀態]# {/ c2 E; F8 I
smartctl -H -d scsi /dev/sdb也可參考 http://www.av4u.info/forum.php?m ... ypeid%26typeid%3D43
$ \0 L$ [ u$ X" A" T2 r5 a' _0 `- o+ Q- ~7 C
|
|