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 ... or blk_update_request point to the disk or its connection.
  • Lines such as XFS (sdb1): Corruption detected, Metadata I/O error or Filesystem has been shut down due to log error mean 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

  1. Stop the services that use it and unmount it:
    umount /data
    If it refuses because it is busy, find the processes with fuser -vm /data. For the root file system, boot rescue media instead.
  2. Check without changing anything:
    xfs_repair -n /dev/sdb1
  3. Repair:
    xfs_repair /dev/sdb1
  4. 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_repair again.
  5. Mount it and check your data: mount /data. Files that XFS could not place are in a lost+found folder.

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 -ll and 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.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Managed dedicated servers

our engineers look after the server for you, from $135 a month.

Was this answer helpful?

Still stuck? Open a ticket