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.
e2fsck /dev/vgdata/lvmediaIncorrect. e2fsck is for ext2/3/4, not XFS.
mkfs.xfs /dev/vgdata/lvmediaIncorrect. mkfs.xfs recreates the filesystem and can destroy data.
xfs_growfs /srv/mediaIncorrect. 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 / バージョン表示のみ
- Prefer help or version output and a disposable device when testing storage commands.
- Formatting, repair, and mount changes can affect data or availability.
Foundation review
Place the operation
Repair, creation, and growth have different tools and different risks.
Check the side effect
Use xfs_repair -n for a no-modify diagnostic when appropriate.