English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux e2fsck command

Linux Command大全

Linux e2fsck command is used to check the file system using Linux ext2 Whether the partition of the file system is working normally.

Syntax

e2fsck [-pacnydfvFV] [-b superblock] [-B blocksize] [-l|-L bad_blocks_file] [-C fd] device

Parameter description:

  • device : The hard disk partition to be pre-checked, for example:/dev/sda1
  • -a : Check the partition, automatically repair if there is a problem, equivalent to -The function of p
  • -b : Set the position where the superblock is stored
  • -B : Set the size of the unit block
  • -c : Check if the partition has bad tracks
  • -C file : Save the check results to file for review
  • -d : Print e2Debug results of fsck
  • -f : Force check
  • -F : Clear the device's buffer cache before starting the check to avoid errors
  • -l bad_blocks_file : Add the bad track block information to bad_blocks_file
  • -L bad_blocks_file : Set the bad track block information to bad_blocks_file, if there is no file, it will be automatically generated
  • -n : Open the file system in [Read-only] mode
  • -p : Check the partition, and automatically repair if there are problems
  • -v : Detailed display mode
  • -V : Display the current e2Version of fsck
  • -y : Pre-set all the questions to be answered[Yes] during the check

Online Examples

Check /dev/hda5 Is it normal, if there is an exception, it will be automatically repaired, and if there are questions, all answer[Yes] :

e2fsck -a -y /dev/hda5

Note :

Mostly use e2Perform an fsck check on the hard disk partition, it is usually a special situation, so it is best to unmount the partition first, then execute e2Perform an fsck check, if necessary. / If so, please enter singal user mode and then execute.

Linux Command大全