Linux fsck Command
The Linux fsck (full English name: file system check) command is used to check and repair Linux file systems, and can check one or more Linux file systems at the same time.
Syntax
fsck [-sACVRP] [-t fstype] [--] [fsck-options] filesys [...]
Parameters:
- filesys: device name (e.g., /dev/sda1), mount point (e.g., / 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 commands one by one in sequence 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 / without checking.
- -V: Verbose display mode.
- -a: Automatically repair if errors are found during the check.
- -r: If errors are found during the check, the user is prompted to answer whether to repair.
Examples
Check whether the msdos file system on /dev/hda5 is normal, and automatically repair it if there are abnormalities:
fsck -t msdos -a /dev/hda5
NoteThis command can be understood by cross-referencing and operating with /etc/fstab.
Other Extensions
Linux Command Collection