Updated: 4 November 2026 · Applies to: xfsprogs 6.x on AlmaLinux and Rocky Linux 9 and 10, RHEL 9 and 10, Ubuntu 24.04 and 26.04, Debian 13
"Input/output error" when reading or writing files on XFS means either the disk underneath is failing, or XFS found damaged metadata and shut the file system down to protect it. The kernel log tells you which. Act quickly but carefully: repeated writes to a failing disk can make things worse.
1. Read the kernel log
journalctl -k -b | grep -iE 'xfs|i/o error|blk_update_request|ata|nvme' | tail -30
- Lines such as
I/O error, dev sdb, sector ...orblk_update_requestpoint to the disk or its connection. - Lines such as
XFS (sdb1): Corruption detected,Metadata I/O errororFilesystem has been shut down due to log errormean XFS stopped the file system. After this, every access returns "Input/output error" until it is unmounted and repaired.
2. Check the disk
smartctl -H /dev/sdb smartctl -a /dev/sdb | grep -iE 'reallocated|pending|uncorrectable|media'
Growing reallocated, pending or uncorrectable counts mean the disk is failing: copy the data you still can to another disk first, and replace it. See how to monitor disk health with smartd. On a VPS, report the errors to your provider instead; the physical disks are theirs.
3. Repair the file system
- Stop the services that use it and unmount it:
umount /data
If it refuses because it is busy, find the processes withfuser -vm /data. For the root file system, boot rescue media instead. - Check without changing anything:
xfs_repair -n /dev/sdb1
- Repair:
xfs_repair /dev/sdb1
- If it refuses with a message about a dirty log, mount and unmount the file system once so the log is replayed, then run
xfs_repairagain. - Mount it and check your data:
mount /data. Files that XFS could not place are in alost+foundfolder.
xfs_repair -L zeroes the log and can lose the latest changes. Use it only when mounting is impossible and you have accepted that risk.
Other causes
- A disconnected SAN or iSCSI disk: the errors start when the path is lost. Check
multipath -lland the network to the storage. - A full thin-provisioned volume (LVM thin pool or storage array): writes fail with I/O errors when the pool is full. Check
lvs.
Official documentation: xfs_repair manual page.