解决XFS文件系统NFS输出Stale NFS file handle错误
公司有一台SAN存储,其中划出了26TB的容量通过open-iscsi输出到某台Ubuntu Server上,然后再在这台Ubuntu Server配置好NFS,将26TB共享至其它Clients上。一直使用的好好的,在某一天,客户端在挂载时,突然就出现了Stale NFS file handle的错误。经过无数次谷歌以后,找到了解决方案。这里记录一下。
一开始,以为是分区出现逻辑错误,准备尝试fsck一下(XFS文件系统不能使用fsck命令),于是有了以下过程
$ sudo xfs_check /dev/vg-15k/users
ERROR: The filesystem has valuable metadata changes in a log which needs to
be replayed. Mount the filesystem to replay the log, and unmount it before
re-running xfs_check. If you are unable to mount the filesystem, then use
the xfs_repair -L option to destroy the log and attempt a repair.
Note that destroying the log may cause corruption -- please attempt a mount
of the filesystem before doing this.
$ sudo xfs_repair /dev/vg-15k/users
Phase 1 - find and verify superblock...
Phase 2 - using internal log
- zero log...
ERROR: The filesystem has valuable metadata changes in a log which needs to
be replayed. Mount the filesystem to replay the log, and unmount it before
re-running xfs_repair. If you are unable to mount the filesystem, then use
the -L option to destroy the log and attempt a repair.
Note that destroying the log may cause corruption -- please attempt a mount
of the filesystem before doing this.
$ sudo xfs_repair -L /dev/vg-15k/users
Phase 1 - find and verify superblock...
Phase 2 - using internal log
- zero log...
ALERT: The filesystem has valuable metadata changes in a log which is being
destroyed because the -L option was used.
- scan filesystem freespace and inode maps...
sb_icount 64, counted 4884352
sb_ifree 61, counted 15726
sb_fdblocks 2683832778, counted 1409694604
- 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
- agno = 4
- agno = 5
- agno = 6
- agno = 7
- agno = 8
- agno = 9
- process newly discovered inodes...
Phase 4 - check for duplicate blocks...
- setting up duplicate extent list...
- check for inodes claiming duplicate blocks...
- agno = 0
- agno = 1
- agno = 3
- agno = 2
- agno = 4
- agno = 5
- agno = 6
- agno = 7
- agno = 9
- agno = 8
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
Read More