Run fsck on a normal data filesystem during a maintenance window.
The check may modify metadata, so it must be performed safely.
Which general approach is appropriate?
Normally unmount the target before fsck so ordinary writes cannot race with consistency checking. Root filesystems may require rescue mode or boot-time checks.
Detailed explanation
Incorrect. Concurrent writes and repair can corrupt the filesystem.
Incorrect. mkfs destroys the existing filesystem rather than checking it.
Correct. Unmount first, then run the appropriate consistency tool.
Incorrect. Removing a mount directory does not unmount the filesystem.
Try it yourself
An example you can run in a temporary verification environment.
fsck --help 2>&1 | sed -n '1,14p'Expected result
Linux filesystemsをcheck and repairするfsckの使用法Key points
- Normally unmount first
- Use the filesystem-specific tool
- Keep a backup
Notes
- Environment: util-linux fsck / ヘルプ表示のみ
- 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
The correct checker depends on filesystem type; a mounted root may require rescue or boot-time work.
Check the side effect
Keep a backup and use the appropriate offline maintenance environment.