Linux EIO (errno 5) — Input/Output Error (Deep Dive)
About Linux EIO (errno 5)
Deep dive into Linux EIO covering disk hardware failures, NFS stale handles, USB device disconnection, and kernel driver I/O failures. This guide covers everything you need to know about this topic, including common causes, step-by-step solutions, and answers to frequently asked questions.
Here are the key things to understand: EIO (errno 5) indicates a low-level I/O failure that could not be retried or recovered. For block devices: often means physical media failure (bad sectors, drive dying). For NFS: can indicate a stale file handle or network interruption. For USB: device was disconnected during I/O operation. Check dmesg and /var/log/syslog for detailed hardware error messages. Understanding these fundamentals will help you diagnose and resolve this issue more effectively.
The most common reasons this occurs include: Hard drive or SSD with bad sectors or failing controller. NFS server disconnected or exported file system unmounted. USB device physically disconnected during read/write. RAID array with degraded disk returning errors. Kernel driver bug causing I/O request to fail. Identifying the root cause is the first step toward finding the right solution.
To resolve this, follow these recommended steps: Check kernel messages: dmesg | tail -50 for I/O error details. For HDD/SSD: run smartctl -a /dev/sdX to check SMART health data. For bad sectors: sudo badblocks -sv /dev/sdX to scan (read-only test). For NFS: remount the share: sudo umount -f /mnt/nfs && sudo mount /mnt/nfs. Check filesystem: sudo fsck -y /dev/sdXY (unmount first). If these steps do not resolve the issue, consider consulting additional resources or a qualified professional.
This article is part of our Linux Error Codes collection on Error Codes Wiki. We provide comprehensive, up-to-date information to help you find solutions quickly.
Quick Answer
Is EIO always a hardware failure?
Often yes for local disks, but for NFS and USB it can be a connectivity issue. Check dmesg for the specific error source.
Overview
Deep dive into Linux EIO covering disk hardware failures, NFS stale handles, USB device disconnection, and kernel driver I/O failures.
Key Details
- EIO (errno 5) indicates a low-level I/O failure that could not be retried or recovered
- For block devices: often means physical media failure (bad sectors, drive dying)
- For NFS: can indicate a stale file handle or network interruption
- For USB: device was disconnected during I/O operation
- Check dmesg and /var/log/syslog for detailed hardware error messages
Common Causes
- Hard drive or SSD with bad sectors or failing controller
- NFS server disconnected or exported file system unmounted
- USB device physically disconnected during read/write
- RAID array with degraded disk returning errors
- Kernel driver bug causing I/O request to fail
Steps
- 1Check kernel messages: dmesg | tail -50 for I/O error details
- 2For HDD/SSD: run smartctl -a /dev/sdX to check SMART health data
- 3For bad sectors: sudo badblocks -sv /dev/sdX to scan (read-only test)
- 4For NFS: remount the share: sudo umount -f /mnt/nfs && sudo mount /mnt/nfs
- 5Check filesystem: sudo fsck -y /dev/sdXY (unmount first)