Inspect metadata consistency on the unmounted XFS partition /dev/sdb1.
Run the initial investigation in no-modify mode and show possible repairs only.
Which command is appropriate?
xfs_repair -n scans an XFS filesystem without modifying it. Repair operations should normally target an unmounted filesystem; -L is a last resort.
Detailed explanation
xfs_fsr /dev/sdb1Incorrect. xfs_fsr reorganizes file extents online; it is not a consistency check.
Incorrect. xfs_fsr reorganizes file extents online; it is not a consistency check.
xfs_db -x /dev/sdb1Incorrect. xfs_db -x may enable write access rather than a no-modify repair scan.
Incorrect. xfs_db -x may enable write access rather than a no-modify repair scan.
e2fsck -n /dev/sdb1Incorrect. e2fsck -n is for ext filesystems, not XFS.
Incorrect. e2fsck -n is for ext filesystems, not XFS.
xfs_repair -n /dev/sdb1Correct. xfs_repair -n /dev/sdb1 performs a no-modify XFS check.
Correct. xfs_repair -n /dev/sdb1 performs a no-modify XFS check.
Try it yourself
An example you can run in a temporary verification environment.
xfs_repair -VExpected result
xfs_repairのバージョン。実デバイス検査は行わないKey points
- -n means no modify
- Use xfs_repair for XFS
- Unmount before repair
Notes
- Environment: xfsprogs 6.x公式仕様
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.