Disk

fsck

Check and repair Linux filesystems for errors and inconsistencies.

Synopsis

syntax
fsck [OPTION]... [DEVICE]...

Examples

Check filesystem on sda1
sudo fsck /dev/sda1
Auto-fix all errors
sudo fsck -y /dev/sdb1
Check only, don't repair
sudo fsck -n /dev/sda2
Force check even if marked clean
sudo fsck -f /dev/sda1

Common options

FlagDescription
-yAssume yes to all questions
-nAssume no — check only
-fForce check even if clean
-tSpecify filesystem type
-pAuto-repair (safe fixes only)

About fsck

The `fsck` command check and repair Linux filesystems for errors and inconsistencies. Disk commands handle low-level storage operations including partitioning, formatting, filesystem checks, and block device management.

These tools are critical during system installation, storage expansion, data recovery, and performance tuning. Always exercise caution — disk operations can cause data loss if used incorrectly.

The command accepts 5 commonly used flags shown above, though the full set of options is available in the man page (`man fsck`). The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More Disk Commands

Other commands in the Disk category

Related tools