Check and repair unmounted XFS /dev/vgdata/lvmedia.
Do not use an ext-family tool.
Which command is appropriate?
xfs_repair checks and repairs XFS metadata offline. e2fsck is for ext2/3/4 and mkfs creates a new filesystem.
Detailed explanation
xfs_repair /dev/vgdata/lvmediaCorrect. xfs_repair checks and repairs the unmounted XFS filesystem.
Correct. xfs_repair checks and repairs the unmounted XFS filesystem.
e2fsck /dev/vgdata/lvmediaIncorrect. e2fsck is for ext2/3/4, not XFS.
Incorrect. e2fsck is for ext2/3/4, not XFS.
mkfs.xfs /dev/vgdata/lvmediaIncorrect. mkfs.xfs recreates the filesystem and can destroy data.
Incorrect. mkfs.xfs recreates the filesystem and can destroy data.
xfs_growfs /srv/mediaIncorrect. xfs_growfs expands a mounted filesystem.
Incorrect. xfs_growfs expands a mounted filesystem.
Try it yourself
An example you can run in a temporary verification environment.
xfs_repair -V 2>&1Expected result
xfs_repair versionの表示Key points
- xfs_repair is for XFS
- Run offline
- Do not confuse repair with mkfs
Notes
- Environment: xfsprogs xfs_repair / バージョン表示のみ
- 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.