Skip to content

Resize2fs fails with "Killed"

I recently attempted to extend a filesystem on my Ubuntu system and ran into an interesting problem I figured would be worth sharing.

I was following the steps on my creating and extending logical volumes post and made it to the last step where you need to resize the filesystem using resize2fs. Initially when I ran the command I received:

OK, let me run that… over an hour later it finished. Great, let’s resize the filesystem!

Excuse me? At first, I thought I had accidentally killed the command since I had been multi-tasking. In a panic, because I thought I may have permanently messed up the filesystem, I ran e2fsck again and waited another hour. The good news is the filesystem was fine. So I tried resize2fs again and received the same response. So what was going on?
What I should have done when I first hit the problem was check the logs as doing so would have given me a clue.

Well look at that, the kernel is killing processes including resize2fs. Why is it doing that? Well, it turns out my Ubuntu system only had 512 MB of RAM and I guess when you attempt to extend a 2TB filesystem into a 6TB filesystem you need a little more memory 🙂 I shut down the system, increased the memory to 4GB, fired it back up and tried again. This time I watched top as it ran. It managed to consume 330 MB of memory, but this time completed successfully.
In the end this turned out to be a corner case, but I hope it is useful for someone as I was unable to find anyone who had talked about it on Google.

© 2015, Steve Flanders. All rights reserved.

Published inSystem Administration

Be First to Comment

    Leave a Reply

    Your email address will not be published. Required fields are marked *