Linux

有故障的魚子醬藍硬碟?

  • October 28, 2013

我們有一個小型“自製”伺服器,執行完全更新的 Debian Wheezy (amd64)。安裝了一個硬碟驅動器:WDC WD6400AAKS。主機板是華碩M4N68T V2。

正常負載:

  • CPU:平均20%
  • 每周大約會佔用 50GB 的額外空間。大約 47GB 的上傳文件和 3GB 的 MySQL 數據。

恐怕硬碟驅動器即將發生故障。我跑的時候在幾個地方看到了Pre-fail :

root@SERVER:/tmp# smartctl -a /dev/sda
smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-4-amd64] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Caviar Blue Serial ATA
Device Model:     WDC WD6400AAKS-XXXXXXX
Serial Number:    WD-XXXXXXXXXXXXXXXXXXX
LU WWN Device Id: 5 0014ee XXXXXXXXXXXXX
Firmware Version: 01.03B01
User Capacity:    640,135,028,736 bytes [640 GB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   8
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Mon Oct 28 18:55:27 2013 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x85) Offline data collection activity
                   was aborted by an interrupting command from host.
                   Auto Offline Data Collection: Enabled.
Self-test execution status:      ( 247) Self-test routine in progress...
                   70% of test remaining.
Total time to complete Offline 
data collection:        (11580) seconds.
Offline data collection
capabilities:            (0x7b) SMART execute Offline immediate.
                   Auto Offline data collection on/off support.
                   Suspend Offline collection upon new
                   command.
                   Offline surface scan supported.
                   Self-test supported.
                   Conveyance Self-test supported.
                   Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                   power-saving mode.
                   Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                   General Purpose Logging supported.
Short self-test routine 
recommended polling time:    (   2) minutes.
Extended self-test routine
recommended polling time:    ( 136) minutes.
Conveyance self-test routine
recommended polling time:    (   5) minutes.
SCT capabilities:          (0x303f) SCT Status supported.
                   SCT Error Recovery Control supported.
                   SCT Feature Control supported.
                   SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
 1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       0
 3 Spin_Up_Time            0x0027   157   146   021    Pre-fail  Always       -       5108
 4 Start_Stop_Count        0x0032   098   098   000    Old_age   Always       -       2968
 5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
 7 Seek_Error_Rate         0x002e   200   200   051    Old_age   Always       -       0
 9 Power_On_Hours          0x0032   079   079   000    Old_age   Always       -       15445
10 Spin_Retry_Count        0x0032   100   100   051    Old_age   Always       -       0
11 Calibration_Retry_Count 0x0032   100   100   051    Old_age   Always       -       0
12 Power_Cycle_Count       0x0032   098   098   000    Old_age   Always       -       2950
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       426
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       2968
194 Temperature_Celsius     0x0022   111   095   000    Old_age   Always       -       36
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   160   000    Old_age   Always       -       21716
200 Multi_Zone_Error_Rate   0x0008   200   200   051    Old_age   Offline      -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%     15444         -

Error SMART Read Selective Self-Test Log failed: scsi error aborted command
Smartctl: SMART Selective Self Test Log Read Failed
root@SERVER:/tmp# 

在一個教程中,我讀到預失敗表示即將失敗,在另一個教程中,我讀到這不是真的。你們能幫我解碼smartctl的輸出嗎?

如果我想確保數據完整性(每周大約 50GB 的新數據,我感興趣的整個期間最多 2TB),我也很高興分享我應該怎麼做的建議。也許我會在 RAID4 中使用 2x2TB Caviar Black?

如前所述,“Prefail”文本僅指示條目的類型。並且根據條目,並非每個條目都是錯誤的。例如 Spin_Up_Time 只計算驅動器啟動的頻率,Load_Cycle_Count 計算磁頭停放的頻率。

讓我暫停的值是 21716 處的 UDMA_CRC_Error_Count。這可能是由於電纜損壞/鬆動或電子故障引起的。

如果存在表面錯誤,則 Reallocated_Sector_Ct、Current_Pending_Sector 或 Offline_Uncorrectable 會上升。它們都是 0,所以磁碟可能完全沒問題。

以下表示有一個測試仍在執行:

Self-test execution status:      ( 247) Self-test routine in progress...
                   70% of test remaining.

完成後,“SMART Self-test log structure”部分中應該有另一個條目。您應該使用長測試 (smartctl -t long) 來獲得有意義的結果。記錄的測試只是一個簡短的測試。

關於更高的數據完整性:RAID4 至少需要 3 個磁碟並且不再使用(由 RAID5 代替)。但在您的情況下,具有 2 個磁碟的 RAID1 或具有 4 個磁碟的 RAID10 都適合。兩種模式都將可用空間量減半,但如果一個驅動器發生故障,仍可繼續工作。RAID10 具有速度更快的優勢,因為它將負載分配到更多驅動器上,並且取決於哪些驅動器發生故障,即使 2 個發生故障的驅動器也能倖免於難。如果一個磁碟足夠快,RAID1 也足夠快(寫入速度相同,數據量大時讀取速度加倍)。

引用自:https://serverfault.com/questions/549270