Ad Space — Top Banner

Disk I/O Error

Linux Linux

Severity: Critical

What Does This Error Mean?

A disk I/O error on Linux means the system tried to read from or write to the drive and the operation failed. I/O stands for Input/Output — the basic act of reading and writing data. You may see messages like 'Input/output error,' 'I/O error' in the kernel log, or operations failing silently. This is a serious error that almost always indicates a failing drive, bad connection, or severe file system corruption. Back up your data immediately.

Affected Models

  • Ubuntu
  • Debian
  • Fedora
  • CentOS
  • Arch Linux
  • Linux Mint
  • openSUSE

Common Causes

  • The hard drive or SSD is physically failing with bad sectors or hardware errors
  • The SATA or NVMe cable connecting the drive is loose, damaged, or faulty
  • The drive has developed bad sectors and the file system has mounted read-only to prevent further damage
  • The drive is overheating due to poor ventilation or a failed cooling system
  • A USB-connected external drive is experiencing power delivery issues

How to Fix It

  1. Check the kernel log for error details. Type: sudo dmesg | grep -i error — look for lines mentioning I/O errors, failed commands, or specific drive sectors.

    The kernel log often shows exactly which drive and which sector is failing. This information is essential for diagnosis.

  2. Check drive health with smartctl. Install smartmontools: sudo apt install smartmontools (Ubuntu/Debian) — then run: sudo smartctl -a /dev/sda (replace sda with your drive name).

    Look for SMART attributes marked 'FAILING_NOW' or 'Pre-fail' and check the 'Reallocated Sectors Count' — any non-zero value means bad sectors are being mapped out.

  3. Run fsck to check and repair the file system. Reboot from a live USB, open a terminal, and run: sudo fsck -y /dev/sda1 (replace sda1 with your partition). The -y flag automatically answers yes to repair prompts.

    Never run fsck on a mounted partition. Boot from a live USB to ensure the drive is unmounted before checking.

  4. Check physical connections. If the drive is accessible, power down and reseat the SATA data cable and power cable connecting the drive to the motherboard.

    A loose cable causes intermittent I/O errors that look identical to a failing drive. Reseating cables is free and takes 2 minutes.

  5. Back up all data immediately. Use: rsync -av /path/to/data /path/to/backup to copy your important files to an external drive or cloud storage.

    Do this before any repair attempts. A drive showing I/O errors can fail completely at any time. Your files are the priority — fixing the drive comes second.

When to Call a Professional

Disk I/O errors are a serious warning sign. Back up all important files immediately — do not wait. If the drive health check (smartctl) shows failing sectors or a critical SMART status, the drive needs to be replaced. A professional data recovery service can retrieve files from a partially failed drive if your backups are incomplete.

Frequently Asked Questions

My file system went read-only automatically. Is that normal?

Yes, this is actually a protective behavior. When the Linux kernel detects repeated I/O errors on a partition, it remounts the file system as read-only to prevent further writes to a potentially failing drive. This protects existing data from being further corrupted. The file system will stay read-only until you run fsck and the errors are cleared.

How do I find out which drive is causing the I/O errors?

Run: sudo dmesg | grep -i 'error' and look at the device names in the error messages. Device names like /dev/sda, /dev/sdb, or /dev/nvme0 tell you which physical drive has the error. You can then run: sudo smartctl -a /dev/sda on that specific drive to get detailed health information.

The I/O errors are on an external USB drive. Is the drive dying?

Not necessarily. External USB drives commonly show I/O errors due to a faulty USB cable, an underpowered USB port, or a damaged USB enclosure rather than the drive itself. First, try a different, high-quality USB cable. Also try connecting directly to a USB port on the computer rather than through a hub. If errors persist across multiple cables and ports, the drive's storage hardware may be failing.