Which command line utilities to repair a corrupted file system in Linux?

Hi guys
One thing i would like to learn in Linux is dealing with a corrupted file system in terms of detecting file system errors plus many more and fixing them.
I was just wondering of available command line utilities that one can use to repair a corrupted Linux file system.
And also if such utilities can be used to repair Windows file systems including how it can be done.

The best one to use due to my experience is “fsck”, read about its options and abilities.

Thanks let me find more about it…


You can use FSCK command line to check/ repair a corrupted file system in Linux.

FSCK is used to check and optionally repair one or more Linux filesystems. fsck will default to checking filesystems in /etc/fstab serially.

The exit code returned by fsck is the sum of the following conditions:
0 - No errors
1 - Filesystem errors corrected
2 - System should be rebooted
4 - Filesystem errors left uncorrected
8 - Operational error
16 - Usage or syntax error
32 - Fsck canceled by user request
128 - Shared-library error
The exit code returned when multiple filesystems are checked is the bit-wise OR of the exit codes for each filesystem that is checked.

Of course, you can use “man fsck” to get more valuable.