Linux command
xfs_repair 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Repair
sudo xfs_repair [path/to/partition]
说明
xfs_repair repairs an XFS filesystem. It checks and fixes filesystem metadata, directory structures, and allocation information. The filesystem must be unmounted before repair. A log replay may be needed first.
参数
- -n
- No modify mode (check only)
- -L
- Force log zeroing (data loss risk)
- -v
- Verbose output
- -d
- Repair dangerously (allow repair on mounted FS)
- -m _MAXMEM_
- Maximum memory usage
FAQ
What is the xfs_repair command used for?
xfs_repair repairs an XFS filesystem. It checks and fixes filesystem metadata, directory structures, and allocation information. The filesystem must be unmounted before repair. A log replay may be needed first.
How do I run a basic xfs_repair example?
Run `sudo xfs_repair [path/to/partition]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -n do in xfs_repair?
No modify mode (check only)