• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Input/Output Errors During XFS Filesystem Access In CentOS/RHEL 7

by admin

The Problem

While accessing a directory mounted on XFS filesystem, it is throwing Input/Output errors on any command as in the example below:

[root@OL7-VM mnt]# cd /u01
[root@OL7-VM u01]# ll
ls: cannot open directory .: Input/output error
[root@OL7-VM u01]# cd /mnt
[root@OL7-VM mnt]# ll
ls: cannot open directory .: Input/output error

The Solution

It appears that the issue was caused by some type of corruption on the filesystem that caused it became unresponsive. Run file system check and repair the filesystem corruption.

Possible scenarios:

  1. The affected device is a physical volume of the LVM where the root filesystem is mounted on it.
  2. The affected device is a physical volume of the LVM where the root filesystem is not mounted on it
  3. The affected device is not a physical volume of the LVM configuration but root filesystem is mounted on it
  4. The affected device is not a physical volume of the LVM configuration where the root filesystem is not mounted on it but another filesystem is

For scenario 1 and 3:

1. Reboot the system and boot with Rescue mode

Refer to the following post in order to know how to boot into Rescue Mode

CentOS / RHEL 7 : How to boot into rescue mode from installation DVD/ISO
CentOS / RHEL 7 : How to boot into Rescue Mode or Emergency Mode
NOTE: Choose ‘Skip‘ instead of ‘Continue‘ while booting CentOS/RHEL 7 into rescue mode to make sure file system of system are not mounted when booting into rescue mode.

2. Run the following commands to activate the LVM.

# lvm pvscan
# lvm vgscan
# lvm lvscan
# lvm lvchange -ay /dev/mapper/vgName-lvName

3. Run file system check and repair.

# xfs_repair /dev/deviceName

4. Reboot the system

# shutdown -r now

For scenario 2 and 4:

There is no need to boot to rescue mode, the filesystem check and repair can run while the system is up and running. Just make sure the system is not in production.

1. Unmount the filesystem

# umount /file_systemName

2. Run file system check and repair

# xfs_repair /dev/deviceName

3. Reboot the system.

# shutdown -r now

Filed Under: CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL 5,6 : How to reinstall GRUB loader from rescue mode
  2. airodump-ng – Capture packets and display information about wireless networks (Command Examples)
  3. How to Install and configure telnet in RHEL / CentOS 5,6
  4. smbget: command not found
  5. ln: command not found
  6. CentOS / RHEL : How to install and start the Apache httpd service
  7. How to disable NUMA on EFI Boot Loaders using GRUB2 (CentOS/RHEL 6)
  8. How to configure VNC Server on CentOS/RHEL 6
  9. libreoffice Command Examples in Linux
  10. CentOS / RHEL 7 : How to password protect GRUB2 menu entries

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright