Sunday, July 13, 2008

fscking large ext2/ext3 volumes

If you got following memory allocation error while fscking a large ext2/ext3 volume on a 32-bit system

/dev/sdaX contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Error allocating directory block array: Memory allocation failed
e2fsck: aborted

You can try one of the following methods:
1- boot with a 64-bit live cd and fsck your volume
2- if you don't have a 64-bit cpu, use your one of the partitions or disks for fsck cache.
edit following file
/etc/e2fsck.conf

and add following lines to point fsck to a directory where it can store it's cache files during fsck.
[scratch_files]
directory = /home/myuser/tmp/

be sure that the directory exists, before running fsck.By this way you will reduce the needed memory for fsck. The disadvantage is disk is slow, therefore fsck will take more time to finish it's job.

No comments: