Windows
Linux
System & Storage
Disk & Storage
Windows chkdsk equivalent in Linux
Scans and repairs filesystem errors on a disk or partition.
Windows
→
chkdsk
Linux equivalents
fsck
fsck
fsck
Overview
What this command does
Scans and repairs filesystem errors on a disk or partition.
Migration tip: Never run fsck on a mounted drive — you must unmount it first or boot from a live USB. Linux usually auto-checks disks on boot if needed.
Practical tasks
Common use cases
Check filesystem integrity
Scans and repairs filesystem errors on a disk or partition.
fsck -n
Dry run — check only, make no changes
fsck -y
Automatically answer yes to all fixes
fsck -v
Verbose output
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
umount /dev/sdb1
fsck /dev/sdb1
fsck -y /dev/sdb1
sudo touch /forcefsck
Walkthrough
Examples with explanations
# Windows: chkdsk C: /f
# First, unmount the drive (REQUIRED):
umount /dev/sdb1
fsck /dev/sdb1 # check the partition
fsck -y /dev/sdb1 # auto-fix all errors
# Check your root partition — needs live USB or:
sudo touch /forcefsck # force check on next reboot
Reference
Common options and variations
| Command or option | Use |
|---|---|
fsck -n | Dry run — check only, make no changes |
fsck -y | Automatically answer yes to all fixes |
fsck -v | Verbose output |
fsck /dev/sdb1 | Check a specific partition |
e2fsck | fsck for ext2/ext3/ext4 filesystems |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | same command | fsck |
Same command on this distribution. |
| Fedora | same command | fsck |
Same command on this distribution. |
| Arch | same command | fsck |
Same command on this distribution. |
Important
What to watch out for
Running fsck on a mounted filesystem can cause severe data corruption. Always unmount first.
Keep learning