linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Tim <elatllat@gmail.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: resize2fs: Memory allocation failed while trying to resize
Date: Thu, 29 Aug 2013 11:04:30 -0500	[thread overview]
Message-ID: <521F710E.7000409@redhat.com> (raw)
In-Reply-To: <CA+3zgmtOoDGSGQrk4k3QNuAkgpoDgF+xUkFT5qY9cKKS76MiQQ@mail.gmail.com>

On 8/28/13 10:29 AM, Tim wrote:
> Hi,
> 
> I used resize2fs to do an online grow of from 8TB to 12TB and that worked fine.
> now I'm trying to offline shrink back down to 8TB and resize2fs is
> unable to do so.
> 
> Output:
> resize2fs -M /dev/mapper/
> crypt_left
> resize2fs 1.42.5 (29-Jul-2012)
> Resizing the filesystem on /dev/mapper/crypt_left to 1885633106 (4k) blocks.
> resize2fs: Memory allocation failed while trying to resize
> /dev/mapper/crypt_left
> Please run 'e2fsck -fy /dev/mapper/crypt_left' to fix the filesystem
> after the aborted resize operation.
> 
> I am using a raspberrypi so it's 32-bit and limited to 256MB and I
> have 2x that in swap.

Ok, now, hold on right there ;)

On the one hand it's worth understanding which memory allocation failed
and whether there's anything to be done about it, but:

Hoping to administer a 12T filesystem on a box with 256M of memory is
almost certainly wishful thinking.  (ok, 768M with swap)


A crucial part of deploying systems with very large filesystems is ensuring
that there is enough system memory to go along with it; in this case,
there almost certainly is not.

> uname -a
> Linux test 3.6.11+ #474 PREEMPT Thu Jun 13 17:14:42 BST 2013 armv6l GNU/Linux
> 
> I was watching top and never saw it use more that 53% of the RAM but I
> may have missed the crucial moment.
> (taken during a "e2fsck -fy ")
> free
>              total used free shared buffers cached
> Mem: 237648 225440 12208 0 63240 11796
> -/+ buffers/cache: 150404 87244
> Swap: 475132 13444 461688
> 
> Please let me know if there is anything that would help solve this issue.

You might use gdb, or an instrumented resize2fs, to find out which memory
allocation is failing and/or where the memory allocations are going.
The sad truth may just be that 256M + 512M swap isn't going to do the
trick.

-Eric

  reply	other threads:[~2013-08-29 16:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-28 15:29 resize2fs: Memory allocation failed while trying to resize Tim
2013-08-29 16:04 ` Eric Sandeen [this message]
2013-08-29 23:24   ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=521F710E.7000409@redhat.com \
    --to=sandeen@redhat.com \
    --cc=elatllat@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).