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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. How to Verify a Lun is in Active/Optimized Mode when ALUA Is Configured on Storage
  2. modprobe: command not found
  3. Difference between soft links and hard links in Linux
  4. How To Setup UDEV Rules For RAC OCR And Voting Devices on Partitions
  5. Linux / UNIX : How to send mails with attachments using mailx command
  6. How to Restrict Active Directory Users and Groups to Login to CentOS/RHEL 7 Client
  7. How to use the ssh-keygen Command in Linux
  8. GlusterFS – Real Time Data Replication Across Multiple RHEL/CentOS Nodes
  9. numlockx Command Examples in Linux
  10. mkfs.ntfs: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright