tid=26553&當linux系統裝有多顆硬碟且使用raid0組合成一顆磁碟,不幸其中一顆毀損時,整個磁碟就找不到了,且資料全部遺失,如果是重要資料的話,那就真的GG了.
# P5 k- @+ {: z# v2 X, h本篇重點是在說明"如何找出哪一顆出問題",那就是找出硬碟的型號及序號:
% U) S+ Q3 I( b( Z' j! i( Q# t: D6 }+ ~5 S0 ?
#hdparm -I /dev/sd?|grep -E "Number|/dev"' V3 A+ Z- a- {6 f
/dev/sda:
9 J( V* k9 h7 M. r( R5 B Model Number: HDS722516VLSA80
7 ~% N0 X- X4 Z( c- }" |8 t. Q+ g, { Serial Number: VN6D3ECDD7RG1D
: w# N% I, s- P( x/dev/sdb:
4 Z( j1 X5 X/ c; R# N Model Number: WDC WD740GD-00FLA1
; g& i$ l0 n8 t! | Serial Number: WD-WMAKE1690676
9 f1 o6 _5 g# e; U, ~+ }$ H/dev/sdc:
, `* x. r7 Q' _+ A: g Model Number: HDS722525VLSA80
& @0 {4 C3 e( W. p2 O Serial Number: VN6J3ECFEALJRD0 [* o ^( I& {5 V
/dev/sdd:0 w7 G+ `& T* M/ b2 Q$ M
Model Number: HDS722525VLSA80
' m8 f: X- U, `$ F' \ Serial Number: VN6J3ECFEBSR1D
2 W" _9 }; @5 X0 n9 U7 w
2 ~) \# f! ~8 R4 t1 [
8 G U3 n) n9 |( {註:# y% C& c1 J: y- N3 e$ Z
hdparm並不一定可以適用所有硬碟,有些廠牌可能不支援此指令,可能會出現如下錯誤:
+ w. E$ z+ D0 e( s* N, e HDIO_DRIVE_CMD(identify) failed: Invalid argument
, }3 x8 [; L q7 l# x5 X可以使用: 參考 http://70tw.spotlight.net.tw/?p=330- r# ]4 `+ H* i, V1 ?9 s
smartctl -i -d ata /dev/sda # ata 是 sata, 假如無 smartctl ===> yum install smartmontools
2 e/ |4 \. u. n _2 Y4 |; T+ dsmartctl -i -d scsi /dev/sdb # scsi 硬碟
% x; p: `3 o3 a: F. `+ N[root@server ~]# smartctl -i -d scsi /dev/sdb
6 `" w1 k$ {& E8 c O: J! \smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-431.el6.x86_64] (local build)2 ?: v. a, f$ Q; F
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net% W8 N7 U. E& U* z
$ ~1 [+ l! Z! D8 l% g
2 ]3 D. H$ {2 c. Z N5 D: ^
Vendor: AMCC/ j7 k, p2 d0 U* X: c# K( T% }
Product: 9650SE-12M DISK
( {9 Z3 D+ g# lRevision: 4.10
' w$ o& O" v b- z4 I8 h+ D; d4 `User Capacity: 2,999,988,518,912 bytes [2.99 TB] T L. c& E- j1 A% Y- ^: u
Logical block size: 512 bytes' x/ m, x1 \5 L- k0 I3 |# w
Logical Unit id: 0x600050e09e18e100d23a0000d6b30000
$ ~ X% P# }1 K- e! J; NSerial number: 56L4B0GS9E18E100D23A
7 M9 h# U7 _$ d" }Device type: disk
& K7 \0 P! ?3 ?) \; K0 iLocal Time is: Mon Jan 25 09:05:11 2016 CST, W6 y u7 M1 u9 q% f, R' c
Device supports SMART and is Disabled/ s$ y$ D# R. e! X2 J( L. S
Temperature Warning Disabled or Not Supported
# T! q' m6 x. U; K S4 Y0 W[測試硬碟健康狀態]; v9 ]5 _" m8 d- W% Q& S
smartctl -H -d scsi /dev/sdb也可參考 http://www.av4u.info/forum.php?m ... ypeid%26typeid%3D43* ?5 Y4 Y9 e# Y/ |( p/ E% s
5 N0 F3 M& z9 v, A; U
|