當linux系統裝有多顆硬碟且使用raid0組合成一顆磁碟,不幸其中一顆毀損時,整個磁碟就找不到了,且資料全部遺失,如果是重要資料的話,那就真的GG了.- [$ y9 m) p$ h+ \# E% u
本篇重點是在說明"如何找出哪一顆出問題",那就是找出硬碟的型號及序號:
+ L1 V: V. p% Y( R& j& D* g) L4 T: V0 V+ j5 o1 a
#hdparm -I /dev/sd?|grep -E "Number|/dev"
& l; n8 U/ W) @1 A0 T/dev/sda:; e; O8 l; \) ]5 i
Model Number: HDS722516VLSA80
* l- L1 r! @" T# Y6 R( r0 c Serial Number: VN6D3ECDD7RG1D% t1 ~, C5 { x
/dev/sdb:
" p4 C0 A+ T! h; B& h Model Number: WDC WD740GD-00FLA1
! C6 {* E) [' ~, J6 J3 G8 n Serial Number: WD-WMAKE1690676) D o( k( P$ k( g
/dev/sdc:
# b1 G6 L! Z5 @ Model Number: HDS722525VLSA80 ( K0 B; f. U X6 A& O# o) y9 F* t' ~2 I
Serial Number: VN6J3ECFEALJRD
1 F+ k: }7 @& K. b) C/ n) p/dev/sdd:0 C3 v @8 v! ~
Model Number: HDS722525VLSA80 $ I. i- c- d0 K+ d
Serial Number: VN6J3ECFEBSR1D
* K8 c2 l1 V+ k, L: d5 w) v4 a) l: C& ?0 v! Q+ c
* d) X6 ]- t2 J6 k! A$ k! q+ M+ f, J
註:
. Z2 M$ j* r0 L hdparm並不一定可以適用所有硬碟,有些廠牌可能不支援此指令,可能會出現如下錯誤:
, Z& g1 \& w0 D. A! D HDIO_DRIVE_CMD(identify) failed: Invalid argument
& f2 b1 g/ f$ K可以使用: 參考 http://70tw.spotlight.net.tw/?p=330# \& \' ?& |7 _, b x9 g" a0 n0 ]( L
smartctl -i -d ata /dev/sda # ata 是 sata, 假如無 smartctl ===> yum install smartmontools
H7 u' d; U+ Lsmartctl -i -d scsi /dev/sdb # scsi 硬碟" U# U9 @' V p# X" w' v5 D
[root@server ~]# smartctl -i -d scsi /dev/sdb
; z% z# i) p+ Wsmartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-431.el6.x86_64] (local build); R0 D, m0 B/ c3 P
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net1 f: q% ~0 r3 w+ f5 V7 O; ?
& \& v& {! S/ M. M2 E: J5 A+ f; @
, p1 [! R0 a0 f8 Q2 X+ @Vendor: AMCC
- `; D7 ^' t% l1 ?8 x$ {) |Product: 9650SE-12M DISK
- t+ C7 _0 }3 @, I4 I$ ~; V$ u% k8 Y7 LRevision: 4.10, X8 B' r8 y. u% B
User Capacity: 2,999,988,518,912 bytes [2.99 TB]
) q$ n0 f' \( n0 C5 \Logical block size: 512 bytes% l9 L. B6 G- ?% l. h
Logical Unit id: 0x600050e09e18e100d23a0000d6b30000
9 z% d. q6 D3 ~, X5 ~Serial number: 56L4B0GS9E18E100D23A
. S- e F, x: ]! q5 ^. @Device type: disk; A/ f/ K7 G5 t# w
Local Time is: Mon Jan 25 09:05:11 2016 CST
0 I& l1 r; ~ Y' s4 d: SDevice supports SMART and is Disabled# t) ~: ]" }- z; |$ q- ^
Temperature Warning Disabled or Not Supported
/ L8 j5 L8 n/ S0 C# |) p[測試硬碟健康狀態]
; z. w# k0 h0 N5 _7 lsmartctl -H -d scsi /dev/sdb也可參考 http://www.av4u.info/forum.php?m ... ypeid%26typeid%3D43
" X8 N8 C0 n! D8 N# d! m8 s: h
4 Y8 G* t* w0 t- o; V |
|