Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

On my laptop with a SSD, executing the following command:

sudo fsck -f -E fragcheck /dev/sda1

results in several hundred occurrences of a message similar to this (this is one exact message, the others have different numbers):

3023363(f): expecting 5845074 actual extent phys 11049254 log 8 len 2

My expectation is that fsck should correct errors. But when I execute the command again, the same errors are reported.

  1. What additional switches are required to get fsck to correct these errors?
  2. What exactly does this error mean (I am looking for something more informative than it was expecting one number but found another)?
  3. Is there any documentation that describes this specific error message?
share|improve this question
add comment

1 Answer

What additional switches are required to get fsck to correct these errors?

I don't know what you expect with -f and -E, but fsck do not fix but report if you don't ask him to fix. There are two options to fix the file system:

  • -a: This will fix errors found automatically.

    Automatically repair the filesystem without any questions (use this option with caution). Note that e2fsck(8) supports -a for backward compatibility only. This option is mapped to e2fsck's -p option which is safe to use, unlike the -a option that some filesystem checkers support.

  • -r: This will ask before fixing errors.

    Interactively repair the filesystem (ask for confirmations). Note: It is generally a bad idea to use this option if multiple fsck's are being run in parallel. Also note that this is e2fsck's default behavior; it supports this option for backward compatibility reasons only.

  • There's also -y but is not recommended:

    For some filesystem-specific checkers, the -y option will cause the fs-specific fsck to always attempt to fix any detected filesystem corruption automatically. Sometimes an expert may be able to do better driving the fsck manually. Note that not all filesystem-specific checkers implement this option. In particular fsck.minix(8) and fsck.cramfs(8) do not support the -y option as of this writing.


  • What exactly does this error mean (I am looking for something more informative than it was expecting one number but found another)?

  • Is there any documentation that describes this specific error message?

Actually, fsck is simply a front-end for the various filesystem checkers (fsck.fstype) available under Linux. The filesystem-specific checker is searched for in /sbin first, then in /etc/fs and /etc, and finally in the directories listed in the PATH environment variable. Please see the filesystem-specific checker manual pages for further details. So, for us to know, you have to tell us what filesystem are you checking.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.