Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a box running Ubuntu 11.10 with 512MB RAM and no swap. It has a 1TB USB HDD with ext3 filesystem attached. Sitting idle, it's only using about 60MB. When I run e2fsck, it runs out of memory, the OOM killer kicks in, and e2fsck dies.

Is there any trick to running e2fsck so that it uses less memory?

I ran:

sudo e2fsck -n /dev/sdb1

[Please don't tell me to enable swap or add memory -- I can't enable swap, and adding memory is the obvious long-term fix. I'd like a way to run fsck now.]

share|improve this question

1 Answer

I'm not sure which version of e2utils Ubuntu 11.10 has, however if it's fairly recent you can create /etc/e2fsck.conf file with something like this:

[scratch_files]
directory = /tmp/e2fs_scratch

Create that directory first, then run e2fsck. Using scratch file will greatly reduce memory use, however e2fsck will run very very slowly.

Of course if you need to check your root fs, you'll need to boot into another root, as the scratch directory will need to be writable.

share|improve this answer
Thanks, I'll try that. I figured there'd be a speed-memory tradeoff, so that should be ok. I'll kick it off tonight. – bstpierre Nov 30 '11 at 19:17

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.