What's new

"Cannot allocate memory" Error During Disk Scan

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Toot4fun

Occasional Visitor
Good morning-

I have a 4TB USB drive (WD Passport) attached to my router (RT-AC68U) and Merlin (380.65) is reporting that there's an issue with the drive (even though it's brand new). When Merlin scans the drive, it gives me the following (detailed status removed to keep the log output short):

Code:
ntfsck 3014.5.21
Checking NTFS Superblock ...
Device name        : /dev/sda1
NTFS volume version: 3.1
Cluster size       : 4096 bytes
Current volume size: 4000750498304 bytes (4000751 MB)
Current device size: 4000750501888 bytes (4000751 MB)
Checking for bad sectors ...
Scanning $MFT ...
Actual VCN (0x0) of index buffer is different from expected VCN (0x24) in inode 0x2efd.
Actual VCN (0x0) of index buffer is different from expected VCN (0x45) in inode 0x330b.
Checking directory structure ...
Corrupt directory found, inode=12029 (0x2efd)
Corrupt directory found, inode=13067 (0x330b)
Repairing corrupt directories started.
  0.00 percent completed
100.00 percent completed
Repairing corrupt directories completed.
Repairing corrupt directories started.
  0.00 percent completed
100.00 percent completed
Actual VCN (0x0) of index buffer is different from expected VCN (0x7d) in inode 0x351e.
Actual VCN (0x0) of index buffer is different from expected VCN (0x15) in inode 0x38d0.
Repairing corrupt directories completed.
Corrupt directory found, inode=13598 (0x351e)
Corrupt directory found, inode=14544 (0x38d0)
Repairing corrupt directories started.
  0.00 percent completed
100.00 percent completed
Repairing corrupt directories completed.
Repairing corrupt directories started.
  0.00 percent completed
100.00 percent completed
this seems to be endless.
Repairing corrupt directories completed.
Checking for orphaned files ...
  0.00 percent completed
 99.53 percent completed
Adding orphaned inode 181440 (0x2c4c0) to directory 5 (0x5)
 99.58 percent completed
 99.64 percent completed
 99.69 percent completed
Adding orphaned inode 181737 (0x2c5e9) to directory 181440 (0x2c4c0)
 99.74 percent completed
 99.80 percent completed
 99.85 percent completed
 99.91 percent completed
 99.96 percent completed
100.00 percent completed
Scanning orphaned files completed.
Checking attributes ...
  0.00 percent completed
100.00 percent completed
Failed to calloc 122093216 bytes: Cannot allocate memory
Checking cluster allocation ...
ERROR(12): Failed to setup allocation bitmap: Cannot allocate memory
Syncing device ...

When I attach this same drive to my (Windows) laptop and run a chkdsk, it says, "Windows has scanned the file system and found no problems. No further action is required."

Is there a way for me to either scan this drive with Merlin or a flavor of Linux that will allow it to be "fixed" in such a way that Merlin will be happy again?

Thank you!!
 
I had the exact same issue and ended up formatting the Drive with ext4 and I haven't had an error yet, I only reformatted it yesterday but fingers crossed.

I use rsnapshot via optware to backup a drive to this drive and ntfs on the second router kept throwing errors and eventually cannot delete files.

I had to format the 4TB drive on a raspberry pi to get the ext4 format to take.
 
It is possible that your Asus is running out of RAM when it does the scan. I set a 256 meg swap file on a thumb drive in the other USB port, set a script to turn the swap on boot. Router did get into swap running disc scan and drive master.
 
I thought that exact thing and set a swap file up, this didn't help and still shows the same error on checking the disk.
 
You cannot run ntfsck on 4TB drive with the tiny 256 MB RAM of you router - connect the drive on a PC and run chkdsk there! :rolleyes:
 
You cannot run ntfsck on 4TB drive with the tiny 256 MB RAM of you router - connect the drive on a PC and run chkdsk there! :rolleyes:

This was my first thought, but as I said, "When I attach this same drive to my (Windows) laptop and run a chkdsk, it says, 'Windows has scanned the file system and found no problems. No further action is required.'" Does it make sense to check the disk using some flavor of Linux that might be similar to what Merlin is using?
 
Does it make sense to check the disk using some flavor of Linux that might be similar to what Merlin is using?
Nope! Windows is the owner of NTFS and gives you the final OK! :D
 
I have a couple of thoughts on this:
1) What level of chkdsk did you run when connected to a PC? Running "chkdsk /R" is a much more thorough scan than the default. It'll take a while on a 4T drive as it reads every sector on the drive, but if you want to get to end-game, I assume the time will be well spent.
2) I would think you could get through the fsck on the router it you had a swapfile, but it would have to be on a different physical drive than the one you're trying to check. Any 1G or larger flashdrive configured as swap space should do it if you don't normally run a swapfile.

My 2 cents ...
 
I have a couple of thoughts on this:
1) What level of chkdsk did you run when connected to a PC? Running "chkdsk /R" is a much more thorough scan than the default.
...adding /scan option is even better! :oops:
 
Adding a swap file was the way to go for me (I followed these instructions), so thank you to everyone for your help with this.

Just a few follow-up points:
  1. I ran a "chkdsk /R" from my Windows PC and after processing for 12 hours, it still said "Windows has scanned the file system and found no problems. No further action is required."
  2. What disk checker is Merlin running under the covers for NTFS? "fsck.ntfs" from an ssh session gives mee "-sh: fsck.ntfs: not found" message, so it is ntfsck?
Thank you!!
 
Adding a swap file was the way to go for me (I followed these instructions), so thank you to everyone for your help with this.

Just a few follow-up points:
  1. I ran a "chkdsk /R" from my Windows PC and after processing for 12 hours, it still said "Windows has scanned the file system and found no problems. No further action is required."
  2. What disk checker is Merlin running under the covers for NTFS? "fsck.ntfs" from an ssh session gives mee "-sh: fsck.ntfs: not found" message, so it is ntfsck?
Thank you!!
Glad adding swap worked for you! I can't explain why the Linux check disk found something the Windows version didn't. Perhaps Windows will fix some NTFS errors on-the-fly while in use, so they don't bother to look for or fix as part of chkdsk?

As for the AsusWRT-Merlin disk checker, the only one I'm aware of that comes stock is '/usr/sbin/ntfsck'.
 
I too, run into this error. I only see it on my 4 TB Seagate Expansion portable HDD (model # STEA4000400, USB 3.0). It only fails allocating memory. It fixed everything else.

Code:
Failed to calloc 122090176 bytes: Cannot allocate memory

Checking cluster allocation ...
ERROR(12): Failed to setup allocation bitmap: Cannot allocate memory
Syncing device ...

Good to know that it's just having an issue recognizing 4 TB HDD. Bad news is, would it have a problem later on accessing the entire 4 TB HDD, because I still have over 1 TB of free space left to fill it.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top