Score:0

xfs_repair runs instantly, surely this should take some time to run?

io flag

I'm trying to troubleshoot some issues with multiple database engines crashing and logs suggesting corruption while reading from disk, so I'm running xfs_repair on a 2TB NVMe which contains the files.

However the program runs instantly which doesn't seem right, surely this should take some time to run?

# time xfs_repair /dev/nvme1n1
Phase 1 - find and verify superblock...
Phase 2 - using internal log
        - zero log...
        - scan filesystem freespace and inode maps...
        - found root inode chunk
Phase 3 - for each AG...
        - scan and clear agi unlinked lists...
        - process known inodes and perform inode discovery...
        - agno = 0
        - agno = 1
        - agno = 2
        - agno = 3
        - process newly discovered inodes...
Phase 4 - check for duplicate blocks...
        - setting up duplicate extent list...
        - check for inodes claiming duplicate blocks...
        - agno = 0
        - agno = 3
        - agno = 2
        - agno = 1
Phase 5 - rebuild AG headers and trees...
        - 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

real    0m0.060s
user    0m0.033s
sys     0m0.025s
Score:1
cn flag

0.06 seconds is quite a long time for a computer...

xfs_repair does not read data, it sanity checks file system metadata. A database might have a small number of files, which is a small number of metadata I/Os. Helps that NVMe storage is typically fast. Yes, xfs_repair is complete when it says done.

Getting to the root cause of corruption problems is not easy. Enlist the help of database and file system support willing to stare at block dumps with you. Sometimes the mystery might remain unsolved for a long time, might need to fix storage hardware, restore or rebuild data, and leave it at that.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.