當linux系統裝有多顆硬碟且使用raid0組合成一顆磁碟,不幸其中一顆毀損時,整個磁碟就找不到了,且資料全部遺失,如果是重要資料的話,那就真的GG了.2 C: Z# `$ s! X1 }
本篇重點是在說明"如何找出哪一顆出問題",那就是找出硬碟的型號及序號:7 X. |! W* |* d+ e9 o
4 _4 z+ d! j8 Y4 ~
#hdparm -I /dev/sd?|grep -E "Number|/dev"- a5 O. i, f* V' P/ {$ m) `0 o
/dev/sda:
$ T3 i! X- h% ~" X9 x6 C1 Q Model Number: HDS722516VLSA80 ( y' U+ P$ O9 t4 L' H
Serial Number: VN6D3ECDD7RG1D7 Y. w4 ~& e" x; D
/dev/sdb:( d+ Q4 {' L5 D/ R. g1 ?
Model Number: WDC WD740GD-00FLA1 . e. n* H9 ~ W
Serial Number: WD-WMAKE1690676
- N# B+ L0 C1 s/dev/sdc:. b$ j, B/ F0 L; p
Model Number: HDS722525VLSA80
, l$ n2 a3 n A7 {% D0 Q9 V Serial Number: VN6J3ECFEALJRD9 @. Z: w' Y) E; n% l6 u
/dev/sdd:
8 r3 ^! Q. ?9 n, r8 N Model Number: HDS722525VLSA80
, n4 Y5 S# T; N+ h4 c% K: r) z Serial Number: VN6J3ECFEBSR1D
7 r# D1 I A$ @' i2 N2 t6 k& t4 Z
' D9 y+ p2 C$ T( ?$ l' t9 u$ n' }' [( K& `5 B- C- n1 j4 Y
註:$ N5 x6 |9 a, ]
hdparm並不一定可以適用所有硬碟,有些廠牌可能不支援此指令,可能會出現如下錯誤:
e. k4 e' {4 w! Y9 O& G( c# u HDIO_DRIVE_CMD(identify) failed: Invalid argument
' c' ] r6 c1 S& b8 H可以使用: 參考 http://70tw.spotlight.net.tw/?p=330
1 L' S ~% ~0 e7 d( Lsmartctl -i -d ata /dev/sda # ata 是 sata, 假如無 smartctl ===> yum install smartmontools" V( M/ \" f9 T. w" m2 i" X
smartctl -i -d scsi /dev/sdb # scsi 硬碟- K0 o2 O4 q4 J* L% r+ N
[root@server ~]# smartctl -i -d scsi /dev/sdb) N8 y$ G+ F. H" {$ f; t
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-431.el6.x86_64] (local build)
: x$ d. k4 Y' m9 h+ @7 Z# m- hCopyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net
0 i$ b8 M7 N6 }5 X9 X ]+ O, d$ }. O9 k& P( O2 u! C- n3 {
' K7 [! k: P% ^Vendor: AMCC
6 S3 L+ ?5 v; q) BProduct: 9650SE-12M DISK7 `+ ^2 y1 K* } R# v4 V
Revision: 4.10+ p6 J2 F5 P5 x* c3 b
User Capacity: 2,999,988,518,912 bytes [2.99 TB]; C( f) X/ v3 k( |' ~
Logical block size: 512 bytes
0 s. {1 I% |( I3 L5 C$ g8 K, K6 `' f0 DLogical Unit id: 0x600050e09e18e100d23a0000d6b30000- }: y6 l( n) e4 k- [
Serial number: 56L4B0GS9E18E100D23A
1 h7 `$ [/ |9 _" cDevice type: disk
" h/ ^* B( A, @& D: ILocal Time is: Mon Jan 25 09:05:11 2016 CST
' c" V; Q# H+ mDevice supports SMART and is Disabled
2 X" _6 i2 T3 T% o7 m% K( c5 E7 uTemperature Warning Disabled or Not Supported* X* y2 A* N0 Z- B9 ?3 }
[測試硬碟健康狀態]4 v4 t+ k3 t2 F
smartctl -H -d scsi /dev/sdb也可參考 http://www.av4u.info/forum.php?m ... ypeid%26typeid%3D43
4 H( _2 x# B6 |) s
" K" p& S. }) t. v1 ^3 Z |
|