Error Allocating Block Bitmap 4 Memory Allocation Failed
Contents |
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn fsck error storing directory block information more about Stack Overflow the company Business Learn more about hiring developers or posting qnap swap memory ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site fsck memory allocation failed for system and network administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to qnap check file system the top Running out of memory running fsck on large filesystems up vote 9 down vote favorite 3 I look after an old Debian linux box (running etch) with only 512 MB of RAM, but a lot of external storage attached. One ext3 filesystem is 2.7 TB in size, and fsck can't check it, because it runs out of memory, with an error such as this one: Error allocating
E2fsck
directory block array: Memory allocation failed e2fsck: aborted I've added a 4 GB swap partition and it still doesn't complete, but this is a 32-bit kernel, so I don't expect adding any more will help. Apart from booting into a 64-bit kernel, are there any other ways of getting fsck to complete its check? linux debian memory ext3 fsck share|improve this question asked May 17 '09 at 22:10 TimB 1,17521116 add a comment| 2 Answers 2 active oldest votes up vote 10 down vote accepted A 64 bit kernel and large quantities of RAM will allow the fsck to finish nice and fast. Alternately, there's now an option in e2fsck that'll tell it to store all of it's intermediate results in a directory instead of in RAM, which helps immensely. Create /etc/e2fsck.conf with the following contents: [scratch_files] directory = /var/cache/e2fsck (And, obviously, make sure that directory exists, and is on a partition with a good few GB of free space). e2fsck will run SLLOOOOWWWWWWW, but at least it'll complete. Of course, this won't work with the root FS, but if you've got swap then you're past mounting the root FS anyway. share|improve this answer answered May 17 '09 at 23:05 womble♦ 76.6k11117184 add a comment| up vote
system with insufficient RAM, you can encounter the following error. $ e2fsck -p -f /dev/vg_mnt/lv_mnt01 /dev/vg_mnt/lv_mnt01: Error allocating icount structure: Memory allocation failed /dev/vg_mnt/lv_mnt01: Error allocating directory block array: Memory allocation failed e2fsck: aborted This happens because the e2fsck tries to store all inode information in memory, which may exceed the available memory size on the system. To fix this, either upgrade the system with more memory or try to set additional options that allow e2fsck to create a temporary directory on a system with sufficient (several GB's) free disk space. Not http://serverfault.com/questions/9218/running-out-of-memory-running-fsck-on-large-filesystems that this only works for e2fsck version 1.40 or higher (meaning: CentOS and RHEL users are screwed since they only provide 1.39). $ rpm -qa | grep e2fsprogs e2fsprogs-libs-1.39-34.el5_8.1 e2fsprogs-devel-1.39-34.el5_8.1 e2fsprogs-1.39-34.el5_8.1 To run the e2fsck with a recent version, try the following. $ cd /usr/local/src $ wget "http://kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.42.5/e2fsprogs-1.42.5.tar.gz" $ tar xzf e2fsprogs-1.42.5.tar.gz $ rm -f e2fsprogs-1.42.5.tar.gz $ cd e2fsprogs-1.42.5 $ yum install gcc https://ma.ttias.be/e2fsck-error-allocating-directory-block-array-memory-allocation-failed/ make $ ./configure $ make The above will download e2fsck (the latest version as of this writing), compile and make it but leave it in the directory of the build (/usr/local/src/e2fsck), it won't copy the binaries to your system. That means you can use the newly compiled binary at /usr/local/src/e2fsprogs-1.42.5/e2fsck/e2fsckw. Now, since you have a e2fsck version higher than 1.40, you can set the options to use a scratch-disk and avoice the Out-of-Memory errors. First, create the directory. $ mkdir -p /var/cache/e2fsck And create a custom file called /etc/e2fsck.conf that contains the following content. $ cat /etc/e2fsck.conf [scratch_files] directory = /var/cache/e2fsck This tells e2fsck to use a directory on disk if the total available memory is insufficient to host all inode information of the partition. If you had to make a new e2fsck yourself because the OS didn't have a recent version, start the new e2fsck as such. $ /usr/local/src/e2fsprogs-1.42.5/e2fsck/e2fsck -f /dev/vg_mnt/lv_mnt01 If you had a recent version already, you can simply restart e2fsck with the system binary. $ e2fsck -f /dev/vg_mnt/lv_mnt01 When the new e2fsck is running, you should see additional information appear in the cache-directory
detail in the user manual, but alas, the many desperate calls for help on the QNAP forums are evidence that this process does not always work smoothly. So I was not surprised when I was unsuccessful with my upgrade. I replaced http://cdonner.com/qnap-raid-expansion.htm 4x2TB disks with 4x3TB disks because I had run out of space in my RAID 5 array. This is exactly the scenario I was working with, except for the disk sizes (image taken from the QNAP documentation): 9 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=509529 steps Steps 1 through 6 worked as expected. I was able to replace and rebuild each drive through the Web interface as described in the manual. Then I had a RAID 5 array on the new 3TB memory allocation disks, but still with the old size (5469 GB instead of 8248 GB). Steps 7 and 8 are meant to expand the RAID array so that the newly added space is put to use. The Expand process never completed, though. After 24 hours it would still say Expanding… (50%). So I contacted support. What followed was a replay of all the recipes that I had previously seen on the forums. But because there was no single set memory allocation failed of instructions for the whole process, and because there were some discrepancies here and there between what my support engineer told me and what other people did, and because I have a record of everything I did and I know it worked, I decided to publish my own version. The short version is that the UI stumbles on two potential issues, and it does not tell you. Issue number one is that it may not be able to stop all the services that access the volume, and subsequently the volume cannot be unmounted. I had a lot of things running, including Surveillance Station, EyeOS, and TigerCRM. I don’t think that QNAP tests their script with all the potential packages that people may have installed on their device. The second issue is that there is not enough swap memory. This needs to be addressed. As a result, the only way to complete the expansion successfully is via command shell. Here is what you need to do – assuming that all disks have been replaced and rebuilt, i.e. you have successfully completed steps 1 through 6 in the documentation. 1. Reboot the NAS This is a good idea, because you may have the device in some undefined state, based on prior attempts of addressing the issue. 2. Stop the services Support told me to run the following commands: #/etc/init.d/services