0

I've got a filesystem that, after a crash, is corrupted according to xfs_repair -n. As stated in the xfs_repair man page, xfs_repair -n exists with a return status 1 if corruption is detected. So I ran xfs_repair on the filesystem and then ran xfs_repair -n again. Still the exit status is 1.

According to XFS for Linux Administration Ch 4 it may take up to three xfs_repair runs to fix all problems. I've run it 4 times now, and still the exit status of xfs_repair -n is 1. The filesystem mounts, so I can in principle access the data, but I would like to know if there are any other options to find out what is actually corrupted and how to fix it.

Output of xfs_repair -n:

Phase 1 - find and verify superblock...
        - reporting progress in intervals of 15 minutes
Memory available for repair (2048MB) may not be sufficient.
At least 2368MB is needed to repair this filesystem efficiently
If repair fails due to lack of memory, please
turn prefetching off (-P) to reduce the memory footprint.
Phase 2 - using internal log
        - scan filesystem freespace and inode maps...
        - 22:27:46: scanning filesystem freespace - 32 of 32 allocation groups done
        - found root inode chunk
Phase 3 - for each AG...
        - scan (but don't clear) agi unlinked lists...
        - 22:27:46: scanning agi unlinked lists - 32 of 32 allocation groups done
        - process known inodes and perform inode discovery...
        - agno = 0
        - agno = 30
        - agno = 15
        - agno = 16
        - agno = 31
        - agno = 1
        - agno = 17
        - agno = 18
        - agno = 19
        - agno = 2
        - agno = 20
        - agno = 21
        - agno = 3
        - agno = 22
        - agno = 4
        - agno = 23
        - agno = 24
        - agno = 5
        - agno = 25
        - agno = 6
        - agno = 26
        - agno = 27
        - agno = 7
        - agno = 28
        - agno = 8
        - agno = 29
        - agno = 9
        - agno = 10
        - agno = 11
        - agno = 12
        - agno = 13
        - agno = 14
        - 22:27:54: process known inodes and inode discovery - 4166208 of 4166208 inodes done
        - process newly discovered inodes...
        - 22:27:54: process newly discovered inodes - 32 of 32 allocation groups done
Phase 4 - check for duplicate blocks...
        - setting up duplicate extent list...
        - 22:27:55: setting up duplicate extent list - 32 of 32 allocation groups done
        - check for inodes claiming duplicate blocks...
        - agno = 0
        - agno = 15
        - agno = 30
        - agno = 16
        - agno = 1
        - agno = 17
        - agno = 31
        - agno = 18
        - agno = 2
        - agno = 19
        - agno = 3
        - agno = 20
        - agno = 21
        - agno = 4
        - agno = 22
        - agno = 5
        - agno = 23
        - agno = 6
        - agno = 24
        - agno = 7
        - agno = 25
        - agno = 8
        - agno = 26
        - agno = 9
        - agno = 10
        - agno = 27
        - agno = 11
        - agno = 28
        - agno = 12
        - agno = 29
        - agno = 13
        - agno = 14
        - 22:28:03: check for inodes claiming duplicate blocks - 4166208 of 4166208 inodes done
No modify flag set, skipping phase 5
Phase 6 - check inode connectivity...
        - traversing filesystem ...
        - traversal finished ...
        - moving disconnected inodes to lost+found ...
Phase 7 - verify link counts...
No modify flag set, skipping filesystem flush and exiting.

And here's the output of the last xfs_repair run:

Phase 1 - find and verify superblock...
        - reporting progress in intervals of 15 minutes
Memory available for repair (2048MB) may not be sufficient.
At least 2368MB is needed to repair this filesystem efficiently
If repair fails due to lack of memory, please
turn prefetching off (-P) to reduce the memory footprint.
Phase 2 - using internal log
        - zero log...
        - scan filesystem freespace and inode maps...
        - 22:31:08: scanning filesystem freespace - 32 of 32 allocation groups done
        - found root inode chunk
Phase 3 - for each AG...
        - scan and clear agi unlinked lists...
        - 22:31:08: scanning agi unlinked lists - 32 of 32 allocation groups done
        - process known inodes and perform inode discovery...
        - agno = 0
        - agno = 30
        - agno = 15
        - agno = 16
        - agno = 31
        - agno = 1
        - agno = 17
        - agno = 18
        - agno = 2
        - agno = 19
        - agno = 20
        - agno = 3
        - agno = 21
        - agno = 4
        - agno = 22
        - agno = 5
        - agno = 23
        - agno = 6
        - agno = 24
        - agno = 7
        - agno = 25
        - agno = 8
        - agno = 26
        - agno = 9
        - agno = 27
        - agno = 10
        - agno = 28
        - agno = 29
        - agno = 11
        - agno = 12
        - agno = 13
        - agno = 14
        - 22:31:16: process known inodes and inode discovery - 4166208 of 4166208 inodes done
        - process newly discovered inodes...
        - 22:31:16: process newly discovered inodes - 32 of 32 allocation groups done
Phase 4 - check for duplicate blocks...
        - setting up duplicate extent list...
        - 22:31:17: setting up duplicate extent list - 32 of 32 allocation groups done
        - check for inodes claiming duplicate blocks...
        - agno = 0
        - agno = 15
        - agno = 30
        - agno = 16
        - agno = 31
        - agno = 1
        - agno = 17
        - agno = 18
        - agno = 2
        - agno = 19
        - agno = 3
        - agno = 20
        - agno = 4
        - agno = 21
        - agno = 5
        - agno = 6
        - agno = 22
        - agno = 7
        - agno = 8
        - agno = 23
        - agno = 24
        - agno = 9
        - agno = 25
        - agno = 10
        - agno = 11
        - agno = 26
        - agno = 12
        - agno = 27
        - agno = 13
        - agno = 28
        - agno = 14
        - agno = 29
        - 22:31:25: check for inodes claiming duplicate blocks - 4166208 of 4166208 inodes done
Phase 5 - rebuild AG headers and trees...
        - 22:31:28: rebuild AG headers and trees - 32 of 32 allocation groups done
        - reset superblock...
Phase 6 - check inode connectivity...
        - resetting contents of realtime bitmap and summary inodes
        - traversing filesystem ...
        - traversal finished ...
        - moving disconnected inodes to lost+found ...
Phase 7 - verify and correct link counts...
done
0

It turns out that this problem, like my other one with an Ext4 fs, was caused by the fact that my rescue CD had 32 bit binaries of the xfstools (even though the kernel itself was 64 bit).

So I ended up mounting the root partition (which was ok) and chrooting into it to run xfs_repair -n from there. As I had hoped, it returned 0.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.