謎のベアボーンpcが出てきたのでdebian入れてハードディスクをチェックしている

なんかこれだった。15,995円で買ったみたい

ハードディスクを繋いで検査してみる

カーネルログの表示

debian12(bookwarn)ではログはもはやファイルには書かれない。これはjournald で管理されているからである。

journalctl -k
 701 18:32:37 blackbox kernel: usb 2-4: new high-speed USB device number 5 using xhci_hcd
 701 18:32:37 blackbox kernel: usb 2-4: New USB device found, idVendor=152d, idProduct=0580, bcdDevice=73.01
 701 18:32:37 blackbox kernel: usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
 701 18:32:37 blackbox kernel: usb 2-4: Product: GW3.5AM-SU3G2P
 701 18:32:37 blackbox kernel: usb 2-4: Manufacturer: Kuroutoshikou
 701 18:32:37 blackbox kernel: usb 2-4: SerialNumber: 1C5180001827
 701 18:32:37 blackbox kernel: usbcore: registered new interface driver usb-storage
 701 18:32:37 blackbox kernel: scsi host2: uas
 701 18:32:37 blackbox kernel: usbcore: registered new interface driver uas
 701 18:32:37 blackbox kernel: scsi 2:0:0:0: Direct-Access     ST2000DL 003-9VT166       7301 PQ: 0 ANSI: 6
 701 18:32:37 blackbox kernel: sd 2:0:0:0: Attached scsi generic sg1 type 0
 701 18:32:37 blackbox kernel: sd 2:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.82 TiB)
 701 18:32:37 blackbox kernel: sd 2:0:0:0: [sdb] 4096-byte physical blocks
 701 18:32:37 blackbox kernel: sd 2:0:0:0: [sdb] Write Protect is off
 701 18:32:37 blackbox kernel: sd 2:0:0:0: [sdb] Mode Sense: 5f 00 00 08
 701 18:32:37 blackbox kernel: sd 2:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 7月 01 18:32:37 blackbox kernel: sd 2:0:0:0: [sdb] Preferred minimum I/O size 4096 bytes
 7月 01 18:32:37 blackbox kernel: sd 2:0:0:0: [sdb] Optimal transfer size 33553920 bytes not a multiple of preferred minimum block size (4096 bytes)
 7月 01 18:32:37 blackbox kernel:  sdb: sdb1 sdb2
 7月 01 18:32:37 blackbox kernel: sd 2:0:0:0: [sdb] Attached SCSI disk
 7月 01 18:32:38 blackbox kernel: hfsplus: Filesystem was not cleanly unmounted, running fsck.hfsplus is recommended.  mounting read-only.
 7月 01 18:36:57 blackbox kernel: iwlwifi 0000:03:00.0: Radio type=0x1-0x2-0x0
 7月 01 18:36:57 blackbox kernel: iwlwifi 0000:03:00.0: Radio type=0x1-0x2-0x0
Manufacturer: Kuroutoshikou

この辺に玄人志向とか出てるのも面白いよね。

 701 18:32:37 blackbox kernel: scsi 2:0:0:0: Direct-Access     ST2000DL 003-9VT166       7301 PQ: 0 ANSI: 6
 701 18:32:37 blackbox kernel: sd 2:0:0:0: Attached scsi generic sg1 type 0
 701 18:32:37 blackbox kernel: sd 2:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.82 TiB)

ST2000DL 003-9VT166というモデルの2TBのハードディスクが接続された

7月 01 18:32:38 blackbox kernel: hfsplus: Filesystem was not cleanly unmounted, running fsck.hfsplus is recommended.  mounting read-only.

ファイルシステムが適当に切断されたのであやしいよっていわれている。まあいいだろう。

次にやること

fdiskで何となくみてみると

root@blackbox:~# fdisk -l /dev/sdb
Disk /dev/sdb: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: 003-9VT166
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: C0E02C2C-0941-40F4-93B9-640F7042BEC1

Device      Start        End    Sectors  Size Type
/dev/sdb1      40     409639     409600  200M EFI System
/dev/sdb2  409640 3906766983 3906357344  1.8T Apple HFS/HFS+

sdb1はEFIで利用していたものである事が推察される。これは消滅してもいいものであろう。

でsdb2もmountしてみたけど、これといって使っていないものであったので初期化してしまうことにする。

古いディスクが使えるのかどうか

smartmontools を入れ、確認する

# sudo smartctl -a /dev/sdb
smartctl 7.3 2022-02-28 r5338 [x86_64-linux-6.1.0-22-amd64] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

/dev/sdb: Unknown USB bridge [0x152d:0x0580 (0x7301)]
Please specify device type with the -d option.

Use smartctl -h to get a usage summary

この場合大抵-d sat をつけると動作する

-d satはSATA(Serial ATA)ディスクをUSBブリッジ経由で接続している場合に使用されます。

chatgpt
# sudo smartctl -d sat -a /dev/sdb
smartctl 7.3 2022-02-28 r5338 [x86_64-linux-6.1.0-22-amd64] (local build)
Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Barracuda Green (AF)
Device Model:     ST2000DL003-9VT166
Serial Number:    5YD8Q5EY
LU WWN Device Id: 5 000c50 0493c052b
Firmware Version: CC3C
User Capacity:    2,000,398,934,016 bytes [2.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5900 rpm
Device is:        In smartctl database 7.3/5319
ATA Version is:   ATA8-ACS T13/1699-D revision 4
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Mon Jul  1 18:57:21 2024 JST
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
See vendor-specific Attribute list for marginal Attributes.

General SMART Values:
Offline data collection status:  (0x82) Offline data collection activity
                                        was completed without error.
                                        Auto Offline Data Collection: Enabled.
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:                (  612) 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:        (   1) minutes.
Extended self-test routine
recommended polling time:        ( 333) minutes.
Conveyance self-test routine
recommended polling time:        (   2) minutes.
SCT capabilities:              (0x30b7) SCT Status supported.
                                        SCT Feature Control 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   113   099   006    Pre-fail  Always       -       54574984
  3 Spin_Up_Time            0x0003   093   091   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       646
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   072   060   030    Pre-fail  Always       -       8624238646
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       290
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       511
183 Runtime_Bad_Block       0x0032   097   097   000    Old_age   Always       -       3
184 End-to-End_Error        0x0032   099   099   099    Old_age   Always   FAILING_NOW 1
187 Reported_Uncorrect      0x0032   099   099   000    Old_age   Always       -       1
188 Command_Timeout         0x0032   100   099   000    Old_age   Always       -       6
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   058   051   045    Old_age   Always       -       42 (Min/Max 26/42)
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       -       78
193 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       874
194 Temperature_Celsius     0x0022   042   049   000    Old_age   Always       -       42 (0 2 0 0 0)
195 Hardware_ECC_Recovered  0x001a   028   025   000    Old_age   Always       -       54574984
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   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      -       291 (52 72 0)
241 Total_LBAs_Written      0x0000   100   253   000    Old_age   Offline      -       2107606375
242 Total_LBAs_Read         0x0000   100   253   000    Old_age   Offline      -       2192972110

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]

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.

こういうログも見てるの面倒なのでchatgptにぶん投げちゃうといい

chatgptによる評価

主要なSMART属性の解釈

  1. Reallocated_Sector_Ct (ID 5)

    • 現在の値: 100

    • 生の値: 0

    • 解釈: 再配置されたセクタは存在しません。これは良好な状態です。

  2. Power_On_Hours (ID 9)

    • 現在の値: 100

    • 生の値: 290

    • 解釈: ディスクの通電時間は290時間と比較的少ないです。これは良好な状態を示しています。

  3. Current_Pending_Sector (ID 197)

    • 現在の値: 100

    • 生の値: 0

    • 解釈: 保留中のセクタは存在しません。これは良好な状態です。

  4. Offline_Uncorrectable (ID 198)

    • 現在の値: 100

    • 生の値: 0

    • 解釈: オフラインで修正不能なエラーはありません。これは良好な状態です。

  5. End-to-End_Error (ID 184)

    • 現在の値: 99

    • 生の値: 1

    • 解釈: この属性は現在失敗しています (FAILING_NOW)。エンドツーエンドエラーが1件記録されています。これはデータの整合性に問題がある可能性があります。

  6. Reported_Uncorrect (ID 187)

    • 現在の値: 99

    • 生の値: 1

    • 解釈: 1件の修正不能なエラーが報告されています。これはディスクの信頼性に影響する可能性があります。

総合評価

全体として、以下の点が指摘されます:

  • 良好な状態: Reallocated_Sector_Ct、Current_Pending_Sector、Offline_Uncorrectableなど、多くの重要な属性が良好な状態を示しています。

  • 懸念事項: End-to-End_ErrorとReported_Uncorrect属性にエラーが記録されています。特にEnd-to-End_Errorは現在失敗状態にあり、データの整合性に問題がある可能性があります。

推奨アクション

  1. データバックアップ: 重要なデータが含まれている場合は、直ちにバックアップを取ることを強く推奨します。

  2. 詳細なテストの実行: ディスクの詳細な状態を確認するために、短時間および長時間の自己テストを実行します。

    • 短時間テスト

    • 長時間テスト

  3. テスト結果の確認: テスト完了後、結果を確認します。

結論

このディスクは現在一部のエラーが報告されているため、完全な信頼性を持つとは言えません。特にEnd-to-End_Errorが示すデータ整合性の問題は注意が必要です。バックアップを取った上で、詳細なテストを実行し、エラーがさらに増加するかどうかを監視することを推奨します。状況によっては、ディスクの交換を検討することも必要かもしれません。

ということで

root@blackbox:~# sudo smartctl -l selftest -d sat /dev/sdb

とやって

root@blackbox:~# sudo smartctl -l selftest -d sat /dev/sdb
smartctl 7.3 2022-02-28 r5338 [x86_64-linux-6.1.0-22-amd64] (local build)
Copyright (C) 2002-22, 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  Short offline       Completed without error       00%       291         -

このように-l selftest で確認する。これはノーエラーだったようだ。ロングの場合はかなり時間がかかる

# smartctl -d sat -t long /dev/sdb
smartctl 7.3 2022-02-28 r5338 [x86_64-linux-6.1.0-22-amd64] (local build)
Copyright (C) 2002-22, 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 333 minutes for test to complete.
Test will complete after Tue Jul  2 00:45:08 2024 JST
Use smartctl -X to abort test.

このように333分つまり約5時間以上かかるので、忘れないようにしたい

# sudo smartctl -l selftest -d sat /dev/sdb
smartctl 7.3 2022-02-28 r5338 [x86_64-linux-6.1.0-22-amd64] (local build)
Copyright (C) 2002-22, 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    Self-test routine in progress 90%       291         -

つわけで5時間っつったら今日は終わらないのでここでnoteを出しちゃおう


この記事が気に入ったらサポートをしてみませんか?