smartctlエラーが修正されたかどうかを確認するには?

smartctlエラーが修正されたかどうかを確認するには?

簡単なテスト結果によれば、私のハードドライブにいくつかのエラーがありましたsmartctl(下記参照)。

その後、プライバシーのために、まずディスクのデータをゼロにします。

sudo dd if=/dev/zero of=/dev/sdc1 bs=1M
sudo dd if=/dev/zero of=/dev/sdc2 bs=1M

その後、1つの大きなパーティションに再分割し、xfs_repiarを使用してエラーを修正しようとしました。sudo xfs_repair /dev/sdcしかし、最終的には次のように印刷されました。

Sorry, could not find valid secondary superblock
Exiting now.

その後、以下を実行しましたsudo smartctl -t short /dev/sdc

smartctl 7.0 2018-12-30 r4883 [x86_64-linux-5.17.0-1.el7.elrepo.x86_64] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Short self-test routine immediately in off-line mode".
Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 1 minutes for test to complete.
Test will complete after Wed Jan 25 19:17:48 2023

Use smartctl -X to abort test.
[hc@hclinux22 src]$ sudo smartctl -a /dev/sdc
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-5.17.0-1.el7.elrepo.x86_64] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     ST2000DM008-2FR102
Serial Number:    [masked off]
LU WWN Device Id: 5 000c50 0bf3bfc3b
Firmware Version: 0001
User Capacity:    2,000,398,934,016 bytes [2.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    7200 rpm
Form Factor:      3.5 inches
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ACS-3 T13/2161-D revision 5
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Wed Jan 25 19:16:53 2023 HKT
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:  (0x00) Offline data collection activity
                    was never started.
                    Auto Offline Data Collection: Disabled.
Self-test execution status:      ( 249) Self-test routine in progress...
                    90% of test remaining.
Total time to complete Offline 
data collection:        (    0) seconds.
Offline data collection
capabilities:            (0x73) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    No 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:    (   1) minutes.
Extended self-test routine
recommended polling time:    ( 198) minutes.
Conveyance self-test routine
recommended polling time:    (   2) minutes.
SCT capabilities:          (0x30a5) SCT Status supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   100   053   006    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0003   098   097   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       688
  5 Reallocated_Sector_Ct   0x0033   099   099   010    Pre-fail  Always       -       2720
  7 Seek_Error_Rate         0x000f   079   060   045    Pre-fail  Always       -       86398239
  9 Power_On_Hours          0x0032   099   099   000    Old_age   Always       -       1741 (180 187 0)
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       688
183 Runtime_Bad_Block       0x0032   100   100   000    Old_age   Always       -       0
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   001   001   000    Old_age   Always       -       4501
188 Command_Timeout         0x0032   100   099   000    Old_age   Always       -       12885098499
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   066   059   040    Old_age   Always       -       34 (Min/Max 20/34)
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       24
193 Load_Cycle_Count        0x0032   079   079   000    Old_age   Always       -       42048
194 Temperature_Celsius     0x0022   034   041   000    Old_age   Always       -       34 (0 17 0 0 0)
195 Hardware_ECC_Recovered  0x001a   100   064   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0012   100   098   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   098   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       1272 (103 165 0)
241 Total_LBAs_Written      0x0000   100   253   000    Old_age   Offline      -       8760463243
242 Total_LBAs_Read         0x0000   100   253   000    Old_age   Offline      -       22589260799

SMART Error Log Version: 1
ATA Error Count: 4501 (device log contains only the most recent five errors)
    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 4501 occurred at disk power-on lifetime: 1727 hours (71 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 53 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  60 00 08 ff ff ff 4f 00      01:38:29.788  READ FPDMA QUEUED
  ef 10 02 00 00 00 a0 00      01:38:29.778  SET FEATURES [Enable SATA feature]
  27 00 00 00 00 00 e0 00      01:38:29.752  READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]
  ec 00 00 00 00 00 a0 00      01:38:29.750  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 00      01:38:29.737  SET FEATURES [Set transfer mode]

Error 4500 occurred at disk power-on lifetime: 1727 hours (71 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 53 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  60 00 08 ff ff ff 4f 00      01:38:29.638  READ FPDMA QUEUED
  ef 10 02 00 00 00 a0 00      01:38:29.628  SET FEATURES [Enable SATA feature]
  27 00 00 00 00 00 e0 00      01:38:29.602  READ NATIVE MAX ADDRESS EXT [OBS-ACS-3]
  ec 00 00 00 00 00 a0 00      01:38:29.600  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 00      01:38:29.588  SET FEATURES [Set transfer mode]

Error 4499 occurred at disk power-on lifetime: 1727 hours (71 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 53 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  60 00 08 ff ff ff 4f 00      01:38:29.481  READ FPDMA QUEUED
  60 00 00 ff ff ff 4f 00      01:38:27.087  READ FPDMA QUEUED
  60 00 00 ff ff ff 4f 00      01:38:23.902  READ FPDMA QUEUED
  60 00 80 ff ff ff 4f 00      01:38:23.008  READ FPDMA QUEUED
  60 00 40 ff ff ff 4f 00      01:38:23.008  READ FPDMA QUEUED

Error 4498 occurred at disk power-on lifetime: 1727 hours (71 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 53 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  60 00 08 ff ff ff 4f 00      01:38:13.746  READ FPDMA QUEUED
  ea 00 00 00 00 00 a0 00      01:38:13.728  FLUSH CACHE EXT
  61 00 78 ff ff ff 4f 00      01:38:13.725  WRITE FPDMA QUEUED
  61 00 c0 ff ff ff 4f 00      01:38:13.724  WRITE FPDMA QUEUED
  ef 10 02 00 00 00 a0 00      01:38:13.715  SET FEATURES [Enable SATA feature]

Error 4497 occurred at disk power-on lifetime: 1727 hours (71 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 53 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  60 00 08 ff ff ff 4f 00      01:38:13.519  READ FPDMA QUEUED
  61 00 c0 ff ff ff 4f 00      01:38:13.519  WRITE FPDMA QUEUED
  61 00 40 ff ff ff 4f 00      01:38:13.519  WRITE FPDMA QUEUED
  61 00 d0 ff ff ff 4f 00      01:38:13.519  WRITE FPDMA QUEUED
  61 00 40 ff ff ff 4f 00      01:38:13.518  WRITE FPDMA QUEUED

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Self-test routine in progress 90%      1741         -
# 2  Short offline       Completed without error       00%      1739         -
# 3  Short offline       Completed without error       00%      1737         -
# 4  Short offline       Completed: read failure       90%      1709         3894432032

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 parted /dev/sdc unit MiB print
Model: ATA ST2000DM008-2FR1 (scsi)
Disk /dev/sdc: 1907729MiB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start    End         Size        File system  Name  Flags
 1      1.00MiB  1907729MiB  1907728MiB  xfs

はい、sdc1とsdc2を削除してパーティションを再分割したときに、そのパーティションのxfsを作成しました。

$ ll /dev/sdc2
ls: cannot access /dev/sdc2: No such file or directory
$ ll /dev/sdc1
brw-rw----. 1 root disk 8, 33 Jan 25 19:46 /dev/sdc1

ベストアンサー1

とりわけ、ここにはある種のハードウェアバグがあります。すべてのケーブルが所定の位置にあることを確認してください(USBの場合、ポートはドライブに十分な電力を供給しています)。

188 Command_Timeout         0x0032   100   099   000    Old_age   Always       -       12885098499

次に、ディスクに障害が発生した領域があり(現在正常に)、セクタをスペア領域に再マッピングしています。しかし、遅かれ早かれ、予備セクタが不足し、データにエラーが現れ始めます。

  5 Reallocated_Sector_Ct   0x0033   099   099   010    Pre-fail  Always       -       2720

それでは、答えで何をしたのか見てみましょう。

  1. /dev/sdc1ディスクの最初のパーティションのすべてのエントリを削除しました。
  2. /dev/sdc2ディスクの2番目のパーティションのすべてのエントリを削除しました。
  3. パーティションにはありませんが、ディスク全体を占有するXFSファイルシステムを修復してみてください。/dev/sdc

パーティション1と2のデータを削除した場合、アクセスできないデータはありません。ただし、パーティションテーブルがある場合、そのパーティションテーブルの外側のディスクにファイルシステム(XFSなど)がある可能性はほとんどありません。おそらく、すでにデータを削除し、回復するファイルシステムがないか/dev/sdc3

更新された質問では、パーティションテーブルには1つのパーティションしか表示されません/dev/sdc1。表示された内容が正しい場合は - beforeという大きなファイルをdd作成したこと/dev/sdc2を意味し、ファイルサイズに制限がないため、パーティションがいっぱいに/devなったので、ddこのエラーを報告する必要があります。ls -l /dev/sdc2ファイルかデバイスかを確認するために使用されます。そして、ファイルの場合はdeleteを使用してくださいrm /dev/sdc2

一方、/dev/sdc2デバイスとしてリストされているか欠落している場合、表示されるパーティションテーブルは質問の残りの部分で説明されているパーティションテーブルではありません。

おすすめ記事