Back to the command reference

fsck

DisksAdvanced In real Linux

Check and repair a file system

Name: fsck = file system check

This command needs a real Linux system; you can practise it in real Linux mode.

Full man page

Description

fsck checks a file system's consistency and tries to repair errors, such as damage after a power cut. Run it only on **unmounted** file systems, or you may cause worse damage. The root file system is usually checked at boot.

Syntax

fsck [OPTION]... DEVICE

Common options

-yFix problems automatically
-nCheck only
-ACheck every file system in /etc/fstab
-t TYPECheck only file systems of this type
-CShow a progress bar

Examples

  • $ sudo fsck -n /dev/sda1

    Check only, change nothing (-n)

    Explain

Related