12.2.2. XFS


No repair is performed automatically at boot time. To initiate a filesystem check or repair, the xfs_repair tool is used.

注意

Although an fsck.xfs binary is present in the xfsprogs package, this is present only to satisfy initscripts that look for an fsck.filesystem binary at boot time. fsck.xfs immediately exits with an exit code of 0.
Another thing to be aware of is that older xfsprogs packages contain an xfs_check tool. This tool is very slow and does not scale well for large filesystems. As such, it has been depreciated in favor of xfs_repair -n.
A clean log on a filesystem is required for xfs_repair to operate. If the filesystem was not cleanly unmounted, it should be mounted and unmounted prior to using xfs_repair. If the log is corrupt and cannot be replayed, the -L option may be used to zero the log.

重要

The -L option must only be used if the log cannot be replayed. The option discards all metadata updates in the log and will result in further inconsistencies.
It is possible to run xfs_repair in a dry run, check-only mode by using the -n option. No changes will be made to the filesystem when this option is specified.
xfs_repair takes very few options. Commonly used options include:
-n
No modify mode. Check-only operation.
-L
Zero metadata log. Use only if log cannot be replayed with mount.
-m maxmem
Limit memory used during run to maxmem MB. 0 can be specified to obtain a rough estimate of the minimum memory required.
-l logdev
Specify the external log device, if present.
All options for xfs_repair are specified in the xfs_repair(8) manual page.
The following eight basic phases are performed by xfs_repair while running:
  1. Inode and inode blockmap (addressing) checks.
  2. Inode allocation map checks.
  3. Inode size checks.
  4. Directory checks.
  5. Pathname checks.
  6. Link count checks.
  7. Freemap checks.
  8. Superblock checks.
These phases, as well as messages printed during operation, are documented in depth in the xfs_repair(8) manual page.
xfs_repair is not interactive. All operations are performed automatically with no input from the user.
If it is desired to create a metadata image prior to repair for diagnostic or testing purposes, the xfs_metadump(8) and xfs_mdrestore(8) utilities may be used.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.