【Ubuntu14.04】Ubuntuでディスクチェック

2016年6月6日 | からmarumi | ファイル: ソフトウェア.

Ubuntuでハードディスクのディスクチェックをする方法。
Windowsでは「ChristalDiskInfo」が有名ですが、Ubuntuでも似たようなソフトがあります。

GSmartControl」Ubuntuソフトウェアセンターからインストールできます。

GSmartControl

GSmartControl

 

試したハードディスクは東芝の「MK2552GSX」、2007年の製品でUbuntuのGpartedでフォーマット済み。
ディスクチェックは3タイプあり、250GBのHDDのテストで今回テストしたマシンでは、
Short Self-test:約2分
Extended Self-test:約2時間
Conveyance Self-test:非対応
下記のサイトがとても丁寧に解説しています(感謝!)。

ディスク診断ツール、GSmartControl

GSmartControl SMARTデータを検査してハードディスクの状態をチェック

このソフトはWindowsやMac、その他のLinuxディストリビューションにも対応していてすばらしいです。

「GSmartControl」のExtended Self-testでエラーが出たので、端末でも確認。
その方法も覚書(上記のようなすばらしいソフトがあるとなかなか覚えられません(^_^;)。

ディスクを確認

sudo fdisk -l
(途中省略)
Disk /dev/sdc: 250.1 GB, 250059350016 bytes
ヘッド 255, セクタ 63, シリンダ 30401, 合計 488397168 セクタ
Units = セクタ数 of 1 * 512 = 512 バイト
セクタサイズ (論理 / 物理): 512 バイト / 512 バイト
I/O サイズ (最小 / 推奨): 512 バイト / 512 バイト
ディスク識別子: 0x029e8d54

デバイス ブート  始点  終点  ブロック  Id  システム
/dev/sdc1  2048  488396799  244197376  83  Linux

sudo hdparm -I /dev/sdc1 |grep Model
Model Number: TOSHIBA MK2552GSX

 

ディスクチェック

sudo badblocks -v -s /dev/sdc1 |tee /tmp/badblocks.txt
Checking blocks 0 to 244197375
Checking for bad blocks (read-only test): 0.00% done, 0:00 elapsed. (0/0/0 errdone
Pass completed, 0 bad blocks found. (0/0/0 errors)

250GBのハードディスクで、今回は2時間10分ほどかかりました。

 

詳細を確認

sudo smartctl -a /dev/sdc
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-87-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family: Toshiba 2.5″ HDD MK..52GSX
Device Model: TOSHIBA MK2552GSX
Serial Number: (省略)
LU WWN Device Id: 5 000039 121b02e72
Firmware Version: LV010A
User Capacity: 250,059,350,016 bytes [250 GB]
Sector Size: 512 bytes logical/physical
Device is: In smartctl database [for details use: -P show]
ATA Version is: ATA8-ACS (minor revision not indicated)
SATA Version is: SATA 2.6, 3.0 Gb/s
Local Time is: Mon Jun 6 14:30:26 2016 JST
SMART support is: Available – device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART STATUS RETURN: incomplete response, ATA output registers missing
SMART overall-health self-assessment test result: PASSED
Warning: This result is based on an Attribute check.

General SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 120) seconds.
Offline data collection
capabilities: (0x5b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
No 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: ( 118) minutes.
SCT capabilities: (0x0039) 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 0x000b 100 100 050 Pre-fail Always – 0
2 Throughput_Performance 0x0005 100 100 050 Pre-fail Offline – 0
3 Spin_Up_Time 0x0027 100 100 001 Pre-fail Always – 1868
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always – 3629
5 Reallocated_Sector_Ct 0x0033 100 100 050 Pre-fail Always – 0
7 Seek_Error_Rate 0x000b 100 100 050 Pre-fail Always – 0
8 Seek_Time_Performance 0x0005 100 100 050 Pre-fail Offline – 0
9 Power_On_Hours 0x0032 023 023 000 Old_age Always – 31126
10 Spin_Retry_Count 0x0033 170 100 030 Pre-fail Always – 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always – 3622
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always – 11
193 Load_Cycle_Count 0x0032 099 099 000 Old_age Always – 17407
194 Temperature_Celsius 0x0022 100 100 000 Old_age Always – 35 (Min/Max 7/53)
196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always – 0
197 Current_Pending_Sector 0x0032 100 100 000 Old_age Always – 0
198 Offline_Uncorrectable 0x0030 100 100 000 Old_age Offline – 0
199 UDMA_CRC_Error_Count 0x0032 200 253 000 Old_age Always – 0
220 Disk_Shift 0x0002 100 100 000 Old_age Always – 78
222 Loaded_Hours 0x0032 026 026 000 Old_age Always – 29805
223 Load_Retry_Count 0x0032 100 100 000 Old_age Always – 0
224 Load_Friction 0x0022 100 100 000 Old_age Always – 0
226 Load-in_Time 0x0026 100 100 000 Old_age Always – 304
240 Head_Flying_Hours 0x0001 100 100 001 Pre-fail Offline – 0

SMART Error Log Version: 1
ATA Error Count: 1
CR = Command Register [HEX]
FR = Features Register [HEX]
SC = Sector Count Register [HEX]
SN = Sector Number Register [HEX]
CL = Cylinder Low Register [HEX]
CH = Cylinder High Register [HEX]
DH = Device/Head Register [HEX]
DC = Device Command Register [HEX]
ER = Error register [HEX]
ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It “wraps” after 49.710 days.

Error 1 occurred at disk power-on lifetime: 3863 hours (160 days + 23 hours)
When the command that caused the error occurred, the device was active or idle.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
— — — — — — —
40 41 b2 18 bb 68 6a Error: WP at LBA = 0x0a68bb18 = 174635800

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
— — — — — — — — —————- ——————–
61 08 d0 98 70 59 40 00 15d+03:06:21.142 WRITE FPDMA QUEUED
61 98 c8 10 09 5b 40 00 15d+03:06:21.141 WRITE FPDMA QUEUED
61 08 c0 30 12 71 40 00 15d+03:06:20.865 WRITE FPDMA QUEUED
60 40 b8 32 0f 96 40 00 15d+03:06:20.495 READ FPDMA QUEUED
60 08 b0 18 bb 68 40 00 15d+03:06:20.494 READ FPDMA QUEUED

SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Aborted by host 90% 31127 –
# 2 Short offline Completed without error 00% 31126 –
SMART Selective self-test log data structure revision number 1

SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

端末でもシステムチェック

sudo smartctl -t long /dev/sdc
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-87-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: “Execute SMART Extended self-test routine immediately in off-line mode”.
Drive command “Execute SMART Extended self-test routine immediately in off-line mode” successful.
Testing has begun.
Please wait 118 minutes for test to complete.
Test will complete after Mon Jun 6 17:48:48 2016

Use smartctl -X to abort test.

Extended Self-testの完了予定は118分後。
でも、「Aborted by host」で未完。

sudo smartctl -l selftest /dev/sdc
[sudo] password for marumi:
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-87-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Aborted by host 90% 31127 –
# 2 Extended offline Aborted by host 90% 31127 –
# 3 Short offline Completed without error 00% 31127 –


タグ:

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA