コンテンツにスキップ

eROSITA server

Input/Output Error

Input/Output Errorとは?

「Input/Output error」(I/Oエラー)は、Linuxや他のオペレーティングシステムにおいて、データの読み込み(Input)や書き込み(Output)操作が失敗したときに表示されるエラーメッセージです。このエラーは、システムがファイルやディスク、その他のI/Oデバイスからデータを読み取ったり、データを書き込んだりする際に問題が発生したことを示します。

I/Oエラーの主な原因

  1. ハードウェアの問題: ハードディスクやSSDなどのストレージデバイスに物理的な故障がある場合や、接続ケーブルの問題、デバイスの老朽化などが原因です。
  2. ファイルシステムの破損: ファイルシステムの構造が壊れていると、データの読み書きに失敗し、I/Oエラーが発生します。
  3. デバイスアクセスの問題: ファイルシステムが適切にマウントされていない、またはアクセス権限の問題がある場合に発生することもあります。
  4. ネットワーク関連の問題: ネットワークファイルシステム(例: NFS)での通信エラーやサーバーの問題で、リモートデバイスにアクセスできない場合に発生します。
  5. カーネルやドライバの不具合: カーネルやデバイスドライバにバグがあり、正常にI/O操作を処理できない場合もあります。

I/Oエラーが発生する場面

  • ファイルにアクセスしようとしたとき(読み込みや書き込み)
  • デバイスにアクセスしようとしたとき(ディスクやUSBなど)
  • プロセスがストレージや他のI/Oデバイスとやり取りする際

エラーの影響

I/Oエラーが発生すると、データの損失やアプリケーションのクラッシュ、システムの不安定性などの問題が発生する可能性があります。データの保存や読み込みが正常に行えなくなるため、早急な対応が必要です。

I/Oエラーは、システムの健全性に重大な影響を与える可能性があるため、発生した場合には原因を調査し、必要に応じてハードウェアの修理やファイルシステムの修復を行うことが重要です。

✅ 接続されているディスクを確認する

確認にはddd3h-serverという独自サーバーに接続を行い検証を行った。

eROSITA-server上で実行するとI/O errorが出てしまうため、直接実行するのは不可能である。

~ $ sudo fdisk -l
[sudo] password for daisuke: 
Disk /dev/loop0: 55.66 MiB, 58363904 bytes, 113992 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 55.66 MiB, 58363904 bytes, 113992 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 63.95 MiB, 67051520 bytes, 130960 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop3: 63.95 MiB, 67051520 bytes, 130960 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop4: 87.03 MiB, 91258880 bytes, 178240 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop5: 87.04 MiB, 91267072 bytes, 178256 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop6: 307.53 MiB, 322465792 bytes, 629816 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop7: 308.74 MiB, 323735552 bytes, 632296 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 465.92 GiB, 500277790720 bytes, 977105060 sectors
Disk model: APPLE SSD SM0512
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: B6FD2555-ACC0-4CFC-8E89-E4D71F8AC496

Device       Start       End   Sectors   Size Type
/dev/sda1     2048   2203647   2201600     1G EFI System
/dev/sda2  2203648 977102847 974899200 464.9G Linux filesystem


Disk /dev/loop8: 38.73 MiB, 40615936 bytes, 79328 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop9: 38.83 MiB, 40714240 bytes, 79520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdc: 3.64 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: HDD-UT          
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/sde: 7.28 TiB, 8001563222016 bytes, 15628053168 sectors
Disk model: 004-2CX188      
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Disklabel type: gpt
Disk identifier: D4B1FDDB-588B-4F57-83F8-590D6564BDF0

Device       Start         End     Sectors  Size Type
/dev/sde1     2048     2203647     2201600    1G EFI System
/dev/sde2  2203648     6397951     4194304    2G Linux filesystem
/dev/sde3  6397952 15628050431 15621652480  7.3T Linux filesystem

/dev/sdeがerosita serverから頂戴したHDDになる.

❌ ファイルシステムのチェック

ファイルシステムのチェックを行うことができるfsck コマンドを使ってファイルシステムの整合性を確認し、修復を行う.

~ $ sudo fsck /dev/sde
fsck from util-linux 2.37.2
e2fsck 1.46.5 (30-Dec-2021)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sde

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

Found a gpt partition table in /dev/sde
~ $ sudo fsck /dev/sde3
fsck from util-linux 2.37.2
e2fsck 1.46.5 (30-Dec-2021)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sde3

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

/dev/sde/dev/sde3の両方を実行したが失敗.

原因はLVMでディスクを作成したからかと思われる.

✅ LVMの検証

Kernelの変更

次のkernelが使用できるようした。

  • 5.15.0-113-generic / or with recovery
  • 5.15.0-107-generic / or with recovery
  • 5.15.0-106-generic / or with recovery