System and processes

The fsck command

Checks and repairs the integrity of a filesystem. It is Linux's 'chkdsk'.

Syntax

fsck [-y] DISPOSITIVO

Most useful options

-yAnswers yes to everything automatically
-nOnly checks, does not repair

Copy-ready examples

$ sudo fsck /dev/sda1Check a partition

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • Do not run it on a mounted partition: it can corrupt data.
  • Back up before repairing with -y.

Related commands

FAQ

How often should I use it?

Only when there are signs of corruption or after an abrupt shutdown.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course