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. Concurrent writes and repair can corrupt the filesystem.
Incorrect. mkfs destroys the existing filesystem rather than checking it.
Incorrect. mkfs destroys the existing filesystem rather than checking it.
Correct. Unmount first, then run the appropriate consistency tool.
Correct. Unmount first, then run the appropriate consistency tool.
Incorrect. Removing a mount directory does not unmount the filesystem.
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 / ヘルプ表示のみ
- 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.