Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Ubuntu 11.10, which came with kernel version 3.0.0-14. I downloaded and built a kernel from the 3.1.0 branch. After installing the new kernel, I see that my /boot/initrd.img-3.1.0 file is HUGE. It's 114MB, while my /boot/initrd.img-3.0.0-14-generic is about 13MB. I want to get rid of the bloat, which is clearly unnecessary.

When building the new kernel, I copied my /boot/config-3.0.0-14-generic to .config in my build directory, as to keep the configuration of my original kernel. I ran make oldconfig, selected the defaults for all the new options, and then built the kernel.

Looking at the file sizes within each of the initrd cpio archives, I see that all of my .ko modules are larger in size in the 3.1.0 ramdisk, than the 3.0.0-14. I assumed there was an unnecessary debug flag checked in my config file, but I don't see anything different that was not already enabled in the 3.0.0-14 config file.

My /boot/config-3.0.0-14-generic is here: http://pastebin.com/UjH7nEqd

And my /boot/config-3.0.1 is here: http://pastebin.com/HyT0M2k1

Can anyone explain where all the unnecessary bloat is coming from?

share|improve this question
up vote 13 down vote accepted

When building the kernel and module using make oldconfig, make and make install, the resulting modules will have debug information available in the files.

Use the INSTALL_MOD_STRIP option for removing debugging symbols:

make INSTALL_MOD_STRIP=1 modules_install

Similarly, for building the deb packages:

make INSTALL_MOD_STRIP=1 deb-pkg
share|improve this answer
Running make INSTALL_MOD_STRIP=1 install got me what I wanted. Thanks! – Finer Recliner Jan 30 '12 at 2:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.