Linux fsck Command
The Linux fsck (short for file system check) command is used to check and repair Linux file systems; it can check one or more file systems at the same time.
Syntax
fsck [-sACVRP] [-t fstype] [--] [fsck-options] filesys [...]
**Parameters **:
- filesys: device name (eg. /dev/sda1), mount point (eg. / or /usr)
- -t: specify the file system type; if it is already defined in /etc/fstab or supported by the kernel itself, this parameter is not needed
- -s: execute the fsck command one at a time in order to check
- -A: check all partitions listed in /etc/fstab
- -C: display the complete check progress
- -d : print the debug results of e2fsck
- -p: when combined with -A, run multiple fsck checks at the same time
- -R: when combined with -A, skip / and do not check it
- -V: verbose display mode
- -a: automatically repair if errors are found during the check
- -r: if errors are found, let the user decide whether to repair
Example
Check whether the msdos file system on /dev/hda5 is normal, and automatically repair it if there are problems:
fsck -t msdos -a /dev/hda5
**Note **This command can be understood by referring to /etc/fstab.
Linux Command Reference