When to use fsck
Use fsck to check or repair a filesystem only after identifying its type and checking whether it is mounted. Read the instructions for that filesystem first. Do not repair a filesystem while it is mounted and writable; use the recommended offline or recovery procedure.
Syntax
fsck [OPTIONS] [FILE_SYSTEM]Square brackets mark optional arguments; an ellipsis means repetition. Replace example file names, user names and server addresses with your own values.
Common options and arguments
Usage examples
See which validation tool will be called
sudo fsck -N /dev/vdb1The checker that would run is displayed without executing a repair.
Determine file system type
lsblk -fFilesystem types and identifiers are inspected to verify the intended partition.
Check mount status
findmnt /dev/vdb1The current mount relationship for the selected source is inspected.
Notes and limitations
- Do not repair a mounted filesystem in use. Back up your data and follow the procedure for the specific filesystem.
- fsck dispatches to filesystem-specific fsck.* tools. Options and support vary; XFS, for example, uses other tools.
Common questions and troubleshooting
Can I repair a mounted filesystem with fsck?
Ordinary offline repair generally requires the filesystem to be unmounted. Follow the filesystem's own recovery procedure and never assume a live root volume is safe.
Does a dry run prove the filesystem is healthy?
No. Showing the selected checker is not a full consistency test. Treat it as preparation, not a successful repair or health result.
Further help
Options vary by version and distribution. Check the installed documentation with this command: man fsck.