I am trying to fix a 9 TB filesystem with e2fsck, however the scan always fails after about 10% or so with the following error:

Error storing directory block information: ... Memory allocation failed
e2fsck: aborted

The machine runs Ubuntu 10 (64 bit) and has 4 GB of memory. I have noticed that during checks the ram is getting nearly exhausted even though top only reports only 22% usage by the application and the memory can be reclaimed by a drop_caches. The swap space isn't touched.

In any case, I have approached this by giving e2fsck a scratch_files location which it fills with about 500M by the time it fails. Additionally, I have also set swapon -a, which also seem to prolong e2fsck's crashes.

How can I tune e2fsck so it doesn't crash? Is there any better way to repair my fs?

  • hmm... I have not tried from a boot cd yet... i'll have to give this a go today... i was hoping to not have to take the machine out of production since the drive i'm trying to e2fsck isn't critical for the servers use. But at this point i can't keep eating up all available memory each time I try to run e2fsck so whats the difference? lol. I'll report back any findings. – Jason Jul 11 '11 at 16:51
  • Maybe a duplicate of serverfault.com/questions/9218/… ? – Giovanni Toraldo Nov 12 '11 at 15:57

Sounds like you're running e2fsck from the local OS?

I don't know if it would make a difference or not, but what happens if you try from a LiveCD? Some have a lomem boot option, have you looked into that?

For lack of a better idea as of yet, is that an option?

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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