xfs_repair fails in phase 6 with Couldn't map inode
Environment
- Red Hat Enterprise Linux 9
- Red Hat Enterprise Linux 8
- XFS with reflink enabled
- xfsprogs
Issue
- xfs_repair fails in phase 6 with Couldn't map inode
- Cannot repair filesystem
Resolution
This is a bug in xfs_repair utility. Jira has been opened for the issue RHEL-76171(private Jira ticket). If there is need to access the data in emergency mode the NEEDSREPAIR flag can be cleared out manually. After this you will be able to access the filesystem in READ-ONLY recovery mode to try to copy over the data from the filesystem.
Root Cause
At this point it seems that during the repair a directory inode is mark as having reflink which later lead to error in mapping of the directory.
Diagnostic Steps
- xfs_repair is failing with "fatal error -- couldn't map inode 67119584, err = 117"
root@rhel9:~# xfs_repair /dev/mapper/corrupted
Phase 1 - find and verify superblock...
- reporting progress in intervals of 15 minutes
Phase 2 - using internal log
...
Phase 6 - check inode connectivity...
- resetting contents of realtime bitmap and summary inodes
- traversing filesystem ...
- agno = 0
- agno = 1
- agno = 2
Metadata corruption detected at 0x55c1dc469f79, inode 0x40029e0 dinode
fatal error -- couldn't map inode 67119584, err = 117
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments