Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
initramfs out of memory error [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Timmer
Guru
Guru


Joined: 24 Aug 2004
Posts: 309
Location: Bloomington, IN, USA

PostPosted: Wed Feb 01, 2012 2:55 am    Post subject: initramfs out of memory error [solved] Reply with quote

This is the end result of a long story, and I'm going to tell as much as it as possible, because I'm not sure I actually have the problem figured out. So maybe with information, someone will be able to help me, even if I'm barking up the wrong tree.

I needed to repartition my harddrive, so I backed the whole thing up on an external, and repartitioned, and then decided to take the opportunity to format it to ext4.

Then I copied everything back on, reinstalled grub2 on the drive, and rebooted. Computer didn't boot, because I forgot that I didn't have ext4 built into my old kernel. So I tried rebuilding the kernel. But it ran out of memory while it was building initramfs (which has never happened before). So I decided to skip that, and just put an init parameter in my kernel boot line.

Grub worked then, but now my kernel panics immediately, without an error messages, like it can't load the init files. So I'm trying to figure out how to get the initramfs to build again, thinking that it has something to do with that.

Any ideas on why it might be running out of memory (I have 6 gigs, so it's certainly not a shortage of ram - does it have something to do with chrooting?)


Last edited by Timmer on Fri Feb 03, 2012 5:11 am; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 6828

PostPosted: Wed Feb 01, 2012 4:26 am    Post subject: Reply with quote

Please post the exact failure message when it runs out of memory, and at least 20 lines of context before that. How do you create your initramfs? Is it managed for you by genkernel, by a personal script, or by the kernel build process?
Back to top
View user's profile Send private message
Timmer
Guru
Guru


Joined: 24 Aug 2004
Posts: 309
Location: Bloomington, IN, USA

PostPosted: Wed Feb 01, 2012 3:57 pm    Post subject: Reply with quote

There aren't 20 lines before that... When I get home I'll re-run it and put it in here, but since it's the only thing that's building (because there were no other changes to the kernel) it happens at something like line 3.

The initramfs is created by the kernel build process.
Back to top
View user's profile Send private message
Timmer
Guru
Guru


Joined: 24 Aug 2004
Posts: 309
Location: Bloomington, IN, USA

PostPosted: Thu Feb 02, 2012 2:32 am    Post subject: Reply with quote

Here's the output, in its entirety:

Code:

# make
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  GEN     usr/initramfs_data.cpio.lzma
out of memory
 line 11
make[1]: *** [usr/initramfs_data.cpio.lzma] Error 255
make: *** [usr] Error 2
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 6828

PostPosted: Thu Feb 02, 2012 3:24 am    Post subject: Reply with quote

Why are you building the kernel as root? What is the output of ulimit -a ; free?
Back to top
View user's profile Send private message
Timmer
Guru
Guru


Joined: 24 Aug 2004
Posts: 309
Location: Bloomington, IN, USA

PostPosted: Thu Feb 02, 2012 2:07 pm    Post subject: Reply with quote

I thought I mentioned that this was in a chrooted environment. To my knowledge, once you chroot, you're root whether you want to be or not. You don't have the option to chroot as a non-privileged user.

ulimit -a will have to wait until I get home, but I ran free several times the other day, in another terminal while this was happening.

I start with about 4.5 GB of free memory (guessing the LiveDVD is using the other 1.5), and between "out of memory line 11" and "make[1]: *** [usr/initramfs_data.cpio.lzma] Error 255 " the memory shrinks until I have roughly 31 KB. Then make exits, and gives it all back.
Back to top
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2194
Location: Germany

PostPosted: Thu Feb 02, 2012 2:54 pm    Post subject: Reply with quote

You could su to a normal user once inside the chroot, I guess. I build kernel as root myself though, I don't think there's a problem with it really.

There is very little reason for initramfs creation to run out of memory. You probably have a bad file in your initramfs setup, for example trying to integrate /proc/* into the initramfs is bound to fail.

Sometimes also the kernel make fails to build the initramfs properly, in such a case you have to make clean / mrproper or manually delete the usr/initramfs_data.cpio
Back to top
View user's profile Send private message
Timmer
Guru
Guru


Joined: 24 Aug 2004
Posts: 309
Location: Bloomington, IN, USA

PostPosted: Fri Feb 03, 2012 5:11 am    Post subject: Reply with quote

I figured it out. Thanks for the help. It turns out that after repartitioning the drive, I forgot to recopy /dev/sda3 (my root partition) into the initramfs, so it was trying to use the old one and failing.

Fixed that, and have a seg fault problem, but I haven't given up on solving that one myself yet. Original problem is solved though, so marking the thread as such.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum