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
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:
2. Unmount the filesystem in question.
3. Run the filesystem consistency checking program for XFS filesystems xfs_check below:
# xfs_check -sv [filesystem]
-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’.