Initialize the empty test partition /dev/sdb1 as XFS.
Use the XFS-specific creation utility rather than an ext-family tool.
Which command is appropriate?
mkfs.xfs DEVICE creates a new XFS filesystem. xfs_repair is for checking or repairing an existing filesystem and has a different purpose.
Detailed explanation
mkfs.xfs /dev/sdb1Correct. mkfs.xfs /dev/sdb1 creates the XFS filesystem.
Correct. mkfs.xfs /dev/sdb1 creates the XFS filesystem.
xfs_repair /dev/sdb1Incorrect. xfs_repair checks or repairs an existing XFS filesystem.
Incorrect. xfs_repair checks or repairs an existing XFS filesystem.
mkfs.ext4 /dev/sdb1Incorrect. mkfs.ext4 creates ext4, not XFS.
Incorrect. mkfs.ext4 creates ext4, not XFS.
mkswap /dev/sdb1Incorrect. mkswap initializes swap space.
Incorrect. mkswap initializes swap space.
Try it yourself
An example you can run in a temporary verification environment.
mkfs.xfs -VExpected result
xfsprogsのバージョン情報。ファイルシステム作成は行わないKey points
- mkfs.xfs creates XFS
- xfs_repair repairs
- Confirm the target device
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.