當linux系統裝有多顆硬碟且使用raid0組合成一顆磁碟,不幸其中一顆毀損時,整個磁碟就找不到了,且資料全部遺失,如果是重要資料的話,那就真的GG了.
% P# G7 S( C1 g/ \. q3 ^% i, r本篇重點是在說明"如何找出哪一顆出問題",那就是找出硬碟的型號及序號:
9 {2 l4 a' {; V. H% F
- f( E' }4 u; @: F) T4 u#hdparm -I /dev/sd?|grep -E "Number|/dev"
) @! v9 I+ }8 H' d! @/dev/sda:
1 G, T% u: r& z) `6 `/ q1 g* J Model Number: HDS722516VLSA80
( ^: q ]. p5 E8 I1 P4 `8 N Serial Number: VN6D3ECDD7RG1D0 I' O Z+ E n8 n5 V- C
/dev/sdb: u; a F8 ]* L# Q
Model Number: WDC WD740GD-00FLA1
8 ?/ p2 P* F3 P, H0 u C$ x* p7 o Serial Number: WD-WMAKE1690676 A1 v, ]* C0 N! x! t
/dev/sdc:3 q0 B& l, u0 @4 J0 z$ N) Z
Model Number: HDS722525VLSA80 + S+ r: G1 ^/ ]$ \
Serial Number: VN6J3ECFEALJRD
: X7 ]' S; s* a' Y& V; F/ s( u/dev/sdd:
' C; S2 n% S& m1 k# y0 R$ ^ Model Number: HDS722525VLSA80
( U$ D4 n" d% o! M# r! C Serial Number: VN6J3ECFEBSR1D
+ d8 g; V5 F& s6 w
3 c% A3 z3 j$ O: k
* q- }3 J7 z% \& {+ ]2 {註:, y: S4 y( Z/ P8 b
hdparm並不一定可以適用所有硬碟,有些廠牌可能不支援此指令,可能會出現如下錯誤:7 ]3 o$ X% E6 }( {6 @
HDIO_DRIVE_CMD(identify) failed: Invalid argument
% u, W0 h% ]- T7 C" ]; B- m可以使用: 參考 http://70tw.spotlight.net.tw/?p=330; j" H; ]* `- n9 X7 r
smartctl -i -d ata /dev/sda # ata 是 sata, 假如無 smartctl ===> yum install smartmontools7 K7 z) ]# I- F7 T( v9 J
smartctl -i -d scsi /dev/sdb # scsi 硬碟0 x: I t* v/ T/ D6 p
[root@server ~]# smartctl -i -d scsi /dev/sdb) D% z- g3 f5 f: X
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-431.el6.x86_64] (local build)5 L; t2 T" ^ H- c- p
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net1 k' I% k4 j5 x7 c4 O
8 ~% ^1 G' s! C$ n# A6 d; `
% W2 S" r" R6 r& v* E
Vendor: AMCC* E- s6 D; q" I2 r( r
Product: 9650SE-12M DISK
9 E& Y! y# [ e; R" jRevision: 4.10
" v( x2 |( F4 d1 GUser Capacity: 2,999,988,518,912 bytes [2.99 TB]
8 Q2 m1 Y" d8 [! oLogical block size: 512 bytes( E# _4 F* C1 x A" `' M, h1 B
Logical Unit id: 0x600050e09e18e100d23a0000d6b30000" E! e4 @ y& k/ v( C
Serial number: 56L4B0GS9E18E100D23A
2 {# | {4 v. q4 u/ SDevice type: disk
' Q7 L; i( o U; \/ T: }Local Time is: Mon Jan 25 09:05:11 2016 CST8 \! B5 }4 B0 J8 c
Device supports SMART and is Disabled9 @& R! f0 j# `% ^ e
Temperature Warning Disabled or Not Supported1 _; E) @8 L; U% t" h
[測試硬碟健康狀態]
2 s ]+ [% c4 O, R% N1 r+ n1 B- D1 usmartctl -H -d scsi /dev/sdb也可參考 http://www.av4u.info/forum.php?m ... ypeid%26typeid%3D43* o" W% N& {1 n" x. B+ v% u9 Y" `* n! n
q% ~8 G% ~. _# C( [0 i$ B `: B
|
|