• 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

XFS Filesystem Gets Mounted As Readonly (CentOS/RHEL)

by admin

The Problem

Command ‘df’ shows statistics but ‘ls -ld’ fails below:

# df
...      
/dev/mapper/vgapp-appsvol      419221508 15095588 404125920   4% /lapps/app
# ls -l /lapps/apps
ls: cannot access /lapps/app: Input/output error

The Solution

Disk failure cases input/output operation stopped, so filesystem is re-mounted as read-only. This is an expected behavior of the kernel to mount a filesystem as read-only to avoid further file system corruption leading to inconsistencies, whenever the underneath disk devices become inaccessible.

After resolving the underneath disk problem, to restore filesystem consistency you can do the followings:

1. Boot to rescue mode to take a back up of the file system. For detailed instruction please refer to below post:

CentOS / RHEL 5 : How to Boot into Rescue Mode
CentOS / RHEL 6 : How to boot into rescue mode

2. Unmount the filesystem in question.

3. Run the filesystem consistency checking program for XFS filesystems xfs_check below:

# xfs_check -sv [filesystem]

Where,

-s – Specifies that only serious errors should be reported. Serious errors are those that make it impossible to find major data structures in the filesystem. This option can be used to cut down the amount of output when there is a serious problem when the output might make it difficult to see what the real problem is.
-v – Specifies verbose output; it is impossibly long for a reasonably-sized filesystem. This option is intended for internal use only.
For other options please check the online manual by running ‘man xfs_check’.

Filed Under: CentOS/RHEL 5, CentOS/RHEL 6

Some more articles you might also be interested in …

  1. How To Masquerade Sender Address In Sendmail in CentOS/RHEL
  2. How to Enable Disk Quotas on an XFS File System
  3. How to configure CentOS/RHEL 6 system to not used last 3 passwords used
  4. How To Limit/Restrict FTP Commands On Vsftpd Services (CentOS/RHEL 6,7)
  5. Understanding /etc/security/limits.conf file
  6. How to disable or enable an HBA without reboot under CentOS/RHEL
  7. How to enable the automatic extension for a thin LVM volume
  8. How to remove the multipath device after unmapping the storage LUN from server
  9. How to use “xfs_admin” command to change parameters of an XFS filesystem
  10. Spacewalk Installation Steps On CentOS/RHEL

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright